{"components":{"schemas":{"Error":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"request_id":{"type":"string"}},"type":"object"}},"type":"object"},"Event":{"properties":{"created":{"type":"string"},"data":{"type":"object"},"id":{"type":"string"},"type":{"enum":["payment.succeeded","payment.failed","payment.pending","refund.succeeded","refund.failed","payout.paid","payout.rejected","order.paid","invoice.paid"]}},"type":"object"},"PaymentLink":{"properties":{"amount_minor":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"currency":{"enum":["TZS","KES","UGX","RWF","USD","EUR","GBP"]},"description":{"type":["string","null"]},"expires_at":{"format":"date-time","type":["string","null"]},"id":{"example":"plink_8sK2\u2026","type":"string"},"methods":{"items":{"type":"string"},"type":"array"},"object":{"const":"payment_link"},"status":{"enum":["active","disabled"]},"title":{"type":"string"},"url":{"format":"uri","type":"string"}},"type":"object"},"Payout":{"properties":{"amount_minor":{"type":"integer"},"currency":{"type":"string"},"id":{"type":"string"},"mode":{"enum":["sandbox","live"]},"object":{"const":"payout"},"status":{"enum":["requested","approved","paid","rejected","failed"]}},"type":"object"},"Refund":{"properties":{"amount_minor":{"type":"integer"},"currency":{"type":"string"},"id":{"type":"string"},"object":{"const":"refund"},"reason":{"type":"string"},"status":{"enum":["requested","processing","succeeded","rejected","failed"]},"transaction_id":{"type":"string"}},"type":"object"},"Transaction":{"properties":{"amount_minor":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"currency":{"type":"string"},"customer":{"properties":{"email":{"type":["string","null"]},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"type":"object"},"fee_minor":{"type":"integer"},"id":{"type":"string"},"method":{"type":["string","null"]},"mode":{"enum":["sandbox","live"]},"net_minor":{"type":"integer"},"object":{"const":"transaction"},"provider_reference":{"type":["string","null"]},"reference":{"type":"string"},"refunded_minor":{"type":"integer"},"status":{"enum":["created","pending","processing","succeeded","failed","cancelled","expired","refunded","partially_refunded"]}},"type":"object"},"WebhookEndpoint":{"properties":{"events":{"items":{"enum":["payment.succeeded","payment.failed","payment.pending","refund.succeeded","refund.failed","payout.paid","payout.rejected","order.paid","invoice.paid","*"]},"type":"array"},"id":{"type":"string"},"secret":{"description":"Returned only when the endpoint is created.","type":"string"},"url":{"type":"string"}},"type":"object"}},"securitySchemes":{"bearerAuth":{"description":"Secret API key: sk_test_\u2026 or sk_live_\u2026","scheme":"bearer","type":"http"}}},"info":{"description":"Versioned REST API for payment links, payments, transactions, refunds, payouts and webhooks. Amounts in requests are decimal strings (e.g. \"1500.50\"); amounts in responses are integer minor units (`amount_minor`). Test keys (sk_test_) only use sandbox methods \u2014 no real money moves.","title":"FlyPay Nexus API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/balance":{"get":{"responses":{"200":{"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Retrieve derived balances","tags":["Payouts"]}},"/payment-links":{"get":{"parameters":[{"in":"query","name":"page","schema":{"default":1,"minimum":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"status","schema":{"enum":["active","disabled"]}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PaymentLink"},"type":"array"},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"object":{"const":"list"},"page":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"List payment links","tags":["Payment links"]},"post":{"parameters":[{"description":"Unique key (\u2264 100 chars). Retrying with the same key returns the original response.","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"example":"120000","type":"string"},"currency":{"enum":["TZS","KES","UGX","RWF","USD","EUR","GBP"]},"description":{"maxLength":1000,"type":"string"},"expires_at":{"format":"date-time","type":"string"},"methods":{"items":{"type":"string"},"type":"array"},"title":{"maxLength":120,"type":"string"}},"required":["title","amount","currency"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Create a payment link","tags":["Payment links"]}},"/payment-links/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Retrieve a payment link","tags":["Payment links"]},"patch":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"status":{"enum":["active","disabled"]}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Enable or disable a payment link","tags":["Payment links"]}},"/payments":{"post":{"description":"Creates a transaction and asks the provider to collect it. Mobile money methods require `customer.phone`. The response `next_action` tells you what the customer must do (approve on phone, redirect to a hosted card page, or follow bank instructions).","parameters":[{"description":"Unique key (\u2264 100 chars). Retrying with the same key returns the original response.","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"type":"string"},"currency":{"enum":["TZS","KES","UGX","RWF","USD","EUR","GBP"]},"customer":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"}},"type":"object"},"description":{"type":"string"},"method":{"example":"sandbox_mpesa","type":"string"}},"required":["amount","currency","method"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Create a payment","tags":["Payments"]}},"/payments/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Retrieve a payment (by id or reference)","tags":["Payments"]}},"/payouts":{"get":{"parameters":[{"in":"query","name":"page","schema":{"default":1,"minimum":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Payout"},"type":"array"},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"object":{"const":"list"},"page":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"List payouts","tags":["Payouts"]},"post":{"parameters":[{"description":"Unique key (\u2264 100 chars). Retrying with the same key returns the original response.","in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"type":"string"},"currency":{"enum":["TZS","KES","UGX","RWF","USD","EUR","GBP"]},"destination_id":{"type":"string"}},"required":["destination_id","amount","currency"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Request a payout","tags":["Payouts"]}},"/refunds":{"get":{"parameters":[{"in":"query","name":"page","schema":{"default":1,"minimum":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Refund"},"type":"array"},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"object":{"const":"list"},"page":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"List refunds","tags":["Refunds"]},"post":{"description":"Refund requests are reviewed before being sent to the provider.","parameters":[{"description":"Unique key (\u2264 100 chars). Retrying with the same key returns the original response.","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"type":"string"},"reason":{"type":"string"},"transaction_id":{"type":"string"}},"required":["transaction_id","amount","reason"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Request a refund","tags":["Refunds"]}},"/transactions":{"get":{"parameters":[{"in":"query","name":"page","schema":{"default":1,"minimum":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"method","schema":{"type":"string"}},{"in":"query","name":"from","schema":{"format":"date","type":"string"}},{"in":"query","name":"to","schema":{"format":"date","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Transaction"},"type":"array"},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"object":{"const":"list"},"page":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"List transactions","tags":["Payments"]}},"/webhooks/endpoints":{"get":{"responses":{"200":{"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"List webhook endpoints","tags":["Webhooks"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"events":{"items":{"type":"string"},"type":"array"},"url":{"format":"uri","type":"string"}},"required":["url","events"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"Created (includes the signing secret once)"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"Create a webhook endpoint","tags":["Webhooks"]}},"/webhooks/events":{"get":{"parameters":[{"in":"query","name":"page","schema":{"default":1,"minimum":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"object":{"const":"list"},"page":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid API key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict (e.g. idempotency key reused with different parameters)"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation failed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limited"}},"summary":"List events","tags":["Webhooks"]}}},"security":[{"bearerAuth":[]}],"servers":[{"url":"https://flypaynexus.com/api/v1"}]}
