{"openapi":"3.0.0","info":{"title":"API","version":"1.0.0","description":"API documentation"},"servers":[{"url":"https://silent.link","description":"Production server"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Admin API authentication"}},"schemas":{"Invoice":{"type":"object","properties":{"id":{"type":"string","description":"Invoice ID"},"url":{"type":"string","description":"Invoice payment URL"},"status":{"type":"string","enum":["New","Processing","Settled","Invalid","Expired"]}}},"Order":{"type":"object","properties":{"imsi":{"type":"string","description":"IMSI number"},"token":{"type":"string","description":"Order token"},"invoice_id":{"type":"string","description":"Associated invoice ID"},"url":{"type":"string","description":"Order URL"},"qr":{"type":"string","description":"QR code data"}}},"Error":{"type":"object","properties":{"status":{"type":"string","example":"fail"},"error":{"type":"string","description":"Error message"}}}}},"tags":[{"name":"Public","description":"Public API endpoints"}],"paths":{"/api/v1/order/{token}/json":{"get":{"summary":"Get order JSON data by token (Public API)","tags":["Public"],"parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"Order token"},{"in":"query","name":"ref","required":false,"schema":{"type":"string"},"description":"Affiliate refcode"}],"responses":{"200":{"description":"Order JSON data","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","description":"Plan name"},"msisdn":{"type":"string","description":"Phone number or \"N/A\""},"balance":{"type":"string","description":"Current balance"},"expiry date":{"type":"string","format":"date-time","description":"Expiry date or \"N/A\""}}}}}},"401":{"description":"Invalid token"},"402":{"description":"Invoice not processed yet"},"410":{"description":"Bulk order not supported","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"fail"}}}}}}}}},"/api/v1/order/{token}/topup":{"post":{"summary":"Topup order by token (Public API)","tags":["Public"],"parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"Order token"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","description":"Topup amount"},"ref":{"type":"string","description":"Affiliate refcode"},"redirectURL":{"type":"string","description":"Redirect URL after payment (optional)"}}}}}},"responses":{"200":{"description":"Topup invoice created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Invoice ID"},"paymentMethods":{"type":"array","description":"Available payment methods","items":{"type":"object","properties":{"paymentMethodId":{"type":"string","description":"Payment method ID (e.g. BTC, BTC-LightningNetwork)"},"currency":{"type":"string","description":"Currency code"},"destination":{"type":"string","description":"Wallet address"},"amount":{"type":"string","description":"Amount to pay"},"due":{"type":"string","description":"Remaining amount due"},"rate":{"type":"string","description":"Exchange rate"},"paymentLink":{"type":"string","description":"Payment link URI"},"expiryDate":{"type":"string","description":"Invoice expiration timestamp"}}}}}}}}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid token"},"410":{"description":"Bulk order not supported","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"fail"}}}}}}}}},"/api/v1/order/{token}/renew":{"post":{"summary":"Renew order by token (Public API)","tags":["Public"],"parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"Order token"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string","description":"Affiliate refcode"},"redirectURL":{"type":"string","description":"Redirect URL after payment (optional)"}}}}}},"responses":{"200":{"description":"Renew invoice created","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Invoice ID"},"paymentMethods":{"type":"array","description":"Available payment methods","items":{"type":"object","properties":{"paymentMethodId":{"type":"string","description":"Payment method ID (e.g. BTC, BTC-LightningNetwork)"},"currency":{"type":"string","description":"Currency code"},"destination":{"type":"string","description":"Wallet address"},"amount":{"type":"string","description":"Amount to pay"},"due":{"type":"string","description":"Remaining amount due"},"rate":{"type":"string","description":"Exchange rate"},"paymentLink":{"type":"string","description":"Payment link URI"},"expiryDate":{"type":"string","description":"Invoice expiration timestamp"}}}}}}}}}}},"400":{"description":"Invalid request or invalid number"},"401":{"description":"Invalid token"},"410":{"description":"Bulk order not supported","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"fail"}}}}}}}}},"/api/v1/order/new":{"post":{"summary":"Create new order (buy) (Public API)","tags":["Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan","balance"],"properties":{"ref":{"type":"string","description":"Affiliate refcode"},"plan":{"type":"string","description":"Plan ID"},"balance":{"type":"string","description":"Initial balance"},"redirectURL":{"type":"string","description":"Redirect URL after payment (optional)"}}}}}},"responses":{"200":{"description":"Order created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Invoice ID"},"token":{"type":"string","description":"Order token"},"paymentMethods":{"type":"array","description":"Available payment methods","items":{"type":"object","properties":{"paymentMethodId":{"type":"string","description":"Payment method ID (e.g. BTC, BTC-LightningNetwork)"},"currency":{"type":"string","description":"Currency code"},"destination":{"type":"string","description":"Wallet address"},"amount":{"type":"string","description":"Amount to pay"},"due":{"type":"string","description":"Remaining amount due"},"rate":{"type":"string","description":"Exchange rate"},"paymentLink":{"type":"string","description":"Payment link URI"},"expiryDate":{"type":"string","description":"Invoice expiration timestamp"}}}}}}}}}}},"400":{"description":"Invalid request (missing plan or balance)"}}}}}}