{"openapi":"3.1.0","info":{"title":"Afriex Business API","version":"1.0.13","description":"Welcome to the Afriex Business API. This API allows you to manage customers,\nprocess payments, handle payouts, and receive real-time notifications via\nwebhooks.\n\nFor detailed guidance on authentication, pagination, error handling, and\nwebhooks, please refer to the [dedicated\nguides](https://docs.afriex.com) in the top bar. The guide\nprovides a step-by-step instructions to help you integrate seamlessly.\n\n## Testing in sandbox\n\nSend requests to `https://sandbox.api.afriex.com` with a sandbox API key.\nNo real money moves. Deposits, payouts and virtual accounts can be tested\non every payment method and currency your business supports.\n\n**When transactions complete.** A sandbox deposit or payout completes on\nits own about 5 minutes after it is created, and your webhook receives the\nfinal status, exactly as in production. To complete one sooner:\n\n- Include `SIMULATE_INSTANT` anywhere in `meta.reference` when you create\n  it, and it completes in about 30 seconds.\n- Or call `POST /api/v1/transaction/{transactionId}/simulate` with\n  `{\"outcome\": \"success\"}` or `{\"outcome\": \"failed\"}` to complete it now.\n\n**Choosing an outcome.** The last four digits of the account number, the\nphone number or the card number decide what happens. A payment method with\nnone of these (an email or a wallet address) succeeds unless you complete it\nwith `/simulate`:\n\n| Ends in | Payout | Mobile money deposit | Card deposit |\n| --- | --- | --- | --- |\n| anything else | Succeeds | Succeeds | Succeeds |\n| `0001` | Fails; your balance is refunded | Fails | Fails |\n| `0002` | Succeeds | Waits for a one-time password (see below) | Succeeds |\n| `0003` | Stays pending until you call `/simulate` | Stays pending until you call `/simulate` | Stays pending until you call `/simulate` |\n| `0004` | Account name lookup (`GET /api/v1/payment-method/resolve`) fails | Succeeds | Succeeds |\n| `0005` | Declined immediately | Declined immediately | Declined immediately |\n\nA phone number must still be a valid mobile number for its country, so keep\nthe country prefix and change only the last digits, for example\n`+254712340002` in Kenya. Account name lookups return `Sandbox Test Account`.\n\n**One-time passwords.** A mobile money deposit from a wallet ending in\n`0002` returns `CUSTOMER_ACTION_REQUIRED`. Complete it with\n`POST /api/v1/transaction/{transactionId}/authorize` and the OTP `123456`;\nany other OTP returns `OTP_INCORRECT`. The deposit then completes as above.\n\n**Virtual accounts.** Sandbox virtual accounts receive no money on their\nown. Pay into one with\n`POST /api/v1/payment-method/virtual-account/simulate-transfer`.\n\n**Cards.** The API does not create card payment methods or card deposits.\nCards are collected on the hosted checkout page; use a test card number\nwhose last four digits choose the outcome.\n\n**Balances and webhooks.** Fund your sandbox balance with\n`POST /api/v1/org/balance/topup`, and send yourself a sample webhook with\n`POST /api/v1/webhooks/trigger`.\n\n## Request IDs\n\nEvery response, successful or not, carries an `x-request-id` header that\nidentifies that one request. Log it with your request, and include it when\nyou contact support about a request: it lets us find that request in our\nlogs. Treat it as an opaque string; each request gets a new one.","termsOfService":"https://www.afriex.com/terms-and-condition","contact":{"name":"Afriex API Support","email":"support@afriex.com","url":"https://docs.afriex.com"},"license":{"name":"Proprietary","url":"https://www.afriex.com/terms-and-condition"}},"servers":[{"url":"https://sandbox.api.afriex.com","description":"Sandbox Base URL"},{"url":"https://api.afriex.com","description":"Production Base URL"}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Static business API key issued from the dashboard. A business can\nprovision **multiple API keys**, each scoped to a configurable set\nof **permissions** (e.g. read transactions, create deposits, etc).\nPermissions are chosen per key at creation time in the dashboard\nand may be revoked by deleting the key. Manage your keys and\ntheir permissions under **Developer → API keys** in the dashboard.\n\nA request whose key does not carry the permission the target\nendpoint requires is rejected with `401 Unauthorized`, the same\nresponse an unrecognised, malformed, revoked or disabled key\nreturns. The API does not distinguish the two cases on the wire.\n\nSee the [Permissions reference](https://docs.afriex.com/api-reference/permissions)\nfor the permission each endpoint requires."}},"headers":{"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate limit window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the next request fits in the window.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying. Sent with a 429.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Identifies this request. Sent on every response, errors included. Quote it to support when asking about a request.","schema":{"type":"string","example":"5f3b1c0e2a7d94c5b8e6a1d2c3b4f5a6"}}},"parameters":{"x-api-version":{"name":"x-api-version","in":"header","required":false,"description":"API version in ISO 8601 format. The only supported version is `2026-05-18`, which is also the default when the header is omitted. Any other value is rejected with a `400 Bad Request`.","schema":{"type":"string"}},"x-api-signature":{"name":"x-api-signature","in":"header","required":false,"description":"Signature of the request payload, used for request authentication where payload signing is enabled for your business.","schema":{"type":"string"}},"paymentBatchId":{"name":"batchId","in":"path","required":true,"description":"Id of a batch belonging to the calling business.","schema":{"type":"string"}},"paymentBatchPage":{"name":"page","in":"query","required":false,"description":"Zero-based page number for pagination.","schema":{"type":"integer","minimum":0,"default":0}},"paymentBatchLimit":{"name":"limit","in":"query","required":false,"description":"Number of items per page (max 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}}},"schemas":{"BankCodeResolverResponse":{"type":["object","null"],"properties":{"bankName":{"type":"string","description":"The resolved bank or institution name."}}},"Customer":{"type":"object","properties":{"customerId":{"type":"string","description":"The unique identifier for the customer."},"reference":{"type":"string","description":"A shortened reference for the customer. Returned on every customer response (create, list, by-ID, update, KYC and verify) and used as the pool-account reference when submitting a payment proof. Falls back to the customer id when no shortened reference has been assigned."},"name":{"type":"string","description":"The full name of the customer."},"email":{"type":"string","format":"email","description":"The email of the customer."},"phone":{"type":"string","description":"The phone number of the customer in E.164 format."},"countryCode":{"type":"string","description":"The country code of the customer in ISO 3166-1 alpha-2 format."},"meta":{"type":"object","description":"Optional meta data you can attach to the customer. On the responses of `PATCH /api/v1/customer/{customerId}/kyc` and `POST /api/v1/customer/{customerId}/verify` this holds `meta.kyc.data`, the customer's stored KYC documents, in place of your meta data."},"createdAt":{"type":"string","description":"The date and time the customer was created."},"updatedAt":{"type":"string","description":"The date and time the customer was last updated."}}},"TransactionStatus":{"type":"string","enum":["PENDING","PROCESSING","SUCCESS","FAILED","CANCELLED","REFUNDED","RETRY","UNKNOWN","SCHEDULED","CUSTOMER_ACTION_REQUIRED","REJECTED","IN_REVIEW","RFI_REQUESTED","DISPUTED","DISPUTE_RESOLVED","DISPUTE_WON","DISPUTE_LOST","DISPUTE_EVIDENCE_SUBMITTED"],"description":"The current status of the transaction.\n\n`IN_REVIEW` and `RFI_REQUESTED` are review states: the transaction is still in flight and is waiting on a review, not on you. Treat them as non-terminal and keep polling or listening for `TRANSACTION.UPDATED`. `RFI_REQUESTED` may result in someone contacting you for more information about the transfer."},"Transaction":{"type":"object","properties":{"transactionId":{"type":"string","description":"The unique identifier for the transaction."},"customerId":{"type":"string","description":"The unique identifier of the customer."},"sourceId":{"type":"string","description":"The unique identifier of the source payment method."},"destinationId":{"type":"string","description":"The unique identifier of the destination payment method."},"sourceAmount":{"type":"string","description":"The souce transaction amount value"},"sourceCurrency":{"type":"string","description":"The currency code of the wallet charged."},"destinationAmount":{"type":"string","description":"The destination transaction amount value"},"destinationCurrency":{"type":"string","description":"The description currency code."},"type":{"type":"string","enum":["DEPOSIT","WITHDRAW","SWAP","REVERSAL","SCHEDULED","SEND"],"description":"The type of transaction. You can create `DEPOSIT`, `WITHDRAW` and `SWAP`; the other values can appear on transactions listed or fetched for your business."},"channel":{"type":"string","enum":["BANK_ACCOUNT","SWIFT","MOBILE_MONEY","UPI","INTERAC","WE_CHAT","CARD","CRYPTO","VIRTUAL_BANK_ACCOUNT","POOL_ACCOUNT","ACH_BANK_ACCOUNT","PAYBILL_TILL","RFP","VIRTUAL_CARD","ALIPAY","WALLET","PAYMENT_LINQ","ADMIN"],"description":"The payment channel of the transaction. `ADMIN` marks an adjustment Afriex made to your wallet; `PAYMENT_LINQ` a payment made through a payment link."},"status":{"$ref":"#/components/schemas/TransactionStatus"},"merchantReference":{"type":"string","description":"The merchant-supplied reference for the transaction (mirrors meta.reference from the create request)."},"rate":{"type":"string","description":"The realized source-to-destination exchange rate for the transaction, expressed as `1 sourceCurrency = rate destinationCurrency` (equal to destinationAmount / sourceAmount)."},"fee":{"type":"string","description":"The fee charged for this transaction, denominated in `sourceCurrency`. It is reported separately from `sourceAmount`. Omitted when no fee applied to the transaction."},"meta":{"type":"object","description":"Transaction metadata. Echoes the metadata you attached on create and may include server-set state flags such as `otpRequired` and `failureReason`.","properties":{"narration":{"type":"string","description":"The narration you attached when creating the transaction, echoed back. An empty string when none was provided."},"otpRequired":{"type":"boolean","description":"Returned on deposits that may need an extra authorization step. When `true`, the deposit is waiting for the customer to submit a one-time password; call `POST /transaction/{transactionId}/authorize` to complete it."},"failureReason":{"type":"object","description":"Present only when `status` is `FAILED` or `REJECTED`. Carries a stable `AFX_*` code and a customer-safe message. Branch on `code` rather than the underlying rail so your integration stays stable across routing changes.","required":["code","message","retryable"],"properties":{"code":{"type":"string","description":"Stable `AFX_*` failure code. Safe to switch on; the set grows over time but existing values do not change meaning.","example":"AFX_VELOCITY_LIMIT_EXCEEDED","enum":["AFX_REQUEST_FAILED","AFX_SYSTEM_ERROR","AFX_SERVICE_UNAVAILABLE","AFX_INVALID_CURRENCY","AFX_INVALID_AMOUNT","AFX_INVALID_RECIPIENT","AFX_RECIPIENT_NOT_FOUND","AFX_ACCOUNT_CLOSED","AFX_NAME_MISMATCH","AFX_BENEFICIARY_RESTRICTED","AFX_INVALID_SENDER","AFX_INVALID_REQUEST","AFX_VELOCITY_LIMIT_EXCEEDED","AFX_AMOUNT_LIMIT_EXCEEDED","AFX_RECIPIENT_WALLET_LIMIT_REACHED","AFX_PAYMENT_FAILED","AFX_COMPLIANCE_REJECTED","AFX_PROPOSAL_EXPIRED"]},"message":{"type":"string","description":"Customer-safe short description of the failure. Suitable for display; do not parse it. Branch on `code` instead."},"retryable":{"type":"boolean","description":"`true` when re-submitting the same request (or, for `AFX_PROPOSAL_EXPIRED`, starting a fresh proposal) may succeed. `false` when the caller must change the request before retrying."}}}},"additionalProperties":true},"createdAt":{"type":"string","description":"The date and time the transaction was created."},"updatedAt":{"type":"string","description":"The date and time the transaction was last updated."}}},"TransactionMeta":{"type":"object","properties":{"narration":{"type":"string","description":"The optional reason for the transaction."},"invoice":{"type":"string","description":"The invoice filename (S3 object key) for the transaction, as returned by the media upload endpoint. Required for SWIFT withdrawals: the referenced object is verified to exist in storage before the transaction is created, so upload the file first and pass the returned key verbatim."},"idempotencyKey":{"type":"string","description":"The idempotency key for the transaction."},"reference":{"type":"string","description":"The reference for the transaction."},"settlement":{"type":"string","enum":["spot","request"],"description":"Optional settlement handling for the transaction. `spot` (the default) processes immediately and debits your Payout wallet. `request` is only supported for WITHDRAW transactions: it debits your Collection wallet (rather than the default Payout wallet) and queues the payout for the next business day in the destination payment method's country. Omit `settlement` (or send `spot`) for an ordinary payout from the Payout wallet."}},"required":["idempotencyKey","reference"]},"PaymentMethodBankAddress":{"type":"object","description":"The issuing bank's postal address, populated per account by the provider that provisioned it. Present on virtual accounts and other account-shaped payment methods whose provider supplies it; omitted otherwise. This is the bank's address, not the account holder's.","properties":{"line1":{"type":"string","description":"First line of the bank's street address."},"line2":{"type":"string","description":"Second line of the bank's street address, when present."},"city":{"type":"string","description":"City."},"state":{"type":"string","description":"State or region, when present."},"zip":{"type":"string","description":"Postal or ZIP code."},"country":{"type":"string","description":"Country, as supplied by the provider."}}},"PaymentMethod":{"type":"object","description":"A payment method. Empty fields are omitted. Account-shaped channels (BANK_ACCOUNT, MOBILE_MONEY, SWIFT, etc.) populate accountName, accountNumber, and institution; the CARD channel instead populates last4, brand, expiration, and cardName.","properties":{"paymentMethodId":{"type":"string","description":"The unique identifier for the payment method."},"customerId":{"$ref":"#/components/schemas/customerId"},"reference":{"type":"string","description":"Identifier to reconcile incoming deposits against."},"institution":{"$ref":"#/components/schemas/PaymentMethodInstitution"},"transaction":{"$ref":"#/components/schemas/PaymentMethodTransaction"},"recipient":{"$ref":"#/components/schemas/PaymentMethodRecipient"},"channel":{"type":"string","enum":["BANK_ACCOUNT","MOBILE_MONEY","SWIFT","INTERAC","UPI","WE_CHAT","ALIPAY","CARD","CRYPTO","VIRTUAL_BANK_ACCOUNT","POOL_ACCOUNT","ACH_BANK_ACCOUNT","PAYBILL_TILL","RFP","VIRTUAL_CARD"],"description":"The payment method channel."},"countryCode":{"type":"string","description":"The ISO 3166-1 alpha-2 country code."},"currency":{"type":"string","description":"The payment method's currency (ISO 4217). Use this instead of inferring currency from countryCode, which is ambiguous (e.g. a USD account in a non-US country)."},"capabilities":{"type":"array","items":{"type":"string"},"description":"The operations this payment method is enabled for (e.g. DEPOSIT, WITHDRAW). Use it to select deposit-capable vs withdraw-capable methods. Also filterable via the `capabilities` query parameter."},"accountName":{"type":"string","description":"Name of the account holder. Present for account-shaped channels."},"accountNumber":{"type":"string","description":"Account number. Present for account-shaped channels, except INTERAC, which returns none. For UPI it carries the recipient phone number, not the UPI ID."},"routingNumber":{"type":"string","description":"Bank routing number. Present for account-shaped channels that carry one (e.g. ACH bank accounts)."},"bankAddress":{"$ref":"#/components/schemas/PaymentMethodBankAddress"},"status":{"type":"string","enum":["active","pending","deleted","expired","blocked"],"description":"Lifecycle status of the payment method."},"last4":{"type":"string","description":"Last 4 digits of the card. CARD channel only."},"brand":{"type":"string","enum":["Visa","MasterCard","Discover","American Express","JCB","Diners Club","Eftpos Australia","UnionPay","Unknown"],"description":"Card brand. CARD channel only."},"expiration":{"type":"object","description":"Card expiration. CARD channel only.","properties":{"month":{"type":"integer"},"year":{"type":"integer"}}},"cardName":{"type":"string","description":"Name on the card. CARD channel only."},"expiresInMinutes":{"type":"integer","description":"Minutes until a dynamic virtual account expires, when applicable."},"amount":{"description":"The amount stored with the payment method, as you sent it (a number or a numeric string), or the requested amount for a dynamic virtual account, when applicable.","oneOf":[{"type":"number"},{"type":"string"}]},"extra":{"type":"object","description":"Additional channel-specific properties.","additionalProperties":true},"meta":{"type":"object","description":"The meta data you attached to the payment method when you created it."}}},"PaymentMethodInstitution":{"type":"object","description":"On a payment method, only `institutionId`, `institutionName`, `institutionCode`, `institutionAddress` and the correspondent bank fields are returned. The address components and `institutionBranch` are accepted when you create one but are not returned on it; `institutionBranch` is returned by the institution list.","properties":{"institutionId":{"type":"string","description":"The unique identifier of the bank or mobile money provider if required."},"institutionName":{"type":"string","description":"The name of the bank or mobile money provider if required."},"institutionCode":{"type":"string","description":"The code of the bank or mobile money provider."},"institutionAddress":{"type":"string","description":"The address of the bank or mobile money provider if required."},"institutionAddressLine1":{"type":"string","description":"Optional. First line of `institutionAddress`, for SWIFT payment methods. Used ahead of `recipientAddressLine1`."},"institutionAddressCity":{"type":"string","description":"Optional. City of `institutionAddress`, for SWIFT payment methods."},"institutionAddressState":{"type":"string","description":"Optional. State of `institutionAddress`, for SWIFT payment methods."},"institutionAddressZip":{"type":"string","description":"Optional. Postal or ZIP code of `institutionAddress`, for SWIFT payment methods."},"institutionAddressCountry":{"type":"string","description":"Optional. Country of `institutionAddress`, for SWIFT payment methods."},"institutionBranch":{"type":"string","description":"The branch of the bank. Required when creating a BANK_ACCOUNT payment method in CNY. Bank lists return it too, often as an empty string."},"correspondentBankName":{"type":"string","description":"The correspondent (intermediary) bank name. Mandatory for USD (SWIFT) payout payment methods; required to produce settlement advices/invoices."},"correspondentBankAccountNumber":{"type":"string","description":"The correspondent (intermediary) bank account number. Mandatory for USD (SWIFT) payout payment methods; required to produce settlement advices/invoices."}}},"PaymentMethodRecipient":{"type":"object","description":"On a payment method, only `recipientEmail`, `recipientPhone`, `recipientAddress` and `recipientName` are returned. The other fields are accepted when you create one but are not returned on it.","properties":{"recipientEmail":{"type":"string","format":"email","description":"The email address of the recipient if needed."},"recipientPhone":{"type":"string","description":"The phone number of the recipient in E.164 format."},"recipientAddress":{"type":"string","description":"The address of the recipient if needed."},"recipientAddressLine1":{"type":"string","description":"Optional. First line of `recipientAddress`. Used on SWIFT payment methods when `institutionAddressLine1` is not sent."},"recipientAddressCity":{"type":"string","description":"Optional. City of `recipientAddress`."},"recipientAddressState":{"type":"string","description":"Optional. State of `recipientAddress`."},"recipientAddressZip":{"type":"string","description":"Optional. Postal or ZIP code of `recipientAddress`."},"recipientAddressCountry":{"type":"string","description":"Optional. Country of `recipientAddress`."},"recipientIdType":{"type":"string","description":"The type of the recipient's ID. Needed, with `recipientIdNumber`, for BANK_ACCOUNT payment methods in CNY, where it is recorded as the recipient's KYC.","enum":["national_id","passport","drivers_license","voters_card","residence_permit","bvn","tax_id"]},"recipientIdNumber":{"type":"string","description":"The number of the ID named by `recipientIdType`. Needed for BANK_ACCOUNT payment methods in CNY."},"recipientUpiId":{"type":"string","description":"The recipient's UPI ID. Used on UPI payment methods; when omitted, `accountNumber` is used."},"recipientName":{"type":"string","description":"The name of the recipient if needed."}}},"PaymentMethodTransaction":{"type":"object","properties":{"transactionInvoice":{"type":"string","description":"The invoice filename (S3 object key) for the transaction, as returned by the media upload endpoint."},"transactionNarration":{"type":"string","description":"The optional reason for the transaction."}}},"customerId":{"type":"string","description":"The unique identifier of the customer."},"amount":{"description":"A monetary amount. Accepts a number or a numeric string; responses return amounts as strings. Must be greater than zero.","oneOf":[{"type":"number","exclusiveMinimum":0},{"type":"string","pattern":"^(?=.*[1-9])\\d+(\\.\\d+)?$"}],"examples":["100.50"]},"ErrorDetails":{"type":"object","properties":{"errorMessage":{"type":"string","description":"Detailed/technical error message."},"friendlyMessage":{"type":"string","description":"User-facing error message safe to display."},"data":{"type":"object","description":"Optional caller-safe context for the error. On a customer-create uniqueness conflict (EMAIL_ALREADY_EXISTS / PHONE_NUMBER_ALREADY_EXISTS) this carries the existing customer's id, so you can adopt it without a follow-up lookup.","properties":{"customerId":{"type":"string","description":"Id of the existing customer (on a create conflict)."}}}}},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code."},"error":{"type":"string","description":"Human-readable error message."},"details":{"$ref":"#/components/schemas/ErrorDetails"}}},"CheckoutSessionCustomer":{"type":"object","additionalProperties":false,"required":["name","email","phone","countryCode"],"properties":{"name":{"type":"string","maxLength":100,"description":"The full name of the customer, at most 100 characters. Angle brackets and control characters are rejected.","examples":["John Doe"]},"email":{"type":"string","format":"email","description":"The email address of the customer.","examples":["john.doe@example.com"]},"phone":{"type":"string","description":"The phone number of the customer in E.164 format. It must be a number from countryCode.","examples":["+2348192837465"]},"countryCode":{"type":"string","description":"The ISO 3166-1 alpha-2 country code of the customer (e.g., 'NG', 'GH'). Case-insensitive; values are normalized to uppercase.","examples":["NG"]}}},"CreateCheckoutSessionResponse":{"type":"object","properties":{"checkoutId":{"type":"string","description":"Unique identifier of the checkout session. It is the last path segment of `checkoutUrl`.","examples":["394102"]},"checkoutUrl":{"type":"string","format":"uri","description":"The URL the customer should be redirected to in order to complete the hosted checkout flow. With a sandbox API key the host is `sandbox.pay.afriex.com`.","examples":["https://pay.afriex.com/pay/394102"]},"channels":{"type":"array","description":"The payment channels you asked for (all of them when you sent none). The customer is shown the ones their currency can collect on, which is decided when they open the checkout page.","items":{"type":"string","enum":["VIRTUAL_BANK_ACCOUNT","MOBILE_MONEY","CARD"]},"examples":[["MOBILE_MONEY"]]}}},"PaymentMethodResolveResponse":{"type":"object","properties":{"recipientName":{"type":"string","description":"The resolved name on the account."},"institutionName":{"type":"string","description":"The name of the resolved bank or mobile money provider."},"institutionCode":{"type":"string","description":"The code of the resolved bank or mobile money provider."}}},"PoolAccountPaymentProofSenderDetails":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"The sender's full name."},"accountNumber":{"type":"string","description":"The sender's account number or wallet identifier."},"bankName":{"type":"string","description":"The sender's bank or financial institution."},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code for the sender."}}},"PoolAccountPaymentProofRequest":{"type":"object","required":["amount","customerId","countryCode","reference","fileKey","timestamp"],"properties":{"amount":{"type":"number","exclusiveMinimum":0,"description":"The deposit amount in the major currency unit."},"customerId":{"type":"string","description":"The Afriex customer ID the deposit should be credited to. Applies when `reference` is a customer reference, in which case it must match that customer. When `reference` is the business's own pool-account reference the deposit is credited to the business and this field is not used for routing."},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code of the pool account."},"reference":{"type":"string","description":"The pool-account reference returned by `GET /api/v1/payment-method/pool-account`. Used to reconcile the deposit."},"fileKey":{"type":"string","description":"The S3 object key of the uploaded proof-of-payment file. Obtain this from `POST /api/v1/media/url` with `type: transaction` first; a URL requested without that type uploads to a different bucket and the key will be rejected as not found."},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of when the payment was sent. It cannot be in the future (a few minutes of clock difference is tolerated). Used for idempotency together with the other request fields."},"senderDetails":{"$ref":"#/components/schemas/PoolAccountPaymentProofSenderDetails"}}},"MediaURLRequest":{"type":"object","required":["fileName"],"properties":{"fileName":{"type":"string","minLength":1,"description":"The name of the file to upload. It is sanitised (directory parts removed, characters outside `A-Z a-z 0-9 . _ -` replaced with `_`, cut to 200 characters), so the stored name can differ from this value; use the returned `key`.","examples":["document.pdf"]},"type":{"type":"string","enum":["transaction","user"],"description":"The category of the file being uploaded. Use `transaction` for transaction-related files (e.g. a transactions CSV) and `user` for user identity documents. Defaults to `user` when omitted.\n"}}},"SmeRegistrationSubmitData":{"type":"object","description":"The `data` payload of the `SUBMIT` step.","required":["onboardingRequestId","companyName","certNumber","kraPin","operatingMode","businessAddress","businessIndustry","directors"],"properties":{"onboardingRequestId":{"type":"string","minLength":1,"description":"The id returned by the `INITIATE` step."},"companyName":{"type":"string","minLength":1},"certNumber":{"type":"string","minLength":1,"description":"Company registration certificate number."},"kraPin":{"type":"string","minLength":1,"description":"The company's KRA PIN."},"operatingMode":{"type":"integer","enum":[1,2,3,4]},"businessAddress":{"type":"string","minLength":1},"businessIndustry":{"type":"integer","minimum":1,"maximum":21,"description":"Industry code. With `21`, `specifyIndustry` is required."},"specifyIndustry":{"type":"string","minLength":1,"description":"Required when `businessIndustry` is `21`."},"directors":{"type":"array","minItems":1,"items":{"type":"object","required":["idType","idNumber","mobile","firstName","lastName","kraPin","idFrontSideFileKey","idFrontSideFileType","idBackSideFileKey","idBackSideFileType","selfieFileKey","selfieFileType","kraPinFileKey","kraPinFileType"],"properties":{"idType":{"type":"string","enum":["101","102","103"]},"idNumber":{"type":"string","minLength":1},"gender":{"type":"integer","enum":[0,1]},"email":{"type":"string","format":"email"},"mobile":{"type":"string","description":"A valid Kenyan mobile number."},"firstName":{"type":"string","minLength":1},"middleName":{"type":"string"},"lastName":{"type":"string","minLength":1},"kraPin":{"type":"string","minLength":1},"idFrontSideFileKey":{"type":"string","minLength":1},"idFrontSideFileType":{"type":"string","enum":["image","pdf"]},"idBackSideFileKey":{"type":"string","minLength":1},"idBackSideFileType":{"type":"string","enum":["image","pdf"]},"selfieFileKey":{"type":"string","minLength":1},"selfieFileType":{"type":"string","enum":["image","pdf"]},"kraPinFileKey":{"type":"string","minLength":1},"kraPinFileType":{"type":"string","enum":["image","pdf"]}}}},"organizationShareholders":{"type":"array","items":{"type":"object","required":["companyName","registrationFileKey","registrationFileType"],"properties":{"companyName":{"type":"string","minLength":1},"registrationFileKey":{"type":"string","minLength":1},"registrationFileType":{"type":"string","enum":["image","pdf"]}}}},"media":{"type":"array","items":{"type":"object","required":["fileKey","mediaType"],"properties":{"fileKey":{"type":"string","minLength":1},"mediaType":{"type":"string","minLength":1},"contentType":{"type":"string","enum":["pdf","image"]}}}}}},"MediaURLResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","description":"The presigned URL for the requested upload operation.","examples":["https://s3.amazonaws.com/bucket/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&..."]},"key":{"type":"string","description":"A stable reference to the uploaded object, in the form `{businessId}/{sanitisedFileName}`. Attach this to a later request (e.g. a SWIFT payout invoice) rather than the presigned URL, which expires shortly after it is issued, and rather than the file name you sent, which may have been sanitised.\n","examples":["64f0c2a1e4b0a1b2c3d4e5f6/invoice.pdf"]},"expiresIn":{"type":"integer","description":"Number of seconds the presigned URL remains valid for the upload. Complete the PUT upload within this window; afterwards, request a fresh URL.\n","examples":[300]}}}}},"WebhookEventName":{"type":"string","description":"The webhook event identifier.","enum":["CUSTOMER.CREATED","CUSTOMER.UPDATED","CUSTOMER.DELETED","PAYMENT_METHOD.CREATED","PAYMENT_METHOD.UPDATED","PAYMENT_METHOD.DELETED","TRANSACTION.CREATED","TRANSACTION.UPDATED","POOL_DEPOSIT_REQUEST.REJECTED"]},"PaymentBatchListItem":{"type":"object","description":"A payment batch as it appears in the list.","properties":{"id":{"type":"string"},"name":{"type":"string"},"meta":{"type":"object","properties":{"flags":{"type":"object","properties":{"isDeactivated":{"type":"boolean"}}},"memberCount":{"type":"integer","description":"How many recipients the batch holds."}}}}},"PaymentBatch":{"type":"object","description":"A payment batch, including the method payouts are funded from.","properties":{"id":{"type":"string"},"name":{"type":"string"},"sourcePaymentMethod":{"type":"object","description":"The wallet the batch is funded from.","properties":{"channel":{"type":"string","enum":["WALLET"]},"currencyCode":{"type":"string","example":"USD"}}}}},"PaymentBatchRecipient":{"type":"object","description":"One payout in a batch. The response includes the channel, country, institution, account name and number, the per-run amount, and the batch and recipient ids. Fields not listed on this schema are not returned.","properties":{"id":{"type":"string","description":"The saved account's id. Only the create and update responses return it (see `PaymentBatchRecipientSaved`); the list returns `paymentMethodId` and `recipientId` instead."},"paymentMethodId":{"type":"string"},"recipientId":{"type":"string","description":"The recipient's id in this batch, used to update or remove it."},"channel":{"type":"string"},"countryCode":{"type":"string"},"accountName":{"type":"string"},"accountNumber":{"type":"string"},"institution":{"type":"object"},"amount":{"type":"object","description":"The amount to pay this recipient on each run of the batch.","properties":{"value":{"type":"string","example":"15000"},"currencyCode":{"type":"string","example":"NGN"}}}}},"PaymentBatchRecipientSaved":{"type":"object","description":"What creating or updating a recipient returns: the saved account only. The full recipient shape, with the amount and `recipientId`, comes from the recipient list.","properties":{"id":{"type":"string","description":"The saved account's id (the `paymentMethodId` in the list)."},"channel":{"type":"string"},"countryCode":{"type":"string"}}},"PaymentBatchSession":{"type":"object","description":"One run of a batch (a withdrawal attempt and its results).","properties":{"id":{"type":"string"},"batchId":{"type":"string"},"createdAt":{"type":"string"},"meta":{"type":"object","properties":{"results":{"type":"object","description":"The outcome of each recipient in the run, keyed by `recipientId`.","additionalProperties":{"type":"object","required":["status"],"properties":{"transactionId":{"type":"string"},"errorMessage":{"type":"string"},"status":{"type":"string","enum":["VALIDATION_SUCCESS","VALIDATION_FAILED","PROCESSING_SUCCESS","PROCESSING_FAILED"]}}}}}}}},"PaymentBatchRequest":{"type":"object","required":["name","sourcePaymentMethod"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"A label for the batch."},"sourcePaymentMethod":{"type":"object","description":"The wallet the batch is funded from. Every payout is converted from this currency. Other keys are ignored and not stored.","required":["currencyCode"],"properties":{"channel":{"type":"string","enum":["WALLET"],"default":"WALLET"},"currencyCode":{"type":"string","example":"USD"}}}}},"PaymentBatchRecipientRequest":{"type":"object","description":"The account to pay, in the same shape POST /api/v1/payment-method accepts, plus the amount to pay it in this batch. `accountName`, `accountNumber` and `institution` are required for most channels: `institution` is not used for `UPI` and `INTERAC`, and `accountName` and `accountNumber` are not used for `VIRTUAL_BANK_ACCOUNT`. `paymentMethodId` updates an existing saved account of this business in place instead of creating one.","required":["channel","countryCode","amount"],"properties":{"paymentMethodId":{"type":"string","description":"Id of a saved account of this business to update with these details. An id that is not one of this business's accounts is refused with `400`."},"channel":{"type":"string","enum":["BANK_ACCOUNT","MOBILE_MONEY","VIRTUAL_BANK_ACCOUNT","ACH_BANK_ACCOUNT","INTERAC","UPI","SWIFT","WE_CHAT"],"example":"BANK_ACCOUNT"},"accountName":{"type":"string","description":"Not used for `VIRTUAL_BANK_ACCOUNT`."},"accountNumber":{"type":"string","description":"Not used for `VIRTUAL_BANK_ACCOUNT`."},"countryCode":{"type":"string","example":"NG"},"institution":{"type":"object","description":"As on POST /api/v1/payment-method. Not used for `UPI` and `INTERAC`."},"amount":{"type":"object","required":["value","currencyCode"],"properties":{"value":{"type":"string","example":"15000"},"currencyCode":{"type":"string","example":"NGN"}}}}},"PaymentBatchOutcomes":{"type":"object","properties":{"successes":{"type":"object","additionalProperties":{"type":"string"}},"errors":{"type":"object","description":"The reason each failed item failed. The value is an error code (for example `INVALID_BUSINESS_PAYMENT_METHOD_REQUEST`), or `This item could not be processed` when the failure has no code.","additionalProperties":{"type":"string"}}}},"PaymentBatchSuccess":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"responses":{"PaymentBatchBadRequest":{"description":"The request is invalid, the `batchId` in the path is not a valid id (`INVALID_BUSINESS_PAYMENT_BATCH_REQUEST`), or it came from an IP outside the business's whitelist, carried a bad payload signature or named an unsupported `x-api-version`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PaymentBatchUnauthorized":{"description":"Missing or invalid API key, or a key without the permission this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PaymentBatchNotFound":{"description":"No batch with this id belongs to the calling business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"ServiceUnavailable":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}}},"security":[{"ApiKey":[]}],"x-permission-table":"The API-key permission each /api/v1 endpoint requires. Where several are\nlisted, any one of them is enough. Keys created before permissions existed\ncarry none and keep access to every endpoint. See\nhttps://docs.afriex.com/api-reference/permissions.\n\n| Endpoint | Permission |\n| --- | --- |\n| `GET /customer`, `GET /customer/{customerId}` | `CUSTOMER.READ` |\n| `POST /customer` | `CUSTOMER.CREATE` |\n| `PATCH /customer/{customerId}`, `PATCH /customer/{customerId}/kyc`, `POST /customer/{customerId}/verify` | `CUSTOMER.UPDATE` |\n| `DELETE /customer/{customerId}` | `CUSTOMER.DELETE` |\n| `GET /payment-method`, `GET /payment-method/{paymentMethodId}`, `GET /payment-method/institution`, `GET /payment-method/institution/codes`, `GET /payment-method/resolve`, `GET /payment-method/virtual-account`, `GET /payment-method/pool-account` | `PAYMENT_METHOD.READ` |\n| `POST /payment-method`, `POST /payment-method/virtual-account`, `GET /payment-method/crypto-wallet`, `POST /payment-method/virtual-account/simulate-transfer` (sandbox only) | `PAYMENT_METHOD.CREATE` |\n| `DELETE /payment-method/{paymentMethodId}` | `PAYMENT_METHOD.DELETE` |\n| `POST /transaction` | `TRANSACTION.DEPOSIT.CREATE` for a deposit, `TRANSACTION.SWAP.CREATE` for a swap, otherwise `TRANSACTION.WITHDRAW.CREATE` |\n| `GET /transaction/quote` | `TRANSACTION.QUOTE.READ` |\n| `POST /transaction/{transactionId}/authorize`, `POST /transaction/pool-account` | `TRANSACTION.DEPOSIT.CREATE` |\n| `POST /transaction/{transactionId}/simulate` (sandbox only) | `TRANSACTION.DEPOSIT.CREATE` or `TRANSACTION.WITHDRAW.CREATE` |\n| `GET /transaction`, `GET /transaction/{transactionId}` | `TRANSACTION.HISTORY.READ` |\n| `GET /transaction/{transactionId}/advice` | `TRANSACTION.RECEIPT.READ` |\n| `GET /org/balance` | `WALLET.BALANCES.READ` |\n| `GET /org/rates` | `RATES.READ` |\n| `POST /media/url` | `MEDIA.UPLOAD` |\n| `POST /sme-registration` | `COMPLIANCE.KYB.SUBMIT` |\n| `GET /sme-registration/status` | `COMPLIANCE.KYB.READ` |\n| `POST /checkout-session` | `CHECKOUT_LINK.CREATE` |\n| `GET /payment-batch`, `GET /payment-batch/{batchId}`, `GET /payment-batch/{batchId}/recipients` | `PAYMENT_BATCH.READ` |\n| `POST /payment-batch` | `PAYMENT_BATCH.CREATE` |\n| `PATCH /payment-batch/{batchId}`, `POST /payment-batch/{batchId}/recipients`, `POST /payment-batch/{batchId}/recipients/bulk`, `PATCH /payment-batch/{batchId}/recipients/{recipientId}`, `DELETE /payment-batch/{batchId}/recipients/{recipientId}` | `PAYMENT_BATCH.UPDATE` |\n| `DELETE /payment-batch/{batchId}` | `PAYMENT_BATCH.DELETE` |\n| `POST /payment-batch/{batchId}/withdraw` | `TRANSACTION.WITHDRAW.CREATE` |\n| `GET /payment-batch/{batchId}/sessions` | `TRANSACTION.HISTORY.READ` |\n| `POST /org/balance/topup`, `POST /webhooks/trigger` | None; any valid key |","paths":{"/api/v1/customer":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"createCustomer","summary":"Create a new customer","description":"Creates a new customer for a business. `phone` is validated against `countryCode` and stored in E.164 format. If you post the email of a customer that was previously deleted, that customer is reactivated (its stored `countryCode` is kept) and the call still returns `201`.","tags":["Customers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fullName","email","phone","countryCode"],"properties":{"fullName":{"type":"string","minLength":1,"description":"The full name of the customer. Must not be empty.","examples":["John Doe"]},"email":{"type":"string","format":"email","description":"The email address of the customer.","examples":["john.doe@example.com"]},"phone":{"type":"string","description":"The phone number of the customer. It must be valid for `countryCode`; it is normalised to E.164 on save.","examples":["+2348192837465"]},"countryCode":{"type":"string","description":"The ISO 3166-1 alpha-2 country code of the customer (e.g., 'NG', 'US'). Must be a supported country, otherwise the request fails with `400 INVALID_BUSINESS_CUSTOMER_REQUEST`.","examples":["NG"]},"meta":{"type":"object","description":"Optional meta data you can attach to the customer."}}},"examples":{"basicCustomer":{"summary":"Minimal, name, email, phone, country","value":{"fullName":"Jane Smith","email":"jane.smith@example.com","phone":"+2348192837465","countryCode":"NG"}},"customerWithMeta":{"summary":"With custom meta data","value":{"fullName":"Jane Smith","email":"jane.smith@example.com","phone":"+2348192837465","countryCode":"NG","meta":{"externalId":"usr_abc123","tier":"premium"}}}}}}},"responses":{"201":{"description":"Customer created successfully. Returns the newly created customer object.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}},"examples":{"success":{"summary":"Customer created","value":{"data":{"name":"Jane Smith","email":"jane.smith@example.com","phone":"+2348192837465","customerId":"69d5ffe1ab82306f11b032f3","reference":"afx121011","countryCode":"NG","createdAt":"2026-04-08T07:12:33.519Z","updatedAt":"2026-04-08T07:12:33.519Z"}}}}}}},"400":{"description":"Invalid request: a required field is missing, or the name, email, phone (checked against `countryCode`) or country code is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingPhone":{"summary":"Missing required field (phone)","value":{"code":"INVALID_BUSINESS_CUSTOMER_REQUEST","error":"Invalid business customer request","details":{"errorMessage":"Invalid business customer request","friendlyMessage":"No customer phone provided"}}},"invalidEmail":{"summary":"Invalid email format","value":{"code":"INVALID_BUSINESS_CUSTOMER_REQUEST","error":"Invalid business customer request","details":{"errorMessage":"Invalid business customer request","friendlyMessage":"Invalid customer email provided: INVALID_EMAIL"}}},"unsupportedCountry":{"summary":"Unsupported country code","value":{"code":"INVALID_BUSINESS_CUSTOMER_REQUEST","error":"Invalid business customer request","details":{"errorMessage":"Invalid business customer request","friendlyMessage":"Customer country code not supported"}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"409":{"description":"A customer with this email or phone already exists for the business. `details.data.customerId` carries the existing customer's id so you can adopt it without a follow-up lookup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"emailExists":{"summary":"Email already in use","value":{"code":"EMAIL_ALREADY_EXISTS","error":"Email already exists","details":{"errorMessage":"Email already exists","friendlyMessage":"","data":{"customerId":"69d5fff7ab82306f11b0330e"}}}},"phoneExists":{"summary":"Phone already in use","value":{"code":"PHONE_NUMBER_ALREADY_EXISTS","error":"Phone number already exists","details":{"errorMessage":"Phone number already exists","friendlyMessage":"","data":{"customerId":"69d5fff7ab82306f11b0330e"}}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const customer = await afriex.customers.create({\n  fullName: \"John Doe\",\n  email: \"john@example.com\",\n  phone: \"+1234567890\",\n  countryCode: \"US\",\n});\n"}]},"get":{"operationId":"listCustomers","summary":"Get customer list","description":"Retrieves a paginated list of customers.","tags":["Customers"],"parameters":[{"name":"page","in":"query","description":"Page number for pagination (starting from 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"email","in":"query","description":"Filter by customer email address (exact match, case-insensitive).","required":false,"schema":{"type":"string","format":"email","examples":["john.doe@example.com"]}},{"name":"phone","in":"query","description":"Filter by customer phone number in E.164 format.","required":false,"schema":{"type":"string","examples":["+2348192837465"]}}],"responses":{"200":{"description":"List of customers retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"page":{"type":"integer","description":"Current page number"},"total":{"type":"integer","description":"Total number of customers matching the query"}}},"examples":{"success":{"summary":"Customer list retrieved","value":{"data":[{"name":"Jane Smith","email":"jane.smith@example.com","phone":"+12025550143","customerId":"6929843e2c4653277440acc0","reference":"afx101","countryCode":"US","createdAt":"2025-11-28T11:15:10.812Z","updatedAt":"2025-11-28T11:15:10.812Z"},{"name":"John Doe","email":"john.doe@example.com","phone":"+2348192837465","customerId":"6930610b0d8aab4a00b3f918","reference":"afx201","countryCode":"NG","createdAt":"2025-12-03T16:10:51.291Z","updatedAt":"2025-12-03T16:10:51.291Z"}],"total":2,"page":0}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"422":{"description":"Request failed schema validation. `details.friendlyMessage` carries the specific field error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Validation error","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"page\" must be a number"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const response = await afriex.customers.list({\n  page: 0,\n  limit: 20,\n  email: \"john@example.com\",\n});\n\nconsole.log(response.data);  // Customer[]\nconsole.log(response.total); // Total count\n"}]}},"/api/v1/customer/{customerId}":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getCustomer","summary":"Get customer by ID","description":"Retrieves a specific customer by their unique identifier. The response includes the customer's `reference`, which is the value to supply as the pool-account `reference` when submitting a payment proof.","tags":["Customers"],"parameters":[{"name":"customerId","in":"path","description":"The unique identifier of the customer","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Customer retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}},"examples":{"success":{"summary":"Customer retrieved","value":{"data":{"name":"Jane Smith","email":"jane.smith@example.com","phone":"+2348192837465","customerId":"69d5ffe1ab82306f11b032f3","reference":"afx121011","countryCode":"NG","createdAt":"2026-04-08T07:12:33.519Z","updatedAt":"2026-04-08T07:12:33.519Z"}}}}}}},"400":{"description":"Invalid customer ID format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidCustomerId":{"summary":"Malformed customer id","value":{"code":"INVALID_BUSINESS_CUSTOMER_ID","error":"Invalid business customer id","details":{"errorMessage":"Invalid business customer id","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Customer not found","value":{"code":"BUSINESS_CUSTOMER_NOT_FOUND","error":"Business customer not found","details":{"errorMessage":"Business customer not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const customer = await afriex.customers.get(\"customer-id\");\n"}]},"patch":{"operationId":"updateCustomer","summary":"Update customer profile","description":"Partially updates a customer's profile. Send at least one of `fullName`, `email`, or `phone`; omitted fields are left unchanged. Unrecognised keys are ignored, and a body with none of the three recognised keys fails with `422`. `phone` is validated against the customer's stored `countryCode` (it cannot be changed here) and stored in E.164 format.","tags":["Customers"],"parameters":[{"name":"customerId","in":"path","description":"The unique identifier of the customer","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Partial profile update. At least one of fullName, email, or phone must be present. Unrecognised keys are ignored.","properties":{"fullName":{"type":"string","minLength":1,"description":"The full name of the customer."},"email":{"type":"string","format":"email","minLength":1,"description":"The email of the customer."},"phone":{"type":"string","minLength":1,"description":"The phone number of the customer. Must be valid for the customer's stored `countryCode`; saved in E.164 format."}},"minProperties":1},"examples":{"name":{"summary":"Update name only","value":{"fullName":"Jane Doe"}},"contact":{"summary":"Update email and phone","value":{"email":"jane.doe@example.com","phone":"+2348192837465"}}}}}},"responses":{"200":{"description":"Customer updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}},"examples":{"success":{"summary":"Profile updated","value":{"data":{"name":"Jane Doe","email":"jane.doe@example.com","phone":"+2348192837465","customerId":"69d5ffe1ab82306f11b032f3","reference":"afx121011","countryCode":"NG","createdAt":"2026-04-08T07:12:33.519Z","updatedAt":"2026-04-08T07:20:11.004Z"}}}}}}},"400":{"description":"Malformed customer ID in the path, or an invalid email or phone value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidCustomerId":{"summary":"Malformed customer ID","value":{"code":"INVALID_BUSINESS_CUSTOMER_ID","error":"Invalid business customer id","details":{"errorMessage":"Invalid business customer id","friendlyMessage":""}}},"invalidEmail":{"summary":"Invalid email","value":{"code":"INVALID_BUSINESS_CUSTOMER_REQUEST","error":"Invalid business customer request","details":{"errorMessage":"Invalid business customer request","friendlyMessage":""}}},"invalidPhone":{"summary":"Phone not valid for the customer country","value":{"code":"INVALID_BUSINESS_CUSTOMER_REQUEST","error":"Invalid business customer request","details":{"errorMessage":"Invalid business customer request","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Customer not found","value":{"code":"BUSINESS_CUSTOMER_NOT_FOUND","error":"Business customer not found","details":{"errorMessage":"Business customer not found","friendlyMessage":""}}}}}}},"409":{"description":"The new email or phone already belongs to another customer of this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"emailExists":{"summary":"Email already in use","value":{"code":"EMAIL_ALREADY_EXISTS","error":"Email already exists","details":{"errorMessage":"Email already exists","friendlyMessage":""}}},"phoneExists":{"summary":"Phone already in use","value":{"code":"PHONE_NUMBER_ALREADY_EXISTS","error":"Phone number already exists","details":{"errorMessage":"Phone number already exists","friendlyMessage":""}}}}}}},"422":{"description":"Request failed schema validation. `details.friendlyMessage` carries the specific field error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Validation error","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"value\" must contain at least one of [fullName, email, phone]"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const customer = await afriex.customers.update(\"customer-id\", {\n  fullName: \"Jane Doe\",\n});\n"}]},"delete":{"operationId":"deleteCustomer","summary":"Delete customer by ID","description":"Deletes a specific customer by their unique identifier.","tags":["Customers"],"parameters":[{"name":"customerId","in":"path","description":"The unique identifier of the customer","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Customer deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":["object","null"],"description":"Omitted on success. The response body is an empty object."}}},"examples":{"deleted":{"summary":"Customer deleted","value":{}}}}}},"400":{"description":"Invalid customer ID format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidCustomerId":{"summary":"Malformed customer id","value":{"code":"INVALID_BUSINESS_CUSTOMER_ID","error":"Invalid business customer id","details":{"errorMessage":"Invalid business customer id","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Customer not found","value":{"code":"BUSINESS_CUSTOMER_NOT_FOUND","error":"Business customer not found","details":{"errorMessage":"Business customer not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"await afriex.customers.delete(\"customer-id\");\n"}]}},"/api/v1/customer/{customerId}/kyc":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"patch":{"operationId":"updateCustomerKyc","summary":"Update customer KYC information","description":"Partially updates a customer's KYC information.","tags":["Customers"],"parameters":[{"name":"customerId","in":"path","description":"The unique identifier of the customer","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"A flat map of KYC document types to their values. Send the document map directly as the request body (do not wrap it in a `kyc` field). Each key must be one of the allowed KYC document types and each value is a string.\n\n`PHONE` and `COUNTRY` are not accepted here; they are profile fields owned by `PATCH /api/v1/customer/{customerId}`. `BVN` is not accepted either; it is owned by `POST /api/v1/customer/{customerId}/verify`, which writes it only after a successful bank verification. Sending any of the three returns `400 INVALID_KYC_DOCUMENT_TYPE`, as does an empty body.\n\nValue rules: `DATE_OF_BIRTH` must be a valid `YYYY-MM-DD` date for a customer aged 13 to 75; every other value must be at least 2 characters. A value that breaks a rule returns `400 INVALID_KYC_DOCUMENT_TYPE`.","additionalProperties":{"type":"string"},"propertyNames":{"enum":["REPRESENTATIVE_TYPE","DATE_OF_BIRTH","ADDRESS","BANK_STATEMENT","BUSINESS_CERTIFICATE","ID_FRONT","ID_BACK","SELFIE","PROOF_OF_ADDRESS","PROOF_OF_INCOME","DRIVER_LICENSE","PASSPORT","NATIONAL_ID","PAYMENT_METHOD","RESIDENCE_PERMIT","VEHICLE_REGISTRATION","VOTER_ID","OTHERS"]},"examples":[{"PASSPORT":"passport.png","DATE_OF_BIRTH":"2000-01-01"}]},"examples":{"passport":{"summary":"Passport number and date of birth (Ghana)","value":{"PASSPORT":"A12345678","DATE_OF_BIRTH":"1990-05-15"}},"nationalId":{"summary":"National ID (Ghana)","value":{"NATIONAL_ID":"GHA-123456789-0","DATE_OF_BIRTH":"1990-05-15"}},"driverLicense":{"summary":"Driver's license (Kenya)","value":{"DRIVER_LICENSE":"DL-987654","DATE_OF_BIRTH":"1990-05-15"}},"documentUpload":{"summary":"Uploaded identity documents","value":{"ID_FRONT":"id-front.png","ID_BACK":"id-back.png","SELFIE":"selfie.png"}}}}}},"responses":{"200":{"description":"Customer updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}},"examples":{"success":{"summary":"KYC updated","value":{"data":{"name":"Test User KYC","email":"test.kyc.user@example.com","phone":"+2348192837001","customerId":"69d5fff7ab82306f11b0330e","reference":"afx121011","countryCode":"NG","meta":{"kyc":{"data":{"PASSPORT":"A12345678","DATE_OF_BIRTH":"1990-05-15"}}},"createdAt":"2026-04-08T07:12:55.888Z","updatedAt":"2026-04-08T07:17:18.638Z"}}}}}}},"400":{"description":"Malformed customer ID in the path, or an invalid KYC document map.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidCustomerId":{"summary":"Malformed customer ID","value":{"code":"INVALID_BUSINESS_CUSTOMER_ID","error":"Invalid business customer id","details":{"errorMessage":"Invalid business customer id","friendlyMessage":""}}},"emptyBody":{"summary":"No KYC documents sent","value":{"code":"INVALID_KYC_DOCUMENT_TYPE","error":"Invalid kyc document type","details":{"errorMessage":"Invalid kyc document type","friendlyMessage":""}}},"invalidDateOfBirth":{"summary":"Date of birth outside the accepted age range","value":{"code":"INVALID_KYC_DOCUMENT_TYPE","error":"Invalid kyc document type","details":{"errorMessage":"Invalid kyc document type","friendlyMessage":"You need to be more than 13 years to use our service"}}},"invalidKycType":{"summary":"Invalid KYC document type key","value":{"code":"INVALID_KYC_DOCUMENT_TYPE","error":"Invalid kyc document type","details":{"errorMessage":"Invalid kyc document type","friendlyMessage":""}}},"bvnNotAccepted":{"summary":"BVN is owned by the verify endpoint","value":{"code":"INVALID_KYC_DOCUMENT_TYPE","error":"Invalid kyc document type","details":{"errorMessage":"Invalid kyc document type","friendlyMessage":"Invalid KYC document type provided"}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Customer not found","value":{"code":"BUSINESS_CUSTOMER_NOT_FOUND","error":"Business customer not found","details":{"errorMessage":"Business customer not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const customer = await afriex.customers.updateKyc(\"customer-id\", {\n  PASSPORT: \"A12345678\",\n  DATE_OF_BIRTH: \"1990-05-15\",\n});\n"}]}},"/api/v1/customer/{customerId}/verify":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"verifyCustomer","summary":"Verify a customer document","description":"Runs an identity verification against a customer document. Today the only supported `docType` is `BVN` (Nigeria); `docValue` is the document number. Verification is rate limited per business. The `200` response carries the customer's stored KYC documents in `meta.kyc.data`.","tags":["Customers"],"parameters":[{"name":"customerId","in":"path","description":"The unique identifier of the customer","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"docType":{"type":"string","description":"The type of document to verify.","enum":["BVN"]},"docValue":{"type":"string","minLength":1,"description":"The document number to verify. A `BVN` must be exactly 11 digits and its registered name must match the customer's name. A malformed `BVN` is rejected with `400`, not `422`.","pattern":"^\\d{11}$"}},"required":["docType","docValue"]},"examples":{"bvn":{"summary":"Verify a Nigerian BVN","value":{"docType":"BVN","docValue":"22222222222"}}}}}},"responses":{"200":{"description":"Customer verified successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}}},"examples":{"success":{"summary":"Customer verified","value":{"data":{"name":"Jane Smith","email":"jane.smith@example.com","phone":"+2348192837465","customerId":"69d5ffe1ab82306f11b032f3","reference":"afx121011","countryCode":"NG","meta":{"kyc":{"data":{"BVN":"22222222222"}}},"createdAt":"2026-04-08T07:12:33.519Z","updatedAt":"2026-04-08T07:21:09.872Z"}}}}}}},"400":{"description":"Malformed customer ID in the path, or the document was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidCustomerId":{"summary":"Malformed customer ID","value":{"code":"INVALID_BUSINESS_CUSTOMER_ID","error":"Invalid business customer id","details":{"errorMessage":"Invalid business customer id","friendlyMessage":""}}},"invalidBvnFormat":{"summary":"BVN is not exactly 11 digits","value":{"code":"INVALID_KYC_DOCUMENT_TYPE","error":"Invalid kyc document type","details":{"errorMessage":"Invalid kyc document type","friendlyMessage":""}}},"bvnNameMismatch":{"summary":"BVN name does not match the customer","value":{"code":"INVALID_KYC_DOCUMENT_TYPE","error":"Invalid kyc document type","details":{"errorMessage":"Invalid kyc document type","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Customer not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Customer not found","value":{"code":"BUSINESS_CUSTOMER_NOT_FOUND","error":"Business customer not found","details":{"errorMessage":"Business customer not found","friendlyMessage":""}}}}}}},"422":{"description":"Request failed schema validation. `details.friendlyMessage` carries the specific field error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Validation error","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"docValue\" is required"}}}}}}},"429":{"description":"Too many verification requests.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"rateLimited":{"summary":"Rate limit exceeded","value":{"code":"RATE_LIMIT_ERROR","error":"You can't make this request at the moment. Please try again later","details":{}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: the upstream BVN enquiry failed, or another upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream BVN enquiry failed","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const customer = await afriex.customers.verify(\"customer-id\", {\n  docType: \"BVN\",\n  docValue: \"22222222222\",\n});\n"}]}},"/api/v1/transaction":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"createTransaction","summary":"Create a new transaction","description":"Create a new transaction to process a payment for a customer. Use `type: WITHDRAW` to send funds to a destination payment method (requires `destinationId`), `type: DEPOSIT` to pull funds from a source payment method (requires `sourceId`), or `type: SWAP` to convert funds between currencies within the Afriex wallet (requires `sourceCurrency`, `destinationCurrency`, `meta`, and exactly one of `sourceAmount` or `destinationAmount`). A DEPOSIT settles in one currency, so `sourceCurrency` and `destinationCurrency` must be the same. Card deposits cannot be created through the API. Your business must have a webhook URL set, otherwise the request is rejected with a 400.\n","tags":["Transactions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","description":"The unique identifier of the customer. Required for DEPOSIT and WITHDRAW transactions. Not required for SWAP, if omitted, the transaction runs against the business wallet.","examples":["69528240ba52c13b669fb239"]},"type":{"type":"string","description":"The type of transaction. DEPOSIT pulls funds from the customer's source payment method (requires sourceId). WITHDRAW sends funds to the customer's destination payment method (requires destinationId). SWAP converts funds between currencies within the Afriex wallet (requires sourceCurrency, destinationCurrency, meta, and exactly one of sourceAmount or destinationAmount; the API computes the other side at the live exchange rate, and sending both is rejected). If omitted, defaults to WITHDRAW.","enum":["DEPOSIT","WITHDRAW","SWAP"]},"sourceAmount":{"description":"The transaction amount in the source currency. For WITHDRAW and DEPOSIT, provide sourceAmount, destinationAmount or both: sending sourceAmount alone lets the API compute destinationAmount at the live forward rate (useful when you know only how much you want to send, e.g. a SWIFT payout of a fixed source balance). When both are sent, destinationAmount wins unless shouldPreferSourceAmount is true. For SWAP, provide exactly one of sourceAmount or destinationAmount: setting sourceAmount makes the API compute destinationAmount at the live exchange rate.","$ref":"#/components/schemas/amount"},"destinationAmount":{"description":"The transaction amount in the destination currency. For WITHDRAW and DEPOSIT, provide sourceAmount, destinationAmount or both: setting destinationAmount fixes the amount, while omitting it and sending sourceAmount lets the API compute destinationAmount at the live forward rate. A request with neither is rejected. For SWAP, provide exactly one of sourceAmount or destinationAmount: setting destinationAmount instead makes the API compute sourceAmount at the inverse rate. Sending both amounts on a SWAP is rejected.","$ref":"#/components/schemas/amount"},"destinationCurrency":{"type":"string","pattern":"^[A-Z]{3}$","description":"The 3-letter ISO 4217 currency code of the destination currency (e.g., USD, NGN). Upper case, and a currency Afriex supports.","examples":["USD"]},"sourceCurrency":{"type":"string","pattern":"^[A-Z]{3}$","description":"The 3-letter ISO 4217 currency code of the source currency (e.g., USD, NGN). Upper case, and a currency Afriex supports.","examples":["NGN"]},"destinationId":{"type":"string","description":"Required for WITHDRAW transactions. The id of the destination payment method that money will be sent to.\n","examples":["690df3281c11eea59108fcaf"]},"sourceId":{"type":"string","description":"Required for DEPOSIT transactions. The id of the source payment method that money will be pulled from.\n","examples":["690df3281c11eea59108fcaf"]},"meta":{"description":"Transaction metadata. idempotencyKey and reference are required.","$ref":"#/components/schemas/TransactionMeta"},"shouldPreferSourceAmount":{"type":"boolean","description":"Opt in to deriving destinationAmount from sourceAmount even when both amounts are sent. Defaults to false, which keeps destination-wins semantics so a caller that echoes both amounts still gets the destinationAmount they asked for. Set true to have sourceAmount drive the payout via the forward rate."},"correspondentBankName":{"type":"string","description":"The correspondent (intermediary) bank name for USD payouts (WITHDRAW with destinationCurrency USD and meta.settlement 'request'). Only used as a fallback when the destination payment method lacks it. The payment method's value takes precedence. Must be provided together with correspondentBankAccountNumber."},"correspondentBankAccountNumber":{"type":"string","description":"The correspondent (intermediary) bank account number for USD payouts (WITHDRAW with destinationCurrency USD and meta.settlement 'request'). Only used as a fallback when the destination payment method lacks it. The payment method's value takes precedence. Must be provided together with correspondentBankName."}},"oneOf":[{"title":"Withdraw","description":"Send funds to a customer's destination payment method. This is the default when type is omitted. Provide sourceAmount, destinationAmount or both; sending sourceAmount alone lets the API compute the destination side at the live forward rate.","required":["customerId","sourceCurrency","destinationCurrency","destinationId","meta"],"properties":{"type":{"enum":["WITHDRAW"]}}},{"title":"Deposit","description":"Pull funds from a customer's source payment method. Provide sourceAmount, destinationAmount or both. sourceCurrency and destinationCurrency must be the same currency; a mismatch is rejected.","required":["type","customerId","sourceCurrency","destinationCurrency","sourceId","meta"],"properties":{"type":{"enum":["DEPOSIT"]}}},{"title":"Swap","description":"Convert funds between currencies within the Afriex wallet. Provide exactly one of sourceAmount or destinationAmount; sending both is rejected.","required":["type","sourceCurrency","destinationCurrency","meta"],"properties":{"type":{"enum":["SWAP"]}}}]},"examples":{"Withdraw":{"summary":"Withdraw (destination amount): fix the payout amount the customer receives","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","destinationAmount":5000,"sourceCurrency":"USD","destinationCurrency":"NGN","destinationId":"690df3281c11eea59108fcaf","meta":{"reference":"ref-withdraw-001","idempotencyKey":"idem-withdraw-001"}}},"WithdrawSourceAmount":{"summary":"Withdraw (source amount, SWIFT MZN→USD): send the full source balance and let the API compute the payout at the live forward rate","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","sourceAmount":10000,"sourceCurrency":"MZN","destinationCurrency":"USD","destinationId":"690df3281c11eea59108fcaf","meta":{"reference":"ref-withdraw-002","idempotencyKey":"idem-withdraw-002"}}},"Deposit":{"summary":"Deposit, pull funds from a customer's source payment method","value":{"customerId":"69528240ba52c13b669fb239","type":"DEPOSIT","sourceAmount":"10","destinationAmount":10,"sourceCurrency":"USD","destinationCurrency":"USD","sourceId":"690df3281c11eea59108fcaf","meta":{"reference":"ref-deposit-001","idempotencyKey":"idem-deposit-001"}}},"Swap":{"summary":"Swap (source-only): convert funds between currencies within the Afriex wallet","value":{"type":"SWAP","sourceAmount":10,"sourceCurrency":"USD","destinationCurrency":"NGN","meta":{"reference":"ref-swap-001","idempotencyKey":"idem-swap-001"}}},"SwapDestination":{"summary":"Swap (destination-only): the API computes the source amount at the inverse rate","value":{"type":"SWAP","destinationAmount":16500,"sourceCurrency":"USD","destinationCurrency":"NGN","meta":{"reference":"ref-swap-002","idempotencyKey":"idem-swap-002"}}}}}}},"responses":{"201":{"description":"Transaction created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}},"examples":{"withdraw":{"summary":"WITHDRAW transaction created (pending)","value":{"data":{"status":"PENDING","type":"WITHDRAW","channel":"BANK_ACCOUNT","sourceAmount":"3.28847","sourceCurrency":"USD","destinationAmount":"5000","destinationCurrency":"NGN","destinationId":"690df3281c11eea59108fcaf","customerId":"69528240ba52c13b669fb239","transactionId":"69d60071ab82306f11b03393","merchantReference":"ref-withdraw-001","meta":{"reference":"ref-withdraw-001","idempotencyKey":"idem-withdraw-001","narration":""},"createdAt":"2026-04-08T07:14:57.444Z","updatedAt":"2026-04-08T07:14:57.444Z"}}},"swap":{"summary":"SWAP transaction created (success)","value":{"data":{"status":"SUCCESS","type":"SWAP","channel":"WALLET","sourceAmount":"10","sourceCurrency":"USD","destinationAmount":"14101.041","destinationCurrency":"NGN","customerId":"","transactionId":"69d60072ab82306f11b033b9","merchantReference":"ref-swap-001","meta":{"reference":"ref-swap-001","idempotencyKey":"idem-swap-001","narration":""},"createdAt":"2026-04-08T07:14:58.237Z","updatedAt":"2026-04-08T07:14:58.237Z"}}}}}}},"400":{"description":"Invalid request, or your business is not yet allowed to use the API: no webhook URL is set, the request IP is not on your whitelist, the business is not approved or is deactivated, business verification (KYB) is required, or the transaction is below the minimum that one of your business limits allows. `details.friendlyMessage` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"swapBothAmounts":{"summary":"SWAP with both amounts provided","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Only one of source amount or destination amount can be provided"}}},"missingDestinationAmount":{"summary":"Neither source amount nor destination amount provided","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Either source amount or destination amount is required"}}},"depositCurrencyMismatch":{"summary":"Deposit with different source and destination currencies","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Source and destination currencies must match for deposits"}}},"preferSourceWithoutSourceAmount":{"summary":"shouldPreferSourceAmount without a source amount","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Source amount is required when shouldPreferSourceAmount is true"}}},"cardDeposit":{"summary":"Card deposit through the API","value":{"code":"BAD_REQUEST_ERROR","error":"Card deposits cannot be created through the API","details":{}}},"noWebhookUrl":{"summary":"No webhook URL set on the business","value":{"code":"INVALID_BUSINESS_API_REQUEST","error":"Invalid business api request","details":{"errorMessage":"Invalid business api request","friendlyMessage":"No webhook url set in account"}}},"invalidCurrency":{"summary":"Invalid currency code","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Invalid source currency"}}},"missingIdempotencyKey":{"summary":"Missing idempotency key","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"No idempotency key provided"}}},"belowBusinessMinimum":{"summary":"Below the minimum for a business limit","value":{"code":"BUSINESS_TRANSACTION_MIN_AMOUNT_NOT_MET","error":"Business transaction min amount not met","details":{"errorMessage":"Business transaction min amount not met","friendlyMessage":"The minimum for this transaction is 10 USD."}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"402":{"description":"Your wallet balance is too low to cover the transaction. Fund the wallet and send the request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"balanceInsufficient":{"summary":"Wallet balance too low","value":{"code":"BALANCE_INSUFFICIENT","error":"Balance insufficient","details":{"errorMessage":"Balance insufficient","friendlyMessage":""}}}}}}},"403":{"description":"The transaction is refused: it would take your business over one of its limits, the customer or business is not verified, the payment method is not active, or withdrawals are suspended for your business. For a limit, `details.friendlyMessage` gives the limit and its period, and for a daily, weekly or monthly amount limit how much is left.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"businessLimitExceeded":{"summary":"Business limit exceeded","value":{"code":"BUSINESS_LIMIT_EXCEEDED","error":"Business limit exceeded","details":{"errorMessage":"Business limit exceeded","friendlyMessage":"This transaction would go over your daily limit of 5,000 USD. You have 1,200 USD left."}}},"customerNotVerified":{"summary":"Customer not verified","value":{"code":"USER_NOT_VERIFIED","error":"User not verified","details":{"errorMessage":"User not verified","friendlyMessage":""}}},"paymentMethodNotActive":{"summary":"Payment method not active","value":{"code":"PAYMENT_METHOD_NOT_ACTIVE","error":"Payment method not active","details":{"errorMessage":"Payment method not active","friendlyMessage":""}}}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"customerNotFound":{"summary":"Customer not found","value":{"code":"USER_NOT_FOUND","error":"User not found","details":{"errorMessage":"User not found","friendlyMessage":""}}},"paymentMethodNotFound":{"summary":"Payment method not found","value":{"code":"PAYMENT_METHOD_NOT_FOUND","error":"Payment method not found","details":{"errorMessage":"Payment method not found","friendlyMessage":""}}},"ratesNotFound":{"summary":"No rate for the currency pair","value":{"code":"TRANSACTION_RATES_NOT_FOUND","error":"Transaction rates not found","details":{"errorMessage":"Transaction rates not found","friendlyMessage":""}}}}}}},"409":{"description":"A transaction with the same `meta.idempotencyKey` or `meta.reference` already exists, or is still being processed. Nothing is charged twice; look up the original with GET /api/v1/transaction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"duplicate":{"summary":"Idempotency key or reference already used","value":{"code":"DUPLICATE_REQUEST","error":"Duplicate request","details":{"errorMessage":"Duplicate request","friendlyMessage":"A transaction with the same idempotency key or merchant reference already exists"}}},"inFlight":{"summary":"Idempotency key or reference still being processed","value":{"code":"DUPLICATE_REQUEST","error":"Duplicate request","details":{"errorMessage":"Duplicate request","friendlyMessage":"A transaction with the same idempotency key or merchant reference is already being processed"}}}}}}},"422":{"description":"The transaction cannot be created: the payment method's currency does not match `destinationCurrency`, or the destination country is not currently available. `details.friendlyMessage` carries the specific error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"currencyMismatch":{"summary":"Payment method currency does not match","value":{"code":"PAYMENT_METHOD_CURRENCY_MISMATCH","error":"Payment method currency mismatch","details":{"errorMessage":"Payment method currency mismatch","friendlyMessage":""}}},"countryNotSupported":{"summary":"Destination country not available","value":{"code":"COUNTRY_NOT_SUPPORTED","error":"Country not supported","details":{"errorMessage":"Country not supported","friendlyMessage":"Transactions for NG are not available at the moment"}}}}}}},"429":{"description":"More than 60 transaction create requests from your business in the last 60 seconds. Rejected requests count toward the limit, so wait and retry with backoff, reusing the same `meta.idempotencyKey` so a retry cannot create a duplicate.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"rateLimited":{"summary":"Rate limit exceeded","value":{"code":"RATE_LIMIT_ERROR","error":"You can't make this request at the moment. Please try again later","details":{}}}}}}},"451":{"description":"The destination country or channel is blocked and cannot be used.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"destinationBlocked":{"summary":"Destination blocked","value":{"code":"CORRIDOR_BLOCKED","error":"Corridor blocked","details":{"errorMessage":"Corridor blocked","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const transaction = await afriex.transactions.create({\n  customerId: \"customer-id\",\n  sourceAmount: \"10\",\n  destinationAmount: \"5000\",\n  sourceCurrency: \"USD\",\n  destinationCurrency: \"NGN\",\n  destinationId: \"payment-method-id\",\n  meta: {\n    idempotencyKey: \"unique-key-123\",\n    reference: \"order-456\",\n    narration: \"Payment for services\",\n  },\n});\n"}]},"get":{"operationId":"listTransactions","summary":"Get transaction list","description":"Retrieves a paginated list of transactions.","tags":["Transactions"],"parameters":[{"name":"page","in":"query","description":"Zero-based page number for pagination.","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Number of items per page (max 100).","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"transactionId","in":"query","description":"Filter by the Afriex transaction ID (`transactionId`) returned when the transaction was created, or by the reference you supplied in `meta.reference`.","required":false,"schema":{"type":"string"}},{"name":"reference","in":"query","description":"Filter by the merchant-supplied reference set in `meta.reference` at transaction creation.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by one or more transaction statuses. Use a comma-separated list for multiple values (e.g. `?status=PENDING,PROCESSING`).","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionStatus"}},"style":"form","explode":false},{"name":"type","in":"query","description":"Filter by one or more transaction types. Use a comma-separated list for multiple values (e.g. `?type=DEPOSIT,WITHDRAW`). Besides the types you can create, `REVERSAL`, `SCHEDULED` and `SEND` can appear on transactions your business did not create through this API.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["DEPOSIT","WITHDRAW","SWAP","REVERSAL","SCHEDULED","SEND"]}},"style":"form","explode":false},{"name":"channel","in":"query","description":"Filter by one or more payment channels (source or destination). Use a comma-separated list for multiple values (e.g. `?channel=BANK_ACCOUNT,MOBILE_MONEY`).","required":false,"schema":{"type":"array","items":{"type":"string","enum":["BANK_ACCOUNT","MOBILE_MONEY","CARD","CRYPTO","VIRTUAL_BANK_ACCOUNT","POOL_ACCOUNT","ACH_BANK_ACCOUNT","INTERAC","PAYBILL_TILL","RFP","UPI","VIRTUAL_CARD","SWIFT","WE_CHAT","ALIPAY","WALLET","PAYMENT_LINQ","ADMIN"]}},"style":"form","explode":false},{"name":"currency","in":"query","description":"Filter by one or more 3-letter ISO 4217 currency codes (source or destination). Use a comma-separated list for multiple values (e.g. `?currency=USD,NGN`).","required":false,"schema":{"type":"array","items":{"type":"string","examples":["USD"]}},"style":"form","explode":false},{"name":"fromDate","in":"query","description":"Return only transactions created on or after this ISO 8601 date-time (e.g. `2025-01-01T00:00:00.000Z`).","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"toDate","in":"query","description":"Return only transactions created on or before this ISO 8601 date-time. Must be equal to or later than `fromDate`.","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List of transactions retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"page":{"type":"integer","description":"Current page number"},"total":{"type":"integer","description":"Total number of transactions matching the query"}}},"examples":{"success":{"summary":"Transaction list retrieved","value":{"data":[{"status":"SUCCESS","type":"SWAP","channel":"WALLET","sourceAmount":"10","sourceCurrency":"USD","destinationAmount":"14101.041","destinationCurrency":"NGN","customerId":"68e6717848e1f632e9686460","transactionId":"69d3c79531c0234586ad5ee0","merchantReference":"ref-swap-minimal-002","meta":{"reference":"ref-swap-minimal-002","idempotencyKey":"idem-swap-minimal-002","narration":""},"createdAt":"2026-04-06T14:47:49.166Z","updatedAt":"2026-04-06T14:47:49.166Z"},{"status":"PENDING","type":"WITHDRAW","channel":"BANK_ACCOUNT","sourceAmount":"3.28847","sourceCurrency":"USD","destinationAmount":"5000","destinationCurrency":"NGN","destinationId":"690df3281c11eea59108fcaf","customerId":"69528240ba52c13b669fb239","transactionId":"69d60071ab82306f11b03393","merchantReference":"ref-withdraw-001","meta":{"reference":"ref-withdraw-001","idempotencyKey":"idem-withdraw-001","narration":""},"createdAt":"2026-04-08T07:14:57.444Z","updatedAt":"2026-04-08T07:14:57.444Z"}],"total":285,"page":0}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"422":{"description":"Request failed schema validation. `details.friendlyMessage` carries the specific field error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Validation error","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"page\" must be a number"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const response = await afriex.transactions.list({\n  page: 0,\n  limit: 20,\n  status: [\"PENDING\", \"PROCESSING\"],\n  currency: [\"USD\", \"NGN\"],\n  fromDate: \"2026-01-01T00:00:00.000Z\",\n  toDate: \"2026-01-31T23:59:59.999Z\",\n});\n\nconsole.log(response.data); // Transaction[]\n"}]}},"/api/v1/transaction/quote":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getTransactionQuote","summary":"Quote a withdrawal","description":"Returns what a withdrawal would cost, priced by the same code that charges it, without creating anything. Type exactly one of `sourceAmount` (what you send) or `destinationAmount` (what the recipient receives); the other is derived from it. The side you type is returned as `anchor`.\n\n`rate`, `fee` and the amounts mean exactly what they mean on the transaction a create returns, so a create with the same inputs charges the quoted amounts. A quote does not check limits or customer verification and does not need an idempotency key or reference; those apply when you create the transaction, so a quote can succeed where the create is refused. Quotes are not reserved: rates and promotions can change before you create.\n\nName the destination either with `destinationId` (a saved payment method) or with `destinationChannel` and `destinationCountry` (when the customer has no account to send to yet), not both. `destinationCountry` can be left out for `SWIFT` and `CRYPTO`. A quote priced from a channel alone comes back with `indicative: true`: the account is not known, so the payout route, and any fee that depends on it, may differ when you create. `customerId` is optional; without it the quote is priced for the business owner, so a fee or promotion that depends on the customer's country can differ when you create.\n","tags":["Transactions"],"parameters":[{"name":"customerId","in":"query","required":false,"description":"The customer the withdrawal is for. Omit it to price the quote for the business owner.","schema":{"type":"string"}},{"name":"destinationId","in":"query","required":false,"description":"The destination payment method the funds would be sent to. Send this or `destinationChannel`, not both.","schema":{"type":"string"}},{"name":"destinationChannel","in":"query","required":false,"description":"The channel the funds would be sent over, when there is no saved payment method yet. Send this or `destinationId`, not both. Case-insensitive.","schema":{"type":"string","enum":["BANK_ACCOUNT","MOBILE_MONEY","CARD","CRYPTO","VIRTUAL_BANK_ACCOUNT","POOL_ACCOUNT","ACH_BANK_ACCOUNT","INTERAC","PAYBILL_TILL","RFP","UPI","VIRTUAL_CARD","SWIFT","WE_CHAT","ALIPAY","PAYMENT_LINQ","ADMIN","WALLET"],"examples":["BANK_ACCOUNT"]}},{"name":"destinationCountry","in":"query","required":false,"description":"The destination country (ISO 3166-1 alpha-2, case-insensitive), required with `destinationChannel` except for `SWIFT` and `CRYPTO`. It can only be sent together with `destinationChannel`.","schema":{"type":"string","examples":["NG"]}},{"name":"sourceCurrency","in":"query","required":true,"description":"The currency debited from your wallet.","schema":{"type":"string","examples":["NGN"]}},{"name":"destinationCurrency","in":"query","required":true,"description":"The currency the recipient receives.","schema":{"type":"string","examples":["USD"]}},{"name":"sourceAmount","in":"query","required":false,"description":"The amount you send. Send this or `destinationAmount`, not both.","schema":{"type":"string","examples":["100000"]}},{"name":"destinationAmount","in":"query","required":false,"description":"The amount the recipient receives. Send this or `sourceAmount`, not both.","schema":{"type":"string","examples":["65.77"]}}],"responses":{"200":{"description":"The quote.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","required":["anchor","sourceCurrency","destinationCurrency"],"properties":{"anchor":{"type":"string","enum":["source","destination"],"description":"The side that is exact; the other side is derived from it."},"sourceAmount":{"type":"string","description":"What is debited, before any fee."},"sourceCurrency":{"type":"string"},"destinationAmount":{"type":"string","description":"What the recipient receives."},"destinationCurrency":{"type":"string"},"indicative":{"type":"boolean","description":"Present and `true` when the quote was priced from `destinationChannel` alone, so the payout route and any fee that depends on it may differ at create."},"rate":{"type":"string","description":"`1 sourceCurrency = rate destinationCurrency`, the published rate after any promotion."},"fee":{"type":"string","description":"The fee, in `sourceCurrency`. Omitted when no fee applies."}}}}},"examples":{"typedSource":{"summary":"Typed the source amount","value":{"data":{"anchor":"source","sourceAmount":"100000","sourceCurrency":"NGN","destinationAmount":"65.76696108","destinationCurrency":"USD","rate":"0.0006576696108"}}},"typedDestination":{"summary":"Typed the destination amount, with a fee","value":{"data":{"anchor":"destination","sourceAmount":"100000","sourceCurrency":"NGN","destinationAmount":"65.76696108","destinationCurrency":"USD","rate":"0.0006576696108","fee":"50"}}}}}}},"400":{"description":"The quote cannot be priced: `destinationChannel` was sent without `destinationCountry` (not needed for `SWIFT` and `CRYPTO`), an amount is not a positive number, or your business is not yet allowed to use the API (for example the request IP is not on your whitelist, or the business is not approved, is deactivated, or needs verification).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingDestinationCountry":{"summary":"destinationChannel without destinationCountry","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"destinationCountry is required with destinationChannel, except for SWIFT and CRYPTO"}}},"invalidAmount":{"summary":"Amount is not a positive number","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Invalid source amount"}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}}}}}},"404":{"description":"The customer or the destination payment method was not found for your business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"customerNotFound":{"summary":"Customer not found","value":{"code":"USER_NOT_FOUND","error":"User not found","details":{"errorMessage":"User not found","friendlyMessage":""}}},"paymentMethodNotFound":{"summary":"Destination payment method not found","value":{"code":"PAYMENT_METHOD_NOT_FOUND","error":"Payment method not found","details":{"errorMessage":"Payment method not found","friendlyMessage":""}}}}}}},"422":{"description":"The request failed schema validation: both amounts, or neither, were sent, both `destinationId` and `destinationChannel` (or neither) were sent, `destinationCountry` was sent without `destinationChannel`, a currency, channel or country is not recognized, a required parameter is missing, or the destination country or channel is not currently available. `details.friendlyMessage` carries the specific error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"countryNotSupported":{"summary":"Destination country not available","value":{"code":"COUNTRY_NOT_SUPPORTED","error":"Country not supported","details":{"errorMessage":"Country not supported","friendlyMessage":"Transactions for NG are not available at the moment"}}},"bothAmounts":{"summary":"Both amounts sent","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"value\" contains a conflict between exclusive peers [sourceAmount, destinationAmount]"}}},"countryWithoutChannel":{"summary":"destinationCountry without destinationChannel","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"destinationCountry\" missing required peer \"destinationChannel\""}}}}}}},"451":{"description":"The destination country or channel is blocked and cannot be used.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"destinationBlocked":{"summary":"Destination blocked","value":{"code":"CORRIDOR_BLOCKED","error":"Corridor blocked","details":{"errorMessage":"Corridor blocked","friendlyMessage":""}}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/transaction/{transactionId}":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getTransaction","summary":"Get transaction by ID","description":"Retrieves a specific transaction by its unique identifier.","tags":["Transactions"],"parameters":[{"name":"transactionId","in":"path","description":"The unique identifier of the transaction","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}},"examples":{"success":{"summary":"Transaction retrieved","value":{"data":{"status":"SUCCESS","type":"SWAP","channel":"WALLET","sourceAmount":"10","sourceCurrency":"USD","destinationAmount":"14101.041","destinationCurrency":"NGN","customerId":"68e6717848e1f632e9686460","transactionId":"69d3c79531c0234586ad5ee0","merchantReference":"ref-swap-minimal-002","meta":{"reference":"ref-swap-minimal-002","idempotencyKey":"idem-swap-minimal-002","narration":""},"createdAt":"2026-04-06T14:47:49.166Z","updatedAt":"2026-04-06T14:47:49.166Z"}}}}}}},"400":{"description":"Invalid transaction ID format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidTransactionId":{"summary":"Malformed transaction id","value":{"code":"INVALID_BUSINESS_TRANSACTION_ID","error":"Invalid business transaction id","details":{"errorMessage":"Invalid business transaction id","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Transaction not found","value":{"code":"BUSINESS_TRANSACTION_NOT_FOUND","error":"Business transaction not found","details":{"errorMessage":"Business transaction not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const transaction = await afriex.transactions.get(\"transaction-id\");\n"}]}},"/api/v1/transaction/{transactionId}/authorize":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"authorizeTransaction","summary":"Authorize a pending transaction","description":"Completes a transaction that was created in a `CUSTOMER_ACTION_REQUIRED` state and needs an extra authorization step (for example, a one-time password on a mobile-money deposit). The body is discriminated by `type`; today the only supported variant is `OTP`. Your business must have a webhook URL set, otherwise the request is rejected with a 400.","tags":["Transactions"],"parameters":[{"name":"transactionId","in":"path","description":"The unique identifier of the transaction","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The authorization method.","enum":["OTP"]},"otp":{"type":"string","description":"The one-time password supplied by the customer."}},"required":["type","otp"]},"examples":{"otp":{"summary":"Authorize a deposit with an OTP","value":{"type":"OTP","otp":"123456"}}}}}},"responses":{"200":{"description":"Transaction authorized successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}},"examples":{"success":{"summary":"Transaction authorized","value":{"data":{"status":"PROCESSING","type":"DEPOSIT","channel":"MOBILE_MONEY","sourceAmount":"10","sourceCurrency":"USD","destinationAmount":"14101.041","destinationCurrency":"NGN","customerId":"68e6717848e1f632e9686460","transactionId":"69d3c79531c0234586ad5ee0","merchantReference":"ref-deposit-001","meta":{"reference":"ref-deposit-001","idempotencyKey":"idem-deposit-001","narration":""},"createdAt":"2026-04-06T14:47:49.166Z","updatedAt":"2026-04-06T14:49:02.110Z"}}}}}}},"400":{"description":"Invalid request, or your business is not yet allowed to use the API: no webhook URL is set, the request IP is not on your whitelist, the business is not approved or is deactivated, or business verification (KYB) is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Validation error","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'otp' is required","details":{}}},"otpNotAString":{"summary":"otp is not a string","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'otp' must be a string","details":{}}},"malformedTransactionId":{"summary":"Malformed transaction id","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'transactionId' contains an invalid value","details":{}}},"notADeposit":{"summary":"Transaction is not a deposit","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Authorization is only supported for deposit transactions"}}},"notAwaitingCustomerAction":{"summary":"Transaction is not waiting for the customer","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Transaction is not awaiting customer action"}}},"notAwaitingOtp":{"summary":"Transaction is not waiting for an OTP","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Transaction is not awaiting an OTP"}}},"noWebhookUrl":{"summary":"No webhook URL set on the business","value":{"code":"INVALID_BUSINESS_API_REQUEST","error":"Invalid business api request","details":{"errorMessage":"Invalid business api request","friendlyMessage":"No webhook url set in account"}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Transaction not found","value":{"code":"BUSINESS_TRANSACTION_NOT_FOUND","error":"Business transaction not found","details":{"errorMessage":"Business transaction not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const transaction = await afriex.transactions.authorize(\"transaction-id\", {\n  type: \"OTP\",\n  otp: \"123456\",\n});\n"}]}},"/api/v1/transaction/{transactionId}/simulate":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"simulateTransaction","summary":"Simulate a sandbox transaction outcome","description":"Sandbox only; returns 403 in production. Completes a pending sandbox deposit or payout with the outcome you choose, and your balance and transaction webhook behave as they would in production. The transaction must still be `PENDING`, `PROCESSING` or `UNKNOWN`: a deposit waiting for an OTP must be authorized first. Use it for a payment method whose account number, phone number or card ends in `0003`, which stays pending until simulated, or to complete any other pending sandbox transaction early. Only sandbox transactions that are still pending can be simulated. The result arrives by webhook shortly after this call returns. Your business must have a webhook URL set, otherwise the request is rejected with a 400.","tags":["Sandbox helpers"],"parameters":[{"name":"transactionId","in":"path","description":"The unique identifier of the transaction","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","description":"The status to finalize the transaction to.","enum":["success","failed"]}},"required":["outcome"]},"examples":{"success":{"summary":"Complete a pending sandbox deposit","value":{"outcome":"success"}}}}}},"responses":{"202":{"description":"Accepted. The transaction as it stands before it is finalized.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}}}}},"400":{"description":"The transaction cannot be simulated: it is not a sandbox transaction that can be simulated, is waiting for authorization, or is already completed. Also returned when your business is not yet allowed to use the API (no webhook URL set, request IP not on your whitelist, business not approved or deactivated, or verification required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notSimulatable":{"summary":"Transaction cannot be simulated","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Only transactions handled by the sandbox emulator can be simulated"}}},"awaitingAuthorization":{"summary":"Deposit still waiting for authorization","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Authorize the deposit before simulating it"}}},"alreadyFinalized":{"summary":"Transaction already finalized","value":{"code":"INVALID_BUSINESS_TRANSACTION_REQUEST","error":"Invalid business transaction request","details":{"errorMessage":"Invalid business transaction request","friendlyMessage":"Transaction is already finalized"}}},"invalidOutcome":{"summary":"outcome is not success or failed","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'outcome' must be one of [success, failed]","details":{}}},"noWebhookUrl":{"summary":"No webhook URL set on the business","value":{"code":"INVALID_BUSINESS_API_REQUEST","error":"Invalid business api request","details":{"errorMessage":"Invalid business api request","friendlyMessage":"No webhook url set in account"}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"403":{"description":"Not available in production. The body is `{\"message\": \"Not allowed\"}`, not the usual error shape.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"examples":{"notAllowed":{"summary":"Called in production","value":{"message":"Not allowed"}}}}}},"404":{"description":"Transaction not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/transaction/{transactionId}/advice":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getTransactionAdvice","summary":"Get settlement & remittance advice","description":"Returns a short-lived presigned download URL for the settlement & remittance advice PDF auto-generated for a USD withdrawal from your collection wallet (a withdrawal created with `settlement: \"request\"`). The advice is issued with status `PENDING` when the withdrawal is created and regenerated with status `COMPLETED` (same reference, incremented version) once the withdrawal succeeds. Scoped to your business: you can only fetch advices for your own transactions. This document is a settlement and remittance advice, not a tax invoice.","tags":["Transactions"],"parameters":[{"name":"transactionId","in":"path","description":"The unique identifier of the transaction","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Settlement advice download URL retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","description":"Short-lived (5 minute) presigned S3 URL for the advice PDF."},"reference":{"type":"string","description":"Stable advice reference number. Generated once per transaction and reused across regenerations."},"status":{"type":"string","enum":["PENDING","COMPLETED"],"description":"PENDING until the withdrawal succeeds, COMPLETED afterwards."},"version":{"type":"integer","description":"Regeneration counter. Starts at 1 at creation and increments when the advice is regenerated on completion."},"generatedAt":{"type":"string","format":"date-time"}}}}},"examples":{"success":{"summary":"Advice retrieved","value":{"data":{"url":"https://example-bucket.s3.amazonaws.com/<redacted-object-key>.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=...","reference":"ADV-EXAMPLE-0001","status":"PENDING","version":1,"generatedAt":"2026-01-01T00:00:00.000Z"}}}}}}},"400":{"description":"Invalid transaction ID format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidTransactionId":{"summary":"Malformed transaction id","value":{"code":"INVALID_BUSINESS_TRANSACTION_ID","error":"Invalid business transaction id","details":{"errorMessage":"Invalid business transaction id","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Transaction not found, or no settlement advice exists for this transaction (only USD withdrawals from the collection wallet qualify).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Transaction or advice not found","value":{"code":"BUSINESS_TRANSACTION_NOT_FOUND","error":"Business transaction not found","details":{"errorMessage":"Business transaction not found","friendlyMessage":"No settlement advice exists for this transaction"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}}}},"/api/v1/transaction/pool-account":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"submitPoolAccountPaymentProof","summary":"Submit a pool-account payment proof","description":"Submits proof of a deposit made to the business pool account. The request creates a business deposit transaction in `IN_REVIEW` status; an operator confirms the bank inflow before the funds are credited. The response returns that transaction. Duplicate submissions of the same business, customer, amount, reference, timestamp and sender details within the configured idempotency window are rejected. The `timestamp` cannot be in the future. Your business must have a webhook URL set, otherwise the request is rejected with a 400.","tags":["Transactions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolAccountPaymentProofRequest"},"examples":{"minimal":{"summary":"Submit a pool-account proof of payment","value":{"amount":5000,"customerId":"6929843e2c4653277440acc0","countryCode":"NG","reference":"6929843e2c4653277440acc0","fileKey":"64f0c2a1e4b0a1b2c3d4e5f6/proof.pdf","timestamp":"2026-01-01T12:00:00.000Z"}},"withSenderDetails":{"summary":"Submit a proof with sender details","value":{"amount":5000,"customerId":"6929843e2c4653277440acc0","countryCode":"NG","reference":"6929843e2c4653277440acc0","fileKey":"64f0c2a1e4b0a1b2c3d4e5f6/proof.pdf","timestamp":"2026-01-01T12:00:00.000Z","senderDetails":{"name":"John Doe","accountNumber":"0123456789","bankName":"GTBank","countryCode":"NG"}}}}}}},"responses":{"201":{"description":"Proof submitted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}}}}},"400":{"description":"Invalid request, or your business is not yet allowed to use the API: no webhook URL is set, the request IP is not on your whitelist, the business is not approved or is deactivated, or business verification (KYB) is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingRequiredField":{"summary":"Missing required field","value":{"code":"INVALID_BUSINESS_POOL_ACCOUNT_REQUEST","error":"Invalid business pool account request","details":{"errorMessage":"Invalid business pool account request","friendlyMessage":"No amount provided"}}},"futureTimestamp":{"summary":"Timestamp in the future","value":{"code":"INVALID_BUSINESS_POOL_ACCOUNT_REQUEST","error":"Invalid business pool account request","details":{"errorMessage":"Invalid business pool account request","friendlyMessage":"Timestamp cannot be in the future"}}},"noWebhookUrl":{"summary":"No webhook URL set on the business","value":{"code":"INVALID_BUSINESS_API_REQUEST","error":"Invalid business api request","details":{"errorMessage":"Invalid business api request","friendlyMessage":"No webhook url set in account"}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"409":{"description":"Duplicate submission within the idempotency window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"duplicateRequest":{"summary":"Duplicate submission within the idempotency window","value":{"code":"DUPLICATE_REQUEST","error":"Duplicate request","details":{"errorMessage":"Duplicate request","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}}}},"/api/v1/payment-method":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"createPaymentMethod","summary":"Create a payment method","description":"Creates a new payment method. `accountName`, `accountNumber` and `institution` are required for every channel except UPI and INTERAC, which take no `institution`, and VIRTUAL_BANK_ACCOUNT, which takes none of the three.\n\nAccount numbers are normalised before they are stored and returned: a mobile money number is rewritten to E.164 with a leading `+`, and an IBAN is returned in its normalised form.","tags":["Payment Methods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["channel","countryCode"],"properties":{"channel":{"type":"string","description":"The payment method channel","enum":["BANK_ACCOUNT","MOBILE_MONEY","VIRTUAL_BANK_ACCOUNT","ACH_BANK_ACCOUNT","INTERAC","UPI","SWIFT","WE_CHAT","ALIPAY"]},"customerId":{"description":"Optional. The customer to attach this payment method to. When omitted, it is attached to the business owner.","$ref":"#/components/schemas/customerId"},"type":{"type":"string","description":"The capability of this payment method. DEPOSIT means funds can be pulled from this method (e.g. charge/collect from the customer). WITHDRAW means funds can be sent to this method (e.g. pay out to the customer). If omitted, defaults to WITHDRAW.\n","enum":["DEPOSIT","WITHDRAW"]},"accountName":{"type":"string","description":"The name of the account holder. Must use Latin-script letters (A-Z / a-z, including accented forms such as é, ñ, ü, ç) or Chinese (Han) characters, digits (0-9), spaces and the characters & ( ) + , - . / : ? and apostrophe; it must contain at least one letter. Names in other scripts (e.g. Arabic, Cyrillic) or containing other symbols are rejected. Exception: China-facing payouts on the `WE_CHAT` and `ALIPAY` channels accept the beneficiary's local-script (e.g. Chinese) name. On `ALIPAY`, and on `WE_CHAT` with `currency` CNY, the name must be split into first and last name with a space (e.g. \"张 伟\" or \"Wei Zhang\")."},"accountNumber":{"type":"string","description":"The account number. For a BANK_ACCOUNT in NG it must be exactly 10 digits. For a BANK_ACCOUNT in a country that uses IBANs (e.g. EUR) it must be a valid IBAN. For MOBILE_MONEY send digits only, with no leading `+` (country code plus national number); the length is checked for some countries and the number must be a valid phone number for `countryCode`."},"countryCode":{"type":"string","description":"The ISO 3166-1 alpha-2 country code. This has to be one of the countries we support"},"institution":{"description":"The destination institution. For USD (SWIFT) payout payment methods, correspondentBankName and correspondentBankAccountNumber are mandatory. A BANK_ACCOUNT in CNY also needs `institutionBranch` and `institutionCode`. `WE_CHAT` and `ALIPAY` take no institution, because the channel names the wallet. Any institution you send for them is ignored.","$ref":"#/components/schemas/PaymentMethodInstitution"},"recipient":{"$ref":"#/components/schemas/PaymentMethodRecipient"},"sender":{"description":"Optional details of the sender, stored with the payment method and not returned on it. Takes the same fields as `recipient`.","$ref":"#/components/schemas/PaymentMethodRecipient"},"transaction":{"$ref":"#/components/schemas/PaymentMethodTransaction"},"meta":{"type":"object","description":"Optional meta data to attach to the payment method. It is stored as sent and returned as `meta` on the payment method.","additionalProperties":true},"walletTag":{"type":"string","description":"Optional. Tags the payment method to one of your wallets (`DEPOSIT`, `WITHDRAW` or `FEE`). Stored as sent and not returned on the payment method."},"amount":{"description":"Optional. An amount to store with the payment method, returned as `amount`.","$ref":"#/components/schemas/amount"},"wechatId":{"type":"string","description":"Optional WeChat ID, sent alongside the phone number in `accountNumber`. Only used on the `WE_CHAT` channel; ignored on every other channel."},"district":{"type":"string","pattern":"^BD-\\d{2}$","example":"BD-13","description":"The receiver's district as an ISO 3166-2 code (e.g. `BD-13`). Only accepted on a `MOBILE_MONEY` payment method in Bangladesh (`countryCode` `BD`), and needed there: a payout to a Bangladesh wallet saved without it is refused. Rejected on every other channel and country."}}},"examples":{"Bank Account":{"summary":"Bank Account, register a bank account to send funds to","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"BANK_ACCOUNT","accountName":"John Doe","accountNumber":"0123456789","countryCode":"NG","institution":{"institutionCode":"058","institutionName":"GTBank"}}},"SWIFT Transfer":{"summary":"SWIFT, register an international bank account via SWIFT","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"SWIFT","accountName":"John Doe","accountNumber":"DE89370400440532013000","countryCode":"DE","institution":{"institutionCode":"DEUTDEDB","institutionName":"Deutsche Bank","institutionAddress":"Taunusanlage 12, 60262 Frankfurt am Main, Germany","correspondentBankName":"Citibank N.A. New York","correspondentBankAccountNumber":"10991234"},"recipient":{"recipientAddress":"Musterstraße 1, 10115 Berlin, Germany"},"transaction":{"transactionNarration":"Payment for services"}}},"Mobile Money":{"summary":"Mobile Money, register a mobile money account to send funds to","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"MOBILE_MONEY","accountName":"John Doe","accountNumber":"0201234567","countryCode":"GH","institution":{"institutionCode":"MTN","institutionName":"MTN"}}},"Mobile Money (Deposit)":{"summary":"Mobile Money, register a mobile money account to pull funds from","value":{"customerId":"69528240ba52c13b669fb239","type":"DEPOSIT","channel":"MOBILE_MONEY","accountName":"John Doe","accountNumber":"0201234567","countryCode":"GH","institution":{"institutionCode":"MTN","institutionName":"MTN"}}},"UPI":{"summary":"UPI, register a UPI ID to send funds to (India)","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"UPI","accountName":"Raj Kumar","accountNumber":"rajkumar@upi","countryCode":"IN","recipient":{"recipientPhone":"+919876543210"}}},"Interac":{"summary":"Interac, register an Interac e-Transfer recipient (Canada)","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"INTERAC","accountName":"John Doe","accountNumber":"john.doe@email.com","countryCode":"CA","recipient":{"recipientEmail":"john.doe@email.com"}}},"WeChat Pay":{"summary":"WeChat Pay, register a WeChat Pay account to send funds to (China)","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"WE_CHAT","accountName":"Zhang Wei","accountNumber":"+8613812345678","countryCode":"CN","recipient":{"recipientPhone":"+8613812345678"}}},"Alipay":{"summary":"Alipay, register an Alipay account to send funds to (China). Use the ALIPAY channel; no institution is needed.","value":{"customerId":"69528240ba52c13b669fb239","type":"WITHDRAW","channel":"ALIPAY","accountName":"Zhang Wei","accountNumber":"+8613812345678","countryCode":"CN","recipient":{"recipientPhone":"+8613812345678"}}}}}}},"responses":{"201":{"description":"Payment method created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentMethod"}}},"examples":{"bankAccount":{"summary":"Bank account payment method created","value":{"data":{"paymentMethodId":"69d6002579101baa20f63816","channel":"BANK_ACCOUNT","customerId":"69d60024ab82306f11b03325","institution":{"institutionCode":"000013","institutionName":"GTBank"},"accountName":"John Doe","accountNumber":"0123456789","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"}}}}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingRequiredField":{"summary":"Missing required field","value":{"code":"INVALID_BUSINESS_PAYMENT_METHOD_REQUEST","error":"Invalid business payment method request","details":{"errorMessage":"Invalid business payment method request","friendlyMessage":"No account name provided"}}},"invalidCustomerId":{"summary":"Malformed customerId","value":{"code":"INVALID_BUSINESS_CUSTOMER_ID","error":"Invalid business customer id","details":{"errorMessage":"Invalid business customer id","friendlyMessage":""}}},"unknownCustomer":{"summary":"customerId matches no customer of yours","value":{"code":"INVALID_USER_DATA","error":"Invalid user data","details":{"errorMessage":"Invalid user data","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"The customer could not be resolved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"customerNotFound":{"summary":"Customer not found","value":{"code":"BUSINESS_CUSTOMER_NOT_FOUND","error":"Business customer not found","details":{"errorMessage":"Business customer not found","friendlyMessage":""}}}}}}},"422":{"description":"This payment method cannot be used: it is not available for the country, currency or channel you sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"paymentMethodNotSupported":{"summary":"Payment method cannot be used","value":{"code":"PROCESSOR_NOT_FOUND","error":"Processor not found","details":{"errorMessage":"Processor not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const paymentMethod = await afriex.paymentMethods.create({\n  channel: \"BANK_ACCOUNT\",\n  customerId: \"customer-id\",\n  accountName: \"John Doe\",\n  accountNumber: \"1234567890\",\n  countryCode: \"NG\",\n  institution: {\n    institutionCode: \"044\",\n    institutionName: \"Access Bank\",\n  },\n});\n"}]},"get":{"operationId":"listPaymentMethods","summary":"Get payment method list","description":"Retrieves a paginated list of payment methods.","tags":["Payment Methods"],"parameters":[{"name":"page","in":"query","description":"Page number for pagination (starting from 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"channel","in":"query","description":"Filter by one or more payment channels. Use a comma-separated list for multiple values (e.g. `?channel=BANK_ACCOUNT,MOBILE_MONEY`).","required":false,"schema":{"type":"array","items":{"type":"string","enum":["BANK_ACCOUNT","MOBILE_MONEY","INTERAC","UPI","WE_CHAT","VIRTUAL_BANK_ACCOUNT","RFP","SWIFT"]}},"style":"form","explode":false},{"name":"currencies","in":"query","description":"Filter by one or more 3-letter ISO 4217 currency codes. Use a comma-separated list for multiple values (e.g. `?currencies=USD,NGN`).","required":false,"schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false},{"name":"capabilities","in":"query","description":"Filter by payment method capability. Only `WITHDRAW` is currently supported. Defaults to `WITHDRAW` when omitted.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["WITHDRAW"]},"default":["WITHDRAW"]},"style":"form","explode":false},{"name":"status","in":"query","description":"Filter by one or more payment method statuses. Defaults to `active,pending` when omitted.","required":false,"schema":{"type":"array","items":{"type":"string","enum":["active","pending"]},"default":["active","pending"]},"style":"form","explode":false}],"responses":{"200":{"description":"List of payment methods retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"page":{"type":"integer","description":"Current page number"},"total":{"type":"integer","description":"Total number of payment methods matching the query"}}},"examples":{"success":{"summary":"Payment method list retrieved","value":{"data":[{"paymentMethodId":"6936b8774f987b2994865b73","channel":"BANK_ACCOUNT","customerId":"6922e4520a53e858ab42efa8","institution":{"institutionCode":"000013","institutionName":"GTBank"},"accountName":"John Doe","accountNumber":"1234567890","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"},{"paymentMethodId":"6936b8e54f987b2994865b8b","channel":"BANK_ACCOUNT","customerId":"6928515c6befd180bc451622","institution":{"institutionCode":"000017","institutionName":"WEMA BANK"},"accountName":"Test Account","accountNumber":"1213131313","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"}],"total":1006,"page":0}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"422":{"description":"Request failed schema validation. `details.friendlyMessage` carries the specific field error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Validation error","value":{"code":"VALIDATION_ERROR","error":"Validation error","details":{"errorMessage":"Validation error","friendlyMessage":"\"page\" must be a number"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const response = await afriex.paymentMethods.list({\n  page: 1,\n  limit: 20,\n});\n"}]}},"/api/v1/payment-method/{paymentMethodId}":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getPaymentMethod","summary":"Get payment method by ID","description":"Retrieves a specific payment method by its unique identifier.","tags":["Payment Methods"],"parameters":[{"name":"paymentMethodId","in":"path","description":"The unique identifier of the payment method","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payment method retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentMethod"}}},"examples":{"success":{"summary":"Payment method retrieved","value":{"data":{"paymentMethodId":"6936b8774f987b2994865b73","channel":"BANK_ACCOUNT","customerId":"6922e4520a53e858ab42efa8","institution":{"institutionCode":"000013","institutionName":"GTBank"},"accountName":"John Doe","accountNumber":"1234567890","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"}}}}}}},"400":{"description":"Request error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidPaymentMethodId":{"summary":"Malformed payment method id","value":{"code":"INVALID_BUSINESS_PAYMENT_METHOD_ID","error":"Invalid business payment method id","details":{"errorMessage":"Invalid business payment method id","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Payment method not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Payment method not found","value":{"code":"BUSINESS_PAYMENT_METHOD_NOT_FOUND","error":"Business payment method not found","details":{"errorMessage":"Business payment method not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const paymentMethod = await afriex.paymentMethods.get(\"payment-method-id\");\n"}]},"delete":{"operationId":"deletePaymentMethod","summary":"Delete payment method","description":"Removes a payment method from the system.","tags":["Payment Methods"],"parameters":[{"name":"paymentMethodId","in":"path","description":"The unique identifier of the payment method","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payment method deleted successfully.","content":{"application/json":{"schema":{"type":"object"},"examples":{"success":{"summary":"Payment method deleted","value":{}}}}}},"400":{"description":"Request error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidPaymentMethodId":{"summary":"Malformed payment method id","value":{"code":"INVALID_BUSINESS_PAYMENT_METHOD_ID","error":"Invalid business payment method id","details":{"errorMessage":"Invalid business payment method id","friendlyMessage":""}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Payment method not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Payment method not found","value":{"code":"BUSINESS_PAYMENT_METHOD_NOT_FOUND","error":"Business payment method not found","details":{"errorMessage":"Business payment method not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"await afriex.paymentMethods.delete(\"payment-method-id\");\n"}]}},"/api/v1/payment-method/institution":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"listInstitutions","summary":"Get list of payment method institutions by country","description":"Retrieves a list of banks or mobile money providers available for a specific country.","tags":["Payment Methods"],"parameters":[{"name":"channel","in":"query","description":"The payment method channel. Institution lookup is only implemented for these three channels; any other channel returns `400 INVALID_TRANSACTION_CHANNEL`.","required":true,"schema":{"type":"string","enum":["BANK_ACCOUNT","SWIFT","MOBILE_MONEY"]}},{"name":"countryCode","in":"query","description":"The ISO 3166-1 alpha-2 country code. Institutions are available only for the countries listed.","required":true,"schema":{"type":"string","enum":["US","NG","GB","DE","FR","CA","ZA","GH","KE","UG","TZ","RW","CM","CG","GA","CF","CI","BF","ML","SN","TG","BJ","NE","GN","ZM","ET","MW","MZ","BW","SL","LR","GM","GW","CV","ST","AO","KM","DJ","SO","SC","MU","SZ","LS"]}}],"responses":{"200":{"description":"List of banks or mobile money providers retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethodInstitution"}},"page":{"type":"integer","description":"Current page number"},"total":{"type":"integer","description":"Total number of items available"}}},"examples":{"nigeriaBanks":{"summary":"Nigerian bank accounts","value":{"data":[{"institutionName":"Guaranty Trust Bank (GTBank) Plc","institutionCode":"000013","institutionBranch":"","institutionAddress":""},{"institutionName":"Zenith Bank","institutionCode":"000015","institutionBranch":"","institutionAddress":""},{"institutionName":"Wema Bank","institutionCode":"000017","institutionBranch":"","institutionAddress":""}],"total":38,"page":0}},"ghanaMobileMoney":{"summary":"Ghana mobile money providers","value":{"data":[{"institutionName":"MTN","institutionCode":"MTN"},{"institutionName":"TIGO","institutionCode":"TIGO"},{"institutionName":"AIRTEL","institutionCode":"AIRTEL"}],"total":4,"page":0}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingParams":{"summary":"Missing required query parameters","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'countryCode' is required, 'channel' is required","details":{}}},"invalidChannel":{"summary":"Invalid channel value","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'channel' must be one of [BANK_ACCOUNT, MOBILE_MONEY, CARD, CRYPTO, VIRTUAL_BANK_ACCOUNT, POOL_ACCOUNT, ACH_BANK_ACCOUNT, INTERAC, PAYBILL_TILL, RFP, UPI, VIRTUAL_CARD, SWIFT, WE_CHAT, ALIPAY, PAYMENT_LINQ, ADMIN, WALLET]","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const institutions = await afriex.paymentMethods.getInstitutions({\n  channel: \"BANK_ACCOUNT\",\n  countryCode: \"NG\",\n});\n\n// Returns: Institution[], { institutionName, institutionCode, institutionBranch (bank), institutionAddress (bank and SWIFT) }\n"}]}},"/api/v1/payment-method/institution/codes":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"resolveInstitutionCode","summary":"Resolve bank code to institution name","description":"Resolves a bank code (SWIFT code or US routing number) to the corresponding bank or institution name.","tags":["Payment Methods"],"parameters":[{"name":"searchTerm","in":"query","description":"The bank code to resolve. A US routing number (8-9 digits) when codeType is routing_number, otherwise a SWIFT code.","required":true,"schema":{"type":"string"}},{"name":"country","in":"query","description":"ISO country code of the institution. Always required. routing_number lookups are only supported for US; all other countries use swift_code.","required":true,"schema":{"type":"string"}},{"name":"codeType","in":"query","description":"The type of bank code. routing_number is only valid when country is US; for every other country only swift_code is accepted.","required":true,"schema":{"type":"string","enum":["swift_code","routing_number"]}}],"responses":{"200":{"description":"Bank code resolved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankCodeResolverResponse"}}},"examples":{"routingNumberFound":{"summary":"Routing number resolved","value":{"data":{"bankName":"JPMORGAN CHASE BANK"}}},"notFound":{"summary":"Bank code not found","value":{"data":null}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingParams":{"summary":"Missing required parameters","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'country' is required, 'codeType' is required, 'searchTerm' is required","details":{}}},"invalidFormat":{"summary":"Invalid routing number format","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: US routing number must be between 8 and 9 digits","details":{}}},"swiftCountryMismatch":{"summary":"SWIFT code country mismatch","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: SWIFT code country DE does not match input US","details":{}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}}}},"/api/v1/payment-method/resolve":{"parameters":[{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"resolveRecipient","summary":"Resolve payment method recipient by account number","description":"Resolves payment method user information for bank accounts or mobile money.","tags":["Payment Methods"],"parameters":[{"name":"channel","in":"query","description":"The payment method channel to resolve","required":true,"schema":{"type":"string","enum":["MOBILE_MONEY","BANK_ACCOUNT"]}},{"name":"accountNumber","in":"query","description":"The account to resolve: a bank account number for BANK_ACCOUNT (required, at least 8 characters), or a phone number for MOBILE_MONEY.","required":false,"schema":{"type":"string"}},{"name":"institutionCode","in":"query","description":"Required for both channels. The bank code (at least 3 characters) for BANK_ACCOUNT, or the mobile money provider code (for example `MTN`; at least 3 characters) for MOBILE_MONEY.","required":true,"schema":{"type":"string"}},{"name":"countryCode","in":"query","description":"The ISO 3166-1 alpha-2 country code. A country with no account name lookup for the channel returns 400.","required":true,"schema":{"type":"string","examples":["NG"]}}],"responses":{"200":{"description":"Payment method resolved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentMethodResolveResponse"}}},"examples":{"bankAccountResolved":{"summary":"Bank account resolved","value":{"data":{"recipientName":"John Doe","institutionName":"GUARANTY TRUST BANK","institutionCode":"000013"}}},"mobileMoneyResolved":{"summary":"Mobile money account resolved","value":{"data":{"recipientName":"John Doe","institutionName":"MTN","institutionCode":"MTN"}}}}}}},"400":{"description":"Invalid request parameters, the account could not be resolved, or account name lookup is not available for the channel in that country. When it is not available, collect the recipient name yourself.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingParams":{"summary":"Missing required parameters","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'accountNumber' is required, 'institutionCode' is required, 'countryCode' is required","details":{}}},"accountNotResolved":{"summary":"Account could not be resolved","value":{"code":"BAD_REQUEST_ERROR","error":"We are unable to validate the beneficiary, please try again","details":{}}},"nameLookupNotAvailable":{"summary":"Name lookup not available in the country","value":{"code":"BAD_REQUEST_ERROR","error":"Account name lookup is not available for mobile money in this country","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const accountInfo = await afriex.paymentMethods.resolveAccount({\n  channel: \"BANK_ACCOUNT\",\n  accountNumber: \"1234567890\",\n  institutionCode: \"044\",\n  countryCode: \"NG\",\n});\n\n// Returns: { recipientName, institutionName, institutionCode }\n"}]}},"/api/v1/org/balance":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getBalance","summary":"Fetch wallet balance","description":"Returns one wallet's balances in the provided currencies, as a flat currency-to-amount map: the **Payout (Withdraw) wallet** by default, the **Fee wallet** with `walletType=FEE`, or the **Collection (Deposit) wallet** with `walletType=DEPOSIT`. The Collection wallet is the one that `settlement: \"request\"` withdrawals debit and that pool-account deposits credit.","tags":["Balance"],"parameters":[{"name":"currencies","in":"query","description":"Comma-separated list of currencies to fetch balances for. If omitted, balances for all supported currencies are returned.","required":false,"schema":{"type":"string"}},{"name":"walletType","in":"query","description":"The wallet to read. Defaults to `WITHDRAW`, the Payout wallet. `FEE` reads the wallet that settles transaction fees, which is zero for a business that does not use one. `DEPOSIT` reads the Collection wallet, and returns an empty `data` object while the Collection wallet is not enabled.","required":false,"schema":{"type":"string","enum":["DEPOSIT","WITHDRAW","FEE"],"default":"WITHDRAW"}}],"responses":{"200":{"description":"Returns a map with currencies as keys and balances as values.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"number","format":"double","description":"The balance of the currency."}}},"examples":[{"data":{"USD":100.5,"EUR":250.75,"GBP":300}}]},"examples":{"success":{"summary":"Balance retrieved","value":{"data":{"USD":990.00532,"NGN":39623.02258,"GBP":0}}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidCurrency":{"summary":"Unsupported currency code","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'currencies[0]' must be one of [NGN, USD, GBP, ...]","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"Business not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Business wallet not found","value":{"code":"BUSINESS_NOT_FOUND","error":"Business not found","details":{"errorMessage":"Business not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const balances = await afriex.balance.getBalance({\n  currencies: [\"USD\", \"NGN\", \"GBP\"],\n});\n\n// Returns: { USD: 10000, NGN: 5000000, GBP: 8000 }\n"}]}},"/api/v1/org/balance/topup":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"topupBalance","summary":"Top up sandbox balance","description":"Credits the business's Payout wallet, or its Fee or Collection wallet with `walletType: FEE` or `DEPOSIT`, with the specified amount and currency. **This endpoint is only available in the sandbox environment and will return a `403 Forbidden` response in production.** Use it during integration development to top up your test balance without making real transfers.","tags":["Sandbox helpers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number","format":"double","exclusiveMinimum":0,"description":"A positive number representing the amount to credit.","examples":[500]},"currency":{"type":"string","description":"Uppercase 3-letter ISO 4217 currency code (e.g. USD, NGN, GBP). Must be a supported Afriex currency.","examples":["USD"]},"walletType":{"type":"string","description":"The wallet to credit. When omitted, the Payout (`WITHDRAW`) wallet is credited. Use `FEE` to top up the wallet that settles transaction fees, or `DEPOSIT` for the Collection wallet.","enum":["DEPOSIT","WITHDRAW","FEE"]}}},"examples":{"topupUSD":{"summary":"Top up USD balance","value":{"amount":500,"currency":"USD"}},"topupNGN":{"summary":"Top up NGN balance","value":{"amount":250000,"currency":"NGN"}},"topupGBP":{"summary":"Top up GBP balance","value":{"amount":200,"currency":"GBP"}},"topupFee":{"summary":"Top up the fee wallet","value":{"amount":100,"currency":"USD","walletType":"FEE"}}}}}},"responses":{"200":{"description":"Balance successfully topped up. Returns the created transaction record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}}},"examples":{"success":{"summary":"Balance topped up","value":{"data":{"status":"SUCCESS","type":"DEPOSIT","sourceAmount":"100","sourceCurrency":"USD","destinationAmount":"100","destinationCurrency":"USD","channel":"ADMIN","customerId":"","transactionId":"69d6005dab82306f11b03360","meta":{"narration":"Test Funding Transaction"},"createdAt":"2026-04-08T07:14:37.568Z","updatedAt":"2026-04-08T07:14:37.568Z"}}}}}}},"400":{"description":"Invalid request body (e.g. missing fields, negative amount, unsupported currency), or `walletType: DEPOSIT` while the Collection wallet is not enabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingCurrency":{"summary":"Missing currency field","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'currency' is required","details":{}}},"unsupportedCurrency":{"summary":"Unsupported currency code","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'currency' must be one of [NGN, USD, GBP, EUR, ...]","details":{}}},"negativeAmount":{"summary":"Negative or zero amount","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'amount' must be a positive number","details":{}}},"depositWalletDisabled":{"summary":"Collection wallet not enabled","value":{"code":"BAD_REQUEST_ERROR","error":"The Deposit wallet is not enabled","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid or missing business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"403":{"description":"Forbidden - This endpoint is not available in the production environment.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","examples":["Not allowed"]}}},"examples":{"productionForbidden":{"summary":"Endpoint disabled in production","value":{"message":"Not allowed"}}}}}},"404":{"description":"Business not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"summary":"Business not found","value":{"code":"BUSINESS_NOT_FOUND","error":"Business not found","details":{"errorMessage":"Business not found","friendlyMessage":""}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const transaction = await afriex.balance.topUpSandbox({\n  amount: 500,\n  currency: \"USD\",\n});\n\nconsole.log(transaction.transactionId);\nconsole.log(transaction.status); // 'SUCCESS'\n"}]}},"/api/v1/org/rates":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"getRates","summary":"Get exchange rates","description":"Retrieves real-time exchange rates.","tags":["Rates"],"parameters":[{"name":"fromSymbols","in":"query","description":"Comma-separated list of base currency symbols to filter rates by (e.g., USD,NGN,EUR). If omitted, defaults to USD only.","required":false,"schema":{"type":"string","examples":["USD,NGN,EUR"]}},{"name":"toSymbols","in":"query","description":"Comma-separated list of target currency symbols to filter rates by (e.g., NGN,EUR,GBP). If omitted, all target currencies are returned.","required":false,"schema":{"type":"string","examples":["NGN,EUR,GBP"]}},{"name":"channel","in":"query","description":"Optional uppercase payment channel (e.g. `BANK_ACCOUNT`, `MOBILE_MONEY`). When given, rate promotions that apply to that channel are applied to the returned rates.","required":false,"schema":{"type":"string","enum":["WIDGET","BANK_ACCOUNT","MOBILE_MONEY","CARD","CRYPTO","INTERNAL","ADMIN","WALLET","VIRTUAL_BANK_ACCOUNT","POOL_ACCOUNT","ACH_BANK_ACCOUNT","INTERAC","UPI","GLOBAL","VIRTUAL_CARD","RFP","SWIFT","EFT","WE_CHAT","ALIPAY","PAYBILL_TILL","PAYMENT_LINQ"]}}],"responses":{"200":{"description":"Successful retrieval of rates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rates":{"type":"object","description":"Map of base currencies to their exchange rates","additionalProperties":{"type":"object","additionalProperties":{"type":"string","examples":["1.30272"]}},"examples":[{"USD":{"USD":"1","GBP":"0.69255","EUR":"0.80832","CAD":"1.30272","NGN":"1410.1041","KES":"125.0912"}}]},"updatedAt":{"type":"integer","format":"int64","description":"Unix timestamp of the last update","examples":[1773245407620]}}}}},"examples":{"allRates":{"summary":"All USD rates","value":{"data":{"rates":{"USD":{"USD":"1","EUR":"0.80832","GBP":"0.69255","CAD":"1.30272","NGN":"1410.1041","KES":"125.0912","GHS":"10.96338","UGX":"3485.0742"}},"updatedAt":1775632339823}}},"filteredRates":{"summary":"Filtered, USD to NGN and GBP","value":{"data":{"rates":{"USD":{"NGN":"1410.1041","GBP":"0.69255"}},"updatedAt":1775632523393}}}}}}},"400":{"description":"Invalid query parameters (an unsupported currency in `fromSymbols` or `toSymbols`, or an unknown `channel`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidChannel":{"summary":"Unknown channel","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'channel' must be one of [WIDGET, BANK_ACCOUNT, ...]","details":{}}}}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const response = await afriex.rates.getRates({\n  fromSymbols: \"USD,NGN\",\n  toSymbols: \"NGN,USD,GBP,KES\",\n});\n\nconsole.log(response.rates);\nconsole.log(response.updatedAt); // Unix timestamp\n"}]}},"/api/v1/payment-method/crypto-wallet":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"}],"get":{"operationId":"getCryptoWallet","summary":"Get or create crypto wallet payment method","description":"Retrieves an existing crypto wallet or creates a new one for the specified crypto asset. **Important:** This endpoint is **only active in production** and does **not work in sandbox**. Supports idempotency to prevent duplicate wallet creation: a call made while another crypto-wallet call from your business is still being processed returns `400 BAD_REQUEST_ERROR`, so retry it once the first has finished. Currently supports USDT and USDC assets (`USD` is accepted as an alias for `USDC`). Send a GET request with the required `asset` parameter (and optional `customerId`). The system will either return existing wallet addresses or automatically create and return new ones if none exist for that asset/customer (or business if no customerId is provided).","tags":["Payment Methods"],"parameters":[{"name":"asset","in":"query","description":"The crypto asset symbol for the wallet. `USD` is accepted as an alias for `USDC`.","required":true,"schema":{"type":"string","enum":["USDT","USDC","USD"]}},{"name":"customerId","in":"query","description":"Optional customer ID. If not provided, the wallet will be created for the business.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Crypto wallet addresses retrieved or created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The identifier of the payment method backing this crypto wallet.","examples":["695271a3ba52c13b669fad2b"]},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string","examples":["0x1234567890abcdef1234567890abcdef12345678"]},"network":{"type":"string","examples":["ETHEREUM_MAINNET"]}}}}}}}},"examples":{"usdtWallet":{"summary":"USDT wallet addresses","value":{"data":{"id":"695271a3ba52c13b669fad2b","addresses":[{"address":"0x1234567890123456789012345678901234567890","network":"ETHEREUM_MAINNET"},{"address":"TExampleTronAddressDoNotSend000001","network":"TRON_MAINNET"}]}}},"usdcWallet":{"summary":"USDC wallet addresses","value":{"data":{"id":"695271a3ba52c13b669fad2c","addresses":[{"address":"0xabcdef1234567890abcdef1234567890abcdef12","network":"ETHEREUM_MAINNET"}]}}}}}}},"400":{"description":"Invalid request parameters (e.g., invalid asset, user not verified, or service not available).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingAsset":{"summary":"Missing asset parameter","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'asset' is required","details":{}}},"invalidAsset":{"summary":"Unsupported asset (only USDT and USDC are supported)","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'asset' must be one of [USDC, USDT, USD]","details":{}}},"duplicateRequest":{"summary":"Another call is still being processed","value":{"code":"BAD_REQUEST_ERROR","error":"Duplicate request. Please wait a moment and try again","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const response = await afriex.paymentMethods.getCryptoWallet({\n  asset: \"USDT\", // or 'USDC'\n  customerId: \"optional-customer-id\",\n});\n\n// Returns: { data: { id, addresses: [{ address, network }] } }\n"}]}},"/api/v1/payment-method/virtual-account":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"}],"get":{"operationId":"listVirtualAccounts","summary":"List existing virtual accounts","description":"Returns every active virtual account for the resolved\ncustomer-or-owner and currency. Read-only: when no virtual account\nexists, the response is **200** with `data: []`.\n\nPass `customerId` to scope the list to a specific end-user; omit it\nto list the virtual accounts belonging to the business owner.\n\n**Breaking change from earlier versions:** the previous endpoint\nreturned a single virtual account and would create one on the fly\nwhen absent. It now returns a list and never creates. The create\npath lives at `POST /api/v1/payment-method/virtual-account`; the\n`POOL_ACCOUNT` variant has moved to\n`GET /api/v1/payment-method/pool-account`.\n","tags":["Payment Methods"],"parameters":[{"name":"currency","in":"query","description":"The 3-letter ISO 4217 currency code for the virtual account. The listed values are the supported currencies; other valid currency codes pass validation and simply return an empty list.","required":true,"schema":{"type":"string","enum":["NGN","GHS","KES","USD"]}},{"name":"customerId","in":"query","description":"Optional customer ID. When supplied, the lookup is scoped to that\ncustomer. When omitted, it resolves to the business owner.\n","required":false,"schema":{"type":"string"}},{"name":"country","in":"query","description":"Optional ISO 3166-1 alpha-2 country code.","required":false,"schema":{"type":"string"}},{"name":"amount","in":"query","description":"Optional positive amount.","required":false,"schema":{"type":"number"}},{"name":"reference","in":"query","description":"Optional merchant-supplied reference.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Virtual accounts retrieved successfully (possibly empty list).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"total":{"type":"integer","description":"Number of items in `data`."},"page":{"type":"integer","description":"Page index. Currently always `0`, the endpoint returns all matching VAs in a single response."}}},"examples":{"twoNgnAccounts":{"summary":"Two NGN virtual accounts for a customer","value":{"data":[{"paymentMethodId":"690cc5bbe2a1143ff6070119","channel":"VIRTUAL_BANK_ACCOUNT","customerId":"68e6717848e1f632e9686460","institution":{"institutionName":"FIDELITY BANK"},"accountName":"John Doe","accountNumber":"0123456781","countryCode":"NG","currency":"NGN","capabilities":["DEPOSIT"],"status":"active"},{"paymentMethodId":"690cc5bbe2a1143ff607011a","channel":"VIRTUAL_BANK_ACCOUNT","customerId":"68e6717848e1f632e9686460","institution":{"institutionName":"FIDELITY BANK"},"accountName":"John Doe (Sales)","accountNumber":"0123456782","countryCode":"NG","currency":"NGN","capabilities":["DEPOSIT"],"status":"active"}],"total":2,"page":0}},"noAccounts":{"summary":"No virtual accounts exist for this customer/currency","value":{"data":[],"total":0,"page":0}}}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingCurrency":{"summary":"Missing currency parameter","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'currency' is required","details":{}}},"invalidCurrency":{"summary":"Unsupported currency code","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'currency' must be one of [NGN, USD, GBP, GIP, EUR, ...]","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const response = await afriex.paymentMethods.listVirtualAccounts({\n  customerId: \"customer-id\",\n  currency: \"USD\",\n});\n"}]},"post":{"operationId":"createVirtualAccount","summary":"Create a virtual account payment method","description":"Creates a new virtual account for the resolved customer-or-owner and\ncurrency. Pass `customerId` to mint the VA for a specific end-user;\nomit it to mint one for the business owner.\n\n**Supported currencies.** A virtual account for one of your customers\n(`customerId` supplied) can be created in `NGN` or `GHS`. Any other\ncurrency returns `422 UNSUPPORTED_VIRTUAL_ACCOUNT_CURRENCY`; create it for\nthe business itself by omitting `customerId`, which is how `KES` and\n`USD` accounts are created.\n\nSubject to a per-(business, customer, currency) limit. Requests that\nwould exceed the limit return `403 VIRTUAL_ACCOUNT_LIMIT_REACHED`.\n\n**NGN and BVN.** A permanent `NGN` account (no `amount`) is opened\nagainst the account holder's BVN. If the holder has none, the request\nreturns `VIRTUAL_ACCOUNT_BVN_REQUIRED`; pass `amount` to get a one-time\naccount instead, which does not need a BVN.\n\n**Compliance review:** every currency requires a compliance-approved\napplication before issuance. The first request for a not-yet-approved\nbusiness/currency starts that review and returns\n`VIRTUAL_ACCOUNT_PENDING_COMPLIANCE_REVIEW`; retry once approved.\n\n**Accounts opened asynchronously:** for some currencies the issuing\nbank opens the account after the request returns. The response is\nthen `201` with an empty `data` object, and the account is delivered\nthrough the `PAYMENT_METHOD.CREATED` webhook once it is open.\n\n**Label vs amount:** `label` groups static virtual accounts by\npurpose (e.g. `SALES`, `OPERATIONS`). It is **mutually exclusive\nwith `amount`**, which routes to a dynamic (ephemeral) virtual\naccount. Supplying both is rejected at validation.\n","tags":["Payment Methods"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["currency"],"properties":{"currency":{"type":"string","description":"The 3-letter ISO 4217 currency code for the virtual account. The listed values are the supported currencies; other valid currency codes pass validation and fail later in the request.","enum":["NGN","GHS","KES","USD"]},"customerId":{"type":"string","description":"Optional customer ID. When supplied, the VA is created\nfor that customer. When omitted, it is created for the\nbusiness owner.\n"},"amount":{"type":"number","description":"Optional amount for a dynamic (ephemeral) virtual\naccount. Mutually exclusive with `label`.\n","exclusiveMinimum":0,"maximum":5000000},"label":{"type":"string","description":"Optional label that groups static virtual accounts by\npurpose. Mutually exclusive with `amount`.\n","enum":["SALES","OPERATIONS","PAYROLL","COLLECTIONS","VENDOR_PAYMENTS","TAX","REFUNDS","MARKETING","TREASURY","GENERAL"]}}},"examples":{"staticWithLabel":{"summary":"Static virtual account grouped by label","value":{"currency":"NGN","customerId":"68e6717848e1f632e9686460","label":"SALES"}},"dynamicWithAmount":{"summary":"Dynamic (ephemeral) virtual account tied to an amount","value":{"currency":"NGN","customerId":"68e6717848e1f632e9686460","amount":50000}},"businessOwner":{"summary":"Virtual account for the business owner (no customerId)","value":{"currency":"USD","label":"TREASURY"}}}}}},"responses":{"201":{"description":"Virtual account created successfully, or (empty `data`) requested\nand pending with the issuing bank.\n","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethod"},{"type":"object","description":"Empty while the account is being opened.","maxProperties":0}]}}},"examples":{"pendingWithBank":{"summary":"Account requested, pending with the issuing bank","value":{"data":{}}},"ngnVirtualAccount":{"summary":"NGN dedicated virtual bank account","value":{"data":{"paymentMethodId":"690cc5bbe2a1143ff6070119","channel":"VIRTUAL_BANK_ACCOUNT","customerId":"68e6717848e1f632e9686460","institution":{"institutionName":"FIDELITY BANK"},"accountName":"John Doe","accountNumber":"0123456781","countryCode":"NG","currency":"NGN","capabilities":["DEPOSIT"],"status":"active"}}}}}}},"400":{"description":"Invalid request (e.g. `label` and `amount` both supplied), or a\npermanent `NGN` account requested for a holder without a BVN.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"labelAndAmount":{"summary":"Both label and amount supplied","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: label cannot be set when amount is provided","details":{}}},"bvnRequired":{"summary":"Permanent NGN account for a holder without a BVN","value":{"code":"VIRTUAL_ACCOUNT_BVN_REQUIRED","error":"Virtual account bvn required","details":{"errorMessage":"Virtual account bvn required","friendlyMessage":"A BVN is required for a permanent NGN account. Provide an amount to get a one-time account instead."}}},"missingCurrency":{"summary":"Missing currency","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'currency' is required","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"403":{"description":"The per-(business, customer, currency) virtual account limit is\nreached, the business is still pending compliance review for\nvirtual account issuance, or the account holder has not completed\nKYC.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"limitReached":{"summary":"Per-(business, customer, currency) cap reached","value":{"code":"VIRTUAL_ACCOUNT_LIMIT_REACHED","error":"Virtual account limit reached","details":{"errorMessage":"Virtual account limit reached","friendlyMessage":"Virtual account limit of 5 reached for NGN for customer 68e6717848e1f632e9686460"}}},"pendingComplianceReview":{"summary":"Business not yet approved for virtual accounts in this currency","value":{"code":"VIRTUAL_ACCOUNT_PENDING_COMPLIANCE_REVIEW","error":"Virtual account pending compliance review","details":{"errorMessage":"Virtual account pending compliance review","friendlyMessage":"Virtual account creation is pending compliance review"}}},"kycNotCompleted":{"summary":"Account holder has not completed KYC","value":{"code":"USER_NOT_VERIFIED","error":"User not verified","details":{"errorMessage":"User not verified","friendlyMessage":"Complete your KYC verification to get a virtual account."}}}}}}},"422":{"description":"The requested currency is not available to the resolved account\nholder, or the account type (permanent, or one-time with `amount`)\nis not offered for this currency.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"customerUnsupportedCurrency":{"summary":"Unsupported currency requested for a customer","value":{"code":"UNSUPPORTED_VIRTUAL_ACCOUNT_CURRENCY","error":"Unsupported virtual account currency","details":{"errorMessage":"Unsupported virtual account currency","friendlyMessage":"USD virtual accounts cannot be created for a customer. Create it for the business instead by omitting customerId."}}},"unsupportedAccountType":{"summary":"Account type not offered for this currency","value":{"code":"UNSUPPORTED_VIRTUAL_ACCOUNT_TYPE","error":"Unsupported virtual account type","details":{"errorMessage":"Unsupported virtual account type","friendlyMessage":"DYNAMIC virtual accounts are not supported for this currency"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const account = await afriex.paymentMethods.createVirtualAccount({\n  currency: \"USD\",\n  label: \"SALES\",\n  customerId: \"optional-customer-id\",\n});\n"}]}},"/api/v1/payment-method/virtual-account/simulate-transfer":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"}],"post":{"operationId":"simulateVirtualAccountTransfer","summary":"Simulate a transfer into a sandbox virtual account","description":"Sandbox only; returns 403 in production. Credits a bank transfer into one of your sandbox virtual accounts, the way the account provider's deposit notification would, so balances and your transaction webhook behave as in production. Pass the account number; for an account created with an `amount` (a one-time account), also pass the `reference` it was issued with. The deposit is reported by the transaction webhook.","tags":["Sandbox helpers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountNumber":{"type":"string","description":"The virtual account number to pay into."},"amount":{"type":"number","description":"The amount transferred."},"currency":{"type":"string","description":"The account's currency."},"reference":{"type":"string","description":"The reference a one-time (amount-bound) account was issued with. Not needed for a reusable account."},"outcome":{"type":"string","description":"Defaults to `success`.","enum":["success","failed"]}},"required":["accountNumber","amount","currency"]},"examples":{"transfer":{"summary":"Pay 5,000 NGN into a sandbox account","value":{"accountNumber":"4821930275","amount":5000,"currency":"NGN"}}}}}},"responses":{"202":{"description":"Accepted. The reference of the new deposit.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reference":{"type":"string"}}}}}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Not available in production."},"404":{"description":"No sandbox virtual account with that number for your business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-method/pool-account":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"}],"get":{"operationId":"getPoolAccount","summary":"Get the business pool account","description":"Returns the pool account for the supplied `country`. Use the\n`reference` on the response to reconcile incoming deposits; it is a\nshortened form such as `afx1234` (with a customer, `afx1234012`).\nEach call also sends a `PAYMENT_METHOD.UPDATED` webhook carrying the\npool account.\n","tags":["Payment Methods"],"parameters":[{"name":"country","in":"query","description":"ISO 3166-1 alpha-2 country code.","required":true,"schema":{"type":"string","examples":["NG"]}},{"name":"customerId","in":"query","description":"Optional customer ID to associate with this account.","required":false,"schema":{"type":"string"}},{"name":"amount","in":"query","description":"Optional positive amount. Accepted but ignored.","required":false,"schema":{"type":"number"}},{"name":"reference","in":"query","description":"Optional merchant-supplied reference. Accepted but ignored.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pool account returned successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentMethod"}}},"examples":{"poolAccountNG":{"summary":"Pool account assigned for an NG/NGN deposit","value":{"data":{"paymentMethodId":"69c2804b30314b491e48b305","channel":"VIRTUAL_BANK_ACCOUNT","customerId":"6929843e2c4653277440acc0","reference":"afx1234","institution":{"institutionName":"UBA"},"accountName":"TEST","accountNumber":"12345678","countryCode":"NG","currency":"NGN","capabilities":["DEPOSIT"],"status":"active"}}}}}}},"400":{"description":"Invalid request, for example a missing or unsupported country code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingCountry":{"summary":"Missing country","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'country' is required","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingApiKey":{"summary":"Missing API key","value":{"code":"AUTHENTICATION_ERROR","error":"Authorization header is missing","details":{}}},"invalidApiKey":{"summary":"Invalid API key","value":{"code":"AUTHENTICATION_ERROR","error":"Invalid authorization header","details":{}}}}}}},"404":{"description":"No pool account is configured for the business in this country. Retrying returns the same answer until one is set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"noPoolAccount":{"summary":"No pool account available for the country (for example, MX)","value":{"code":"BUSINESS_PAYMENT_METHOD_NOT_FOUND","error":"Business payment method not found","details":{"errorMessage":"Business payment method not found","friendlyMessage":"No pool account available for business for this country"}}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serverError":{"summary":"Unexpected server error","value":{"code":"INTERNAL_SERVER_ERROR","error":"It's not you, it's us, please reach out to support","details":{}}}}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const poolAccount = await afriex.paymentMethods.listPoolAccounts({\n  customerId: \"customer-id\",\n  country: \"NG\",\n});\n"}]}},"/api/v1/checkout-session":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"createCheckoutSession","summary":"Create a checkout session","description":"Creates a hosted checkout session for a customer and returns a `checkoutUrl` that the customer should be redirected to in order to complete payment. The session captures the merchant intent (amount, currency, merchant reference, customer details, and allowed payment channels).\n\nThe response carries the `checkoutId` and `checkoutUrl` directly, and no webhook is sent when a session is created. Track the payment with transaction events. Every transaction the customer's payment produces carries your `merchantReference` as `merchantReference`, and your `metadata` as `meta`, in transaction webhooks and in the transaction responses.\n\n**Available in sandbox and production.** Create a session with a sandbox API key to try the full flow in test mode, and with a production API key to take real payments.","tags":["Checkout Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["amount","currency","merchantReference","redirectUrl","customer","channels"],"properties":{"amount":{"type":"integer","minimum":100,"maximum":9007199254740991,"description":"The transaction amount in **minor currency units** (e.g. kobo for NGN, cents for USD). Minimum 100 (equivalent to 1 major currency unit).","examples":[500000]},"currency":{"type":"string","description":"3-letter ISO 4217 currency code (e.g. NGN, GHS). Must be one of the currencies enabled for checkout sessions: NGN, GHS, KES, UGX, TZS, ETB, XAF, XOF, SLE, USD.","examples":["NGN"]},"merchantReference":{"type":"string","minLength":1,"description":"Your own reference for this session, for example an order number. It is not required to be unique. It is returned as `merchantReference` on the transactions the customer's payment produces, so you can reconcile them with your order.","examples":["order-2026-05-12-001"]},"redirectUrl":{"type":"string","format":"uri","pattern":"^https://","description":"HTTPS URL the hosted checkout sends the customer to when they leave the success screen after paying. No query parameters are added to it.","examples":["https://merchant.example.com/checkout/return"]},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Optional title of the session, at most 100 characters. Angle brackets and control characters are rejected.","examples":["Order 2026-05-12-001"]},"description":{"type":"string","minLength":1,"maxLength":500,"description":"Optional description of what the customer is paying for."},"customer":{"$ref":"#/components/schemas/CheckoutSessionCustomer"},"channels":{"type":"array","minItems":1,"description":"The payment channels you are willing to offer the customer, at least one. **This is a cap, not an exact list: you do not need to vary it per country.** The channels the customer is shown are decided when they open the checkout page, once their currency is known: channels it cannot collect on are dropped then, so the same list works for every country (send `[\"VIRTUAL_BANK_ACCOUNT\", \"MOBILE_MONEY\", \"CARD\"]` and a KES checkout offers mobile money while a USD one offers cards).","items":{"type":"string","enum":["VIRTUAL_BANK_ACCOUNT","MOBILE_MONEY","CARD"]}},"metadata":{"type":"object","maxProperties":50,"description":"Optional flat key/value metadata to attach to the session. It is returned as `meta` on the transactions the customer's payment produces. Both keys and values must be strings. At most 50 entries; keys up to 128 characters, values up to 1024 characters.","additionalProperties":{"type":"string","minLength":1,"maxLength":1024}}}},"examples":{"minimal":{"summary":"One channel list for every country","value":{"amount":500000,"currency":"NGN","merchantReference":"order-2026-05-12-001","redirectUrl":"https://merchant.example.com/checkout/return","customer":{"name":"John Doe","email":"john.doe@example.com","phone":"+2348192837465","countryCode":"NG"},"channels":["VIRTUAL_BANK_ACCOUNT","MOBILE_MONEY","CARD"]}},"withChannelsAndMetadata":{"summary":"Narrowing to specific channels, plus metadata","value":{"amount":500000,"currency":"NGN","merchantReference":"order-2026-05-12-002","redirectUrl":"https://merchant.example.com/checkout/return","customer":{"name":"John Doe","email":"john.doe@example.com","phone":"+2348192837465","countryCode":"NG"},"channels":["VIRTUAL_BANK_ACCOUNT","CARD"],"metadata":{"orderId":"12345","source":"web"}}}}}}},"responses":{"201":{"description":"Checkout session created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateCheckoutSessionResponse"}}},"examples":{"created":{"summary":"Session created","value":{"data":{"checkoutId":"394102","checkoutUrl":"https://pay.afriex.com/pay/394102","channels":["VIRTUAL_BANK_ACCOUNT","CARD"]}}}}}}},"400":{"description":"Invalid request: the body failed validation (unknown fields are rejected), or your business has no webhook URL set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"validationError":{"summary":"Body failed validation","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: amount must be at least 100 (equivalent to 1 major currency unit)","details":{}}},"noWebhookUrl":{"summary":"No webhook URL set on the business","value":{"code":"INVALID_BUSINESS_API_REQUEST","error":"Invalid business api request","details":{"errorMessage":"Invalid business api request","friendlyMessage":"No webhook url set in account"}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const session = await afriex.checkout.createSession({\n  amount: 500000,\n  currency: \"NGN\",\n  merchantReference: \"order-2026-05-12-001\",\n  redirectUrl: \"https://yourapp.com/checkout/return\",\n  customer: {\n    name: \"John Doe\",\n    email: \"john@example.com\",\n    phone: \"+2348192837465\",\n    countryCode: \"NG\",\n  },\n  // Send the same list everywhere; unsupported ones are dropped\n  channels: [\"VIRTUAL_BANK_ACCOUNT\", \"MOBILE_MONEY\", \"CARD\"],\n  metadata: { orderId: \"order-456\", cartId: \"cart-123\" },\n});\n\nconsole.log(session.checkoutId);\n// Redirect customer to session.checkoutUrl\nconsole.log(session.checkoutUrl);\n// What the payer will be shown, e.g. [\"VIRTUAL_BANK_ACCOUNT\", \"CARD\"]\nconsole.log(session.channels);\n"}]}},"/api/v1/webhooks/trigger":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"triggerWebhook","summary":"Trigger a test webhook (sandbox-only)","description":"Fires a real signed webhook to the business's configured callback URL using a real entity (customer, payment method, or transaction) as the payload. Useful for testing webhook handlers in sandbox without manufacturing the underlying activity. **This endpoint is only available in the sandbox environment and will return a `403 Forbidden` response in production.** The business must have a webhook callback URL configured, or the request is rejected with `400`.","tags":["Sandbox helpers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","entityId"],"properties":{"event":{"allOf":[{"$ref":"#/components/schemas/WebhookEventName"}],"description":"The event to fire. `POOL_DEPOSIT_REQUEST.REJECTED` is delivered by the pool-account flow but cannot be fired from this test endpoint; sending it returns `400`."},"entityId":{"type":"string","description":"The identifier of the entity to send in the webhook payload. Must be the 24-character hexadecimal id of the relevant customer, payment method, or transaction (the id returned when it was created).","examples":["69528240ba52c13b669fb239"]}}},"examples":{"transactionEvent":{"summary":"Trigger a transaction webhook","value":{"event":"TRANSACTION.UPDATED","entityId":"6952826eba52c13b669fb263"}}}}}},"responses":{"200":{"description":"Webhook triggered successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Details of the queued webhook delivery.","properties":{"queued":{"type":"boolean","description":"Always true; the webhook delivery was queued."},"event":{"$ref":"#/components/schemas/WebhookEventName"},"entityId":{"type":"string","description":"The id of the entity used as the webhook payload."},"deliveryUrl":{"type":"string","description":"The business webhook callback URL the event was queued to."}}}}},"examples":{"queued":{"summary":"Webhook queued","value":{"data":{"queued":true,"event":"TRANSACTION.UPDATED","entityId":"6952826eba52c13b669fb263","deliveryUrl":"https://merchant.example.com/webhooks"}}}}}}},"400":{"description":"Invalid request body, or the business has no webhook callback URL configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - This endpoint is not available in the production environment.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","examples":["Not allowed"]}}}}}},"404":{"description":"No customer, payment method or transaction with `entityId` belongs to the calling business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable: an upstream service failed or timed out, or the API is momentarily offline. Retry with backoff and honour the Retry-After header when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"serviceUnavailable":{"summary":"Upstream service unavailable","value":{"code":"EXTERNAL_REQUEST_ERROR","error":"External request error","details":{}}}}}}}},"x-codeSamples":[{"lang":"TypeScript","label":"Afriex SDK","source":"const result = await afriex.webhooks.triggerTestWebhook({\n  event: \"TRANSACTION.UPDATED\",\n  entityId: \"6952826eba52c13b669fb263\",\n});\n\nconsole.log(result);\n// { queued: true, event: \"TRANSACTION.UPDATED\", entityId: \"6952826eba52c13b669fb263\", deliveryUrl: \"https://merchant.example.com/webhooks\" }\n"}]}},"/api/v1/media/url":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"generatePresignedURL","summary":"Generate a presigned URL for file upload","description":"Generates a presigned S3 URL that the caller can use to upload a file (e.g. a KYC document) directly to Afriex's secure storage. The returned URL is time-limited and scoped to the requested operation. The file name is sanitised before it is used: any directory part is dropped, characters outside `A-Z a-z 0-9 . _ -` become `_`, and the result is cut to 200 characters. The object is stored as `{businessId}/{sanitisedName}`, so always use the returned `key`, not the name you sent, when you reference the file in a later request.","tags":["Media"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaURLRequest"},"examples":{"upload-user":{"summary":"Generate a user KYC upload URL","value":{"fileName":"passport.png","type":"user"}},"upload-transaction":{"summary":"Generate a transaction file upload URL","value":{"fileName":"report.csv","type":"transaction"}}}}}},"responses":{"200":{"description":"Presigned URL generated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaURLResponse"},"examples":{"url":{"summary":"Presigned URL","value":{"data":{"url":"https://s3.amazonaws.com/bucket/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&...","key":"64f0c2a1e4b0a1b2c3d4e5f6/invoice.pdf","expiresIn":300}}}}}}},"400":{"description":"Invalid request body, or a `fileName` that names no file once directory parts and unsafe characters are removed (for example `/`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"emptyFileName":{"summary":"fileName is empty","value":{"code":"VALIDATION_ERROR","error":"Failed to parse request. Issues: 'fileName' is not allowed to be empty","details":{}}},"noFileName":{"summary":"fileName names no file","value":{"code":"BAD_REQUEST_ERROR","error":"fileName must name a file","details":{}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The upload URL could not be generated. Retry the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/sme-registration":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"post":{"operationId":"smeRegistration","summary":"Register a business as an SME (step-based)","description":"Registers a business as its own SME so that dedicated virtual accounts are issued under the business's own legal entity rather than the shared default. The flow is stateful and driven by this single endpoint: the `step` field selects the payload carried in `data`. Call the steps in order: `INITIATE` (triggers a one-time passcode to the supplied mobile number), `CONFIRM_OTP`, then `SUBMIT` (company details, directors and documents). Upload each document first via `POST /api/v1/media/url` and pass the returned object keys in the `SUBMIT` payload. Calling `INITIATE` again while the registration is still waiting for its passcode returns that same registration with a `200`. Requires the `COMPLIANCE.KYB.SUBMIT` key permission.","tags":["SME Registration"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The `step` field selects the payload carried in `data`, and it is case insensitive (`submit` is accepted as `SUBMIT`).\n\nEvery mobile number (the applicant's on `INITIATE` and each director's on `SUBMIT`) must be a valid Kenyan number. Any of `254712345678`, `+254712345678`, `0712345678` or `712345678` is accepted and normalised to E.164; a number that is not Kenyan is rejected with `422`. Directors do not need a `countryCode`: it is derived from the number, and ignored if sent.","oneOf":[{"type":"object","title":"INITIATE","required":["step","data"],"properties":{"step":{"type":"string","const":"INITIATE"},"data":{"type":"object","required":["mobile","email","businessType"],"properties":{"mobile":{"type":"string","description":"A valid Kenyan mobile number."},"email":{"type":"string","format":"email"},"businessType":{"type":"integer","enum":[2],"description":"Must be `2`. Only Limited Liability Companies are supported at this time."}}}}},{"type":"object","title":"CONFIRM_OTP","required":["step","data"],"properties":{"step":{"type":"string","const":"CONFIRM_OTP"},"data":{"type":"object","required":["onboardingRequestId","otp"],"properties":{"onboardingRequestId":{"type":"string","description":"The id returned by the `INITIATE` step."},"otp":{"type":"string","pattern":"^[0-9]{6}$","description":"The 6-digit one-time passcode, as a string."}}}}},{"type":"object","title":"SUBMIT","required":["step","data"],"properties":{"step":{"type":"string","const":"SUBMIT"},"data":{"$ref":"#/components/schemas/SmeRegistrationSubmitData"}}}]},"examples":{"initiate":{"summary":"Step 1, initiate and trigger the OTP","value":{"step":"INITIATE","data":{"mobile":"254712345678","email":"admin@example.com","businessType":2}}},"confirm-otp":{"summary":"Step 2, confirm the OTP","value":{"step":"CONFIRM_OTP","data":{"onboardingRequestId":"68f0c2a1e4b0a1b2c3d4e5f6","otp":"483921"}}},"submit":{"summary":"Step 3, submit company details, directors and documents","value":{"step":"SUBMIT","data":{"onboardingRequestId":"68f0c2a1e4b0a1b2c3d4e5f6","companyName":"Acme Payments Ltd","certNumber":"PVT-ABC1234","kraPin":"P051234567A","operatingMode":2,"businessAddress":"12 Kimathi Street, Nairobi","businessIndustry":21,"specifyIndustry":"Payment services","directors":[{"idType":"101","idNumber":"12345678","gender":1,"email":"jane@example.com","mobile":"254712345678","firstName":"Jane","lastName":"Doe","kraPin":"A001234567B","idFrontSideFileKey":"64f0c2a1e4b0a1b2c3d4e5f6/id-front.png","idFrontSideFileType":"image","idBackSideFileKey":"64f0c2a1e4b0a1b2c3d4e5f6/id-back.png","idBackSideFileType":"image","selfieFileKey":"64f0c2a1e4b0a1b2c3d4e5f6/selfie.png","selfieFileType":"image","kraPinFileKey":"64f0c2a1e4b0a1b2c3d4e5f6/kra-pin.pdf","kraPinFileType":"pdf"}],"organizationShareholders":[{"companyName":"Acme Holdings Ltd","registrationFileKey":"64f0c2a1e4b0a1b2c3d4e5f6/holdings-cert.pdf","registrationFileType":"pdf"}],"media":[{"fileKey":"64f0c2a1e4b0a1b2c3d4e5f6/cert-of-incorporation.pdf","mediaType":"certificate_of_incorporation","contentType":"pdf"}]}}}}}}},"responses":{"200":{"description":"Step processed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"onboardingRequestId":{"type":"string"},"step":{"type":"string","enum":["INITIATE","CONFIRM_OTP","SUBMIT"]},"status":{"type":"string","enum":["OTP_PENDING","DETAILS_PENDING","SUBMITTED","REJECTED","EXPIRED"]},"nextStep":{"type":["string","null"],"enum":["CONFIRM_OTP","SUBMIT",null]},"expiresAt":{"type":"string","format":"date-time","description":"Deadline for the current step: OTP window after INITIATE, submit window after CONFIRM_OTP."}}}}}}}},"400":{"description":"A step called out of order, an expired OTP, or a duplicate active registration. Malformed field values return `422` instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Request failed schema validation. `details.friendlyMessage` carries the specific field error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/sme-registration/status":{"parameters":[{"$ref":"#/components/parameters/x-api-version"}],"get":{"operationId":"smeRegistrationStatus","summary":"Get SME registration status","description":"Returns the most recent SME registration status for the authenticated business. Once the registration has been submitted, the response also includes the latest review outcome. Requires the `COMPLIANCE.KYB.READ` key permission.","tags":["SME Registration"],"responses":{"200":{"description":"Current SME registration status.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"onboardingRequestId":{"type":["string","null"],"description":"Null when the business has never registered."},"status":{"type":["string","null"],"enum":["OTP_PENDING","DETAILS_PENDING","SUBMITTED","REJECTED","EXPIRED",null]},"reviewStatus":{"type":"string","description":"Public review outcome, present only once the registration has been submitted. `APPROVED` means the business's dedicated KES virtual accounts can be issued under its own entity; `UNKNOWN` is a forward-compatibility slot for any provider code Afriex has not mapped yet. The set may grow over time; handle unknown values by falling back to `UNKNOWN`.","enum":["SUBMITTED","PROCESSING","APPROVED","REJECTED","CLOSED","UNDER_REVIEW","UNKNOWN"]},"rejectReasons":{"type":["array","null"],"items":{"type":"string"}},"isReviewStatusStale":{"type":"boolean","description":"True when Afriex could not reach the provider for a fresh review outcome on this read, so `reviewStatus` reflects the last known value (or `UNKNOWN` if none is cached) rather than the current one. Absent when the read succeeded."}}}}}}}},"401":{"description":"Unauthorized - Invalid business API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"}],"get":{"operationId":"listPaymentBatches","summary":"List payment batches","description":"Returns the batches belonging to the calling business. Requires the `PAYMENT_BATCH.READ` key permission.","tags":["Payment Batches"],"parameters":[{"$ref":"#/components/parameters/paymentBatchPage"},{"$ref":"#/components/parameters/paymentBatchLimit"}],"responses":{"200":{"description":"Successful retrieval of batches","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBatchListItem"}},"total":{"type":"integer"},"page":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"createPaymentBatch","summary":"Create a payment batch","description":"Creates an empty batch. Add recipients with the recipient endpoints, then start the payouts with POST /api/v1/payment-batch/{batchId}/withdraw. Requires the `PAYMENT_BATCH.CREATE` key permission.","tags":["Payment Batches"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchRequest"}}}},"responses":{"201":{"description":"The batch was created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatch"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch/{batchId}":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/paymentBatchId"}],"get":{"operationId":"getPaymentBatch","summary":"Get a payment batch","description":"Requires the `PAYMENT_BATCH.READ` key permission.","tags":["Payment Batches"],"responses":{"200":{"description":"The batch","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatch"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"patch":{"operationId":"updatePaymentBatch","summary":"Update a payment batch","description":"Replaces the batch's name and funding method. Send both: the batch is updated whole. Requires the `PAYMENT_BATCH.UPDATE` key permission.","tags":["Payment Batches"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchRequest"}}}},"responses":{"200":{"description":"The updated batch","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatch"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"operationId":"deletePaymentBatch","summary":"Delete a payment batch","description":"Requires the `PAYMENT_BATCH.DELETE` key permission.","tags":["Payment Batches"],"responses":{"200":{"description":"The batch was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchSuccess"}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch/{batchId}/recipients":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/paymentBatchId"}],"get":{"operationId":"listPaymentBatchRecipients","summary":"List the recipients in a batch","description":"Requires the `PAYMENT_BATCH.READ` key permission.","tags":["Payment Batches"],"parameters":[{"$ref":"#/components/parameters/paymentBatchPage"},{"$ref":"#/components/parameters/paymentBatchLimit"}],"responses":{"200":{"description":"The recipients","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBatchRecipient"}},"total":{"type":"integer"},"page":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"addPaymentBatchRecipient","summary":"Add one recipient to a batch","description":"Pass `paymentMethodId` to update that saved account of the business and add it to the batch, instead of creating a new one. Requires the `PAYMENT_BATCH.UPDATE` key permission.","tags":["Payment Batches"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchRecipientRequest"}}}},"responses":{"201":{"description":"The saved account. The full recipient shape comes from the recipient list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatchRecipientSaved"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"409":{"description":"This saved account is already in the batch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch/{batchId}/recipients/bulk":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/paymentBatchId"}],"post":{"operationId":"addPaymentBatchRecipients","summary":"Add several recipients to a batch","description":"Adds each recipient independently and reports which were added. The results are keyed by account number. Requires the `PAYMENT_BATCH.UPDATE` key permission.","tags":["Payment Batches"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBatchRecipientRequest"}}}}},"responses":{"201":{"description":"Per-recipient outcomes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatchOutcomes"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch/{batchId}/recipients/{recipientId}":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/paymentBatchId"},{"name":"recipientId","in":"path","required":true,"description":"The `recipientId` returned by the recipient list.","schema":{"type":"string"}}],"patch":{"operationId":"updatePaymentBatchRecipient","summary":"Update a recipient in a batch","description":"Replaces the recipient's account details and amount. Pass `paymentMethodId` to update that saved account in place. A `recipientId` that is not in this batch is refused with `400`, not `404`. Requires the `PAYMENT_BATCH.UPDATE` key permission.","tags":["Payment Batches"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchRecipientRequest"}}}},"responses":{"200":{"description":"The saved account. The full recipient shape comes from the recipient list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatchRecipientSaved"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"operationId":"removePaymentBatchRecipient","summary":"Remove a recipient from a batch","description":"Removes the recipient from this batch only; the saved account is kept. A `recipientId` that is not in this batch is refused with `400`, not `404`. Requires the `PAYMENT_BATCH.UPDATE` key permission.","tags":["Payment Batches"],"responses":{"200":{"description":"The recipient was removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentBatchSuccess"}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch/{batchId}/withdraw":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/paymentBatchId"}],"post":{"operationId":"withdrawPaymentBatch","summary":"Start the payouts for a batch","description":"Creates a payout for every recipient in the batch in one call and records the run as a session. The payouts settle asynchronously, so a webhook callback URL must be configured. Requires the `TRANSACTION.WITHDRAW.CREATE` key permission.\n\nEach call is a new run and pays every recipient again. To retry only the payouts that failed, pass the run's `sessionId`. A call made while a run of the same batch is still in progress is refused with `409`. A batch with no recipients is refused with `400`.","tags":["Payment Batches"],"parameters":[{"name":"sessionId","in":"query","required":false,"description":"Id of an earlier run of this batch (from the sessions list). Only the recipients that failed in that run are paid. An unknown id, or one from another batch, is refused with `400`.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","minLength":24,"maxLength":24}}],"responses":{"200":{"description":"Per-recipient outcomes, keyed by `recipientId`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentBatchOutcomes"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"409":{"description":"A run of this batch is already in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/api/v1/payment-batch/{batchId}/sessions":{"parameters":[{"$ref":"#/components/parameters/x-api-version"},{"$ref":"#/components/parameters/x-api-signature"},{"$ref":"#/components/parameters/paymentBatchId"}],"get":{"operationId":"listPaymentBatchSessions","summary":"List the runs of a batch","description":"Requires the `TRANSACTION.HISTORY.READ` key permission.","tags":["Payment Batches"],"parameters":[{"$ref":"#/components/parameters/paymentBatchPage"},{"$ref":"#/components/parameters/paymentBatchLimit"}],"responses":{"200":{"description":"The batch's sessions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentBatchSession"}},"total":{"type":"integer"},"page":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/PaymentBatchBadRequest"},"401":{"$ref":"#/components/responses/PaymentBatchUnauthorized"},"404":{"$ref":"#/components/responses/PaymentBatchNotFound"},"500":{"$ref":"#/components/responses/ServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"webhooks":{"customer.events":{"post":{"operationId":"customerWebhookEvent","security":[],"servers":[{"url":"https://your-domain.com/webhook","description":"The webhook URL you configure in the dashboard"}],"summary":"Customer Events","description":"Afriex delivers real-time notifications to your configured webhook URL whenever a customer is **created**, **updated**, or **deleted**.\n\nThe payload structure is **identical** across all events. Only the `event` field changes.\n\n**Security**: Every request includes an `x-webhook-signature` header and an `x-afriex-business-id` header carrying your business id. You **must** verify this signature using Afriex's public key before processing. The key is an elliptic-curve (secp384r1 / P-384) key, not RSA. The signature is ECDSA with SHA-256, DER-encoded and then base64-encoded, computed over the exact raw request body, so verify it before parsing or re-serialising the JSON. See the [Webhooks Overview & Security](https://docs.afriex.com/api-reference/endpoint/webhooks/introduction) section for verification instructions.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique ID of this event. Every delivery attempt of the same event carries the same `id`, so use it to ignore a delivery you have already processed.","examples":["8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f"]},"event":{"type":"string","enum":["CUSTOMER.CREATED","CUSTOMER.UPDATED","CUSTOMER.DELETED"],"description":"Identifies which customer event occurred","examples":["CUSTOMER.UPDATED"]},"createdAt":{"type":"string","format":"date-time","description":"When Afriex created the event. Retries keep this value, and the signature covers it, so you can reject a delivery that is older than you expect.","examples":["2026-04-24T09:13:33.883Z"]},"data":{"type":"object","description":"The customer data relevant to this event","properties":{"customerId":{"type":"string","description":"Unique identifier of the customer","examples":["69516dd0464b2213bd74cfad"]},"name":{"type":"string","examples":["John Doe"]},"email":{"type":"string","format":"email","examples":["john.doe@example.com"]},"phone":{"type":"string","examples":["+2348121123445"],"description":"Phone number in E.164 international format"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["NG"]},"meta":{"type":"object","description":"Optional metadata attached to the customer.","additionalProperties":true},"createdAt":{"type":"string","description":"The date and time the customer was created."},"updatedAt":{"type":"string","description":"The date and time the customer was last updated."}},"required":["customerId","name","email","phone","countryCode"],"additionalProperties":false}},"required":["id","event","createdAt","data"],"additionalProperties":false},"examples":{"customerCreated":{"summary":"Customer Created","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"CUSTOMER.CREATED","createdAt":"2026-04-24T09:13:33.883Z","data":{"customerId":"69516dd0464b2213bd74cfad","name":"John Doe","email":"john.doe@example.com","phone":"+2348121123445","countryCode":"NG"}}},"customerUpdated":{"summary":"Customer Updated","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"CUSTOMER.UPDATED","createdAt":"2026-04-24T09:13:33.883Z","data":{"customerId":"69516dd0464b2213bd74cfad","name":"John Doe","email":"john.doe@example.com","phone":"+2348121123445","countryCode":"NG"}}},"customerDeleted":{"summary":"Customer Deleted","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"CUSTOMER.DELETED","createdAt":"2026-04-24T09:13:33.883Z","data":{"customerId":"69516dd0464b2213bd74cfad","name":"John Doe","email":"john.doe@example.com","phone":"+2348121123445","countryCode":"NG"}}}}}}},"responses":{"200":{"description":"Acknowledge receipt. Return any 2xx status code quickly. Response body is ignored."},"400":{"description":"Bad Request, malformed payload, invalid/missing signature, etc. Afriex will retry delivery."},"401":{"description":"Unauthorized, signature verification failed."}}}},"payment_method.events":{"post":{"operationId":"paymentMethodWebhookEvent","security":[],"servers":[{"url":"https://your-domain.com/webhook","description":"The webhook URL you configure in the dashboard"}],"summary":"Payment Method Events","description":"Afriex delivers real-time notifications to your configured webhook URL whenever a payment method is **created**, **updated**, or **deleted** for a customer.\n\nA call to `GET /api/v1/payment-method/pool-account` also sends `PAYMENT_METHOD.UPDATED` for the pool account, on every call.\n\nThe payload structure is **identical** across all events. Only the `event` field changes.\n\n**Security**: Every request includes an `x-webhook-signature` header and an `x-afriex-business-id` header carrying your business id. You **must** verify this signature using Afriex's public key before processing. The key is an elliptic-curve (secp384r1 / P-384) key, not RSA. The signature is ECDSA with SHA-256, DER-encoded and then base64-encoded, computed over the exact raw request body, so verify it before parsing or re-serialising the JSON. See the [Webhooks Overview & Security](https://docs.afriex.com/api-reference/endpoint/webhooks/introduction) section for verification instructions.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique ID of this event. Every delivery attempt of the same event carries the same `id`, so use it to ignore a delivery you have already processed.","examples":["8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f"]},"event":{"type":"string","enum":["PAYMENT_METHOD.CREATED","PAYMENT_METHOD.UPDATED","PAYMENT_METHOD.DELETED"],"description":"Identifies which payment method event occurred","examples":["PAYMENT_METHOD.UPDATED"]},"createdAt":{"type":"string","format":"date-time","description":"When Afriex created the event. Retries keep this value, and the signature covers it, so you can reject a delivery that is older than you expect.","examples":["2026-04-24T09:13:33.883Z"]},"data":{"description":"The payment method data relevant to this event, with the fields of the REST `PaymentMethod`. Unlike the REST response, `institution`, `transaction` and `recipient` carry every subfield stored with the payment method (see `PaymentMethodInstitution` and `PaymentMethodRecipient`), including `recipientIdType` and `recipientIdNumber`. Empty values (empty strings, `null` and empty objects, at every depth) are omitted, so `meta`, `institution`, `transaction` and `recipient` appear only when they carry something. CARD-channel payment methods omit accountName/accountNumber/institution and instead include card fields (last4, brand, expiration, cardName); dynamic virtual accounts may additionally include expiresInMinutes, amount, and extra.","allOf":[{"$ref":"#/components/schemas/PaymentMethod"}],"required":["paymentMethodId","channel","customerId","countryCode"]}},"required":["id","event","createdAt","data"],"additionalProperties":false},"examples":{"paymentMethodCreated":{"summary":"Payment Method Created","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"PAYMENT_METHOD.CREATED","createdAt":"2026-04-24T09:13:33.883Z","data":{"paymentMethodId":"69528259ba52c13b669fb241","channel":"BANK_ACCOUNT","customerId":"69528240ba52c13b669fb239","institution":{"institutionName":"United Bank for Africa"},"accountName":"John Doe","accountNumber":"0123456789","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"}}},"paymentMethodUpdated":{"summary":"Payment Method Updated","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"PAYMENT_METHOD.UPDATED","createdAt":"2026-04-24T09:13:33.883Z","data":{"paymentMethodId":"69528259ba52c13b669fb241","channel":"BANK_ACCOUNT","customerId":"69528240ba52c13b669fb239","institution":{"institutionName":"United Bank for Africa"},"accountName":"John Doe","accountNumber":"0123456789","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"}}},"paymentMethodDeleted":{"summary":"Payment Method Deleted","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"PAYMENT_METHOD.DELETED","createdAt":"2026-04-24T09:13:33.883Z","data":{"paymentMethodId":"69528259ba52c13b669fb241","channel":"BANK_ACCOUNT","customerId":"69528240ba52c13b669fb239","institution":{"institutionName":"United Bank for Africa"},"accountName":"John Doe","accountNumber":"0123456789","countryCode":"NG","currency":"NGN","capabilities":["WITHDRAW"],"status":"active"}}}}}}},"responses":{"200":{"description":"Acknowledge receipt. Return any 2xx status code quickly. Response body is ignored."},"400":{"description":"Bad Request, malformed payload, invalid/missing signature, etc. Afriex will retry delivery."},"401":{"description":"Unauthorized, signature verification failed."}}}},"transaction.events":{"post":{"operationId":"transactionWebhookEvent","security":[],"servers":[{"url":"https://your-domain.com/webhook","description":"The webhook URL you configure in the dashboard"}],"summary":"Transaction Events","description":"Afriex sends real-time webhook notifications to your configured URL whenever a transaction is **created** or **updated**.\n\n- `TRANSACTION.CREATED`: Fired when a new transaction is initiated.\n- `TRANSACTION.UPDATED`: Fired when the transaction status or other fields change (most commonly `status` and `updatedAt`).\n\nThe payload structure is **identical** for both events. Only the `event` field and potentially `status` + `updatedAt` differ.\n\n**Security**: Every request includes an `x-webhook-signature` header and an `x-afriex-business-id` header carrying your business id. You **must** verify this signature using Afriex's public key before processing. The key is an elliptic-curve (secp384r1 / P-384) key, not RSA. The signature is ECDSA with SHA-256, DER-encoded and then base64-encoded, computed over the exact raw request body, so verify it before parsing or re-serialising the JSON. See the [Webhooks Overview & Security](https://docs.afriex.com/api-reference/endpoint/webhooks/introduction) section for verification instructions.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique ID of this event. Every delivery attempt of the same event carries the same `id`, so use it to ignore a delivery you have already processed.","examples":["8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f"]},"event":{"type":"string","enum":["TRANSACTION.CREATED","TRANSACTION.UPDATED"],"description":"Identifies which transaction event occurred","examples":["TRANSACTION.UPDATED"]},"createdAt":{"type":"string","format":"date-time","description":"When Afriex created the event. Retries keep this value, and the signature covers it, so you can reject a delivery that is older than you expect.","examples":["2026-04-24T09:13:33.883Z"]},"data":{"type":"object","description":"Details of the transaction","properties":{"status":{"$ref":"#/components/schemas/TransactionStatus"},"type":{"type":"string","description":"Type/direction of the transaction","enum":["DEPOSIT","WITHDRAW","SWAP"],"examples":["WITHDRAW"]},"channel":{"type":"string","enum":["BANK_ACCOUNT","SWIFT","MOBILE_MONEY","UPI","INTERAC","WE_CHAT","CARD","CRYPTO","VIRTUAL_BANK_ACCOUNT","POOL_ACCOUNT","ACH_BANK_ACCOUNT","PAYBILL_TILL","RFP","VIRTUAL_CARD","ALIPAY","WALLET","PAYMENT_LINQ","ADMIN"],"description":"Payment channel of the transaction. `ADMIN` marks an adjustment Afriex made to your wallet; `PAYMENT_LINQ` a payment made through a payment link.","examples":["BANK_ACCOUNT"]},"sourceAmount":{"type":"string","description":"Amount in source currency (string for precision)","examples":["3.316587998"]},"sourceCurrency":{"type":"string","description":"ISO 4217 source currency code","examples":["USD"]},"destinationAmount":{"type":"string","description":"Amount in destination currency (string)","examples":["5000"]},"destinationCurrency":{"type":"string","description":"ISO 4217 destination currency code","examples":["NGN"]},"sourceId":{"type":"string","description":"ID of the source payment method (e.g. for deposits)","examples":["695271a3ba52c13b669fad2b"]},"destinationId":{"type":"string","description":"ID of the destination (e.g. payment method ID for withdraws)","examples":["695271a3ba52c13b669fad2b"]},"customerId":{"type":"string","description":"ID of the customer who owns this transaction","examples":["69528240ba52c13b669fb239"]},"transactionId":{"type":"string","description":"Unique identifier of the transaction","examples":["6952826eba52c13b669fb263"]},"merchantReference":{"type":"string","description":"The merchant-supplied reference (mirrors meta.reference from the create request).","examples":["order-12345"]},"rate":{"type":"string","description":"The realized source-to-destination exchange rate, expressed as `1 sourceCurrency = rate destinationCurrency`. Same field as on the Transaction response."},"fee":{"type":"string","description":"The fee charged, denominated in `sourceCurrency`. Omitted when no fee applied."},"meta":{"description":"Additional transaction metadata, the same shape as the REST `Transaction.meta`. `narration` is always present (an empty string when none was given). `invoice`, `idempotencyKey`, `reference` and `settlement` appear only when the merchant supplied them on create. `otpRequired` appears only on deposits that may need an extra authorization step, and `failureReason` only when `status` is `FAILED` or `REJECTED`.","allOf":[{"$ref":"#/components/schemas/Transaction/properties/meta"},{"type":"object","properties":{"invoice":{"type":"string","description":"The invoice key you supplied on create."},"idempotencyKey":{"type":"string","description":"The idempotency key you supplied on create."},"reference":{"type":"string","description":"The reference you supplied on create."},"settlement":{"type":"string","enum":["spot","request"],"description":"The settlement you supplied on create."}}}]},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the transaction was created","examples":["2025-12-29T13:30:22.554Z"]},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last update","examples":["2025-12-29T13:30:22.554Z"]}},"required":["status","type","sourceAmount","sourceCurrency","destinationAmount","destinationCurrency","customerId","transactionId","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","event","createdAt","data"],"additionalProperties":false},"examples":{"transactionCreated":{"summary":"Transaction Created","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"TRANSACTION.CREATED","createdAt":"2026-04-24T09:13:33.883Z","data":{"status":"PENDING","type":"WITHDRAW","channel":"BANK_ACCOUNT","sourceAmount":"3.316587998","sourceCurrency":"USD","destinationAmount":"5000","destinationCurrency":"NGN","destinationId":"695271a3ba52c13b669fad2b","customerId":"69528240ba52c13b669fb239","transactionId":"6952826eba52c13b669fb263","meta":{"narration":""},"createdAt":"2025-12-29T13:30:22.554Z","updatedAt":"2025-12-29T13:30:22.554Z"}}},"transactionUpdated":{"summary":"Transaction Updated (status changed)","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"TRANSACTION.UPDATED","createdAt":"2026-04-24T09:13:33.883Z","data":{"status":"SUCCESS","type":"WITHDRAW","channel":"BANK_ACCOUNT","sourceAmount":"3.316587998","sourceCurrency":"USD","destinationAmount":"5000","destinationCurrency":"NGN","destinationId":"695271a3ba52c13b669fad2b","customerId":"69528240ba52c13b669fb239","transactionId":"6952826eba52c13b669fb263","meta":{"narration":""},"createdAt":"2025-12-29T13:30:22.554Z","updatedAt":"2025-12-29T13:45:10.123Z"}}}}}}},"responses":{"200":{"description":"Acknowledge receipt. Return any 2xx status code quickly. Response body is ignored."},"400":{"description":"Bad Request, malformed payload, invalid/missing signature, etc. Afriex will retry delivery."},"401":{"description":"Unauthorized, signature verification failed."}}}},"pool_deposit_request.events":{"post":{"operationId":"poolDepositRequestWebhookEvent","security":[],"servers":[{"url":"https://your-domain.com/webhook","description":"The webhook URL you configure in the dashboard"}],"summary":"Pool Deposit Events","description":"Afriex delivers a webhook to your configured URL when a pool account deposit you submitted is rejected during review.\n\nSubmitting proof through `POST /api/v1/transaction/pool-account` creates a transaction in `IN_REVIEW`. An operator then confirms or rejects the inflow: approval surfaces as `TRANSACTION.CREATED`, rejection surfaces here. This event cannot be fired from `POST /api/v1/webhooks/trigger`.\n\n**Security**: Every request includes an `x-webhook-signature` header and an `x-afriex-business-id` header carrying your business id. You **must** verify this signature using Afriex's public key before processing. The key is an elliptic-curve (secp384r1 / P-384) key, not RSA. The signature is ECDSA with SHA-256, DER-encoded and then base64-encoded, computed over the exact raw request body, so verify it before parsing or re-serialising the JSON. See the [Webhooks Overview & Security](https://docs.afriex.com/api-reference/endpoint/webhooks/introduction) section for verification instructions.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique ID of this event. Every delivery attempt of the same event carries the same `id`, so use it to ignore a delivery you have already processed.","examples":["8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f"]},"event":{"type":"string","enum":["POOL_DEPOSIT_REQUEST.REJECTED"],"description":"Identifies which pool deposit event occurred","examples":["POOL_DEPOSIT_REQUEST.REJECTED"]},"createdAt":{"type":"string","format":"date-time","description":"When Afriex created the event. Retries keep this value, and the signature covers it, so you can reject a delivery that is older than you expect.","examples":["2026-04-24T09:13:33.883Z"]},"data":{"type":"object","description":"Details of the rejected pool deposit. A flat, purpose-built shape rather than the full transaction object. Fetch the transaction with `GET /api/v1/transaction/{transactionId}` if you need the rest of it.","required":["transactionId","reference","rejectionReason","resubmissionRequired"],"properties":{"transactionId":{"type":"string","description":"The transaction created by your proof submission, the one that was reviewed and rejected","examples":["69528240ba52c13b669fb239"]},"reference":{"type":"string","description":"The reference you supplied on the submission","examples":["pool-account-reference"]},"amount":{"type":"number","description":"The deposit amount. Omitted when the transaction carries no destination amount.","examples":[5000]},"currency":{"type":"string","description":"ISO 4217 currency code. Omitted when the transaction carries no destination amount.","examples":["NGN"]},"rejectionReason":{"type":"string","description":"Free-text reason entered by the reviewer. Surface it to your operator; do not branch on its contents.","examples":["Sender name does not match the submitted proof"]},"resubmissionRequired":{"type":"boolean","description":"`true` when you can correct the submission and send fresh proof, `false` when the rejection is final.","examples":[true]}}}},"required":["id","event","createdAt","data"]},"examples":{"rejected":{"summary":"Pool deposit rejected, resubmission allowed","value":{"id":"8f14e45f-ceea-4e7a-9f1d-6b1c2a3d4e5f","event":"POOL_DEPOSIT_REQUEST.REJECTED","createdAt":"2026-04-24T09:13:33.883Z","data":{"transactionId":"69528240ba52c13b669fb239","reference":"pool-account-reference","amount":5000,"currency":"NGN","rejectionReason":"Sender name does not match the submitted proof","resubmissionRequired":true}}}}}}},"responses":{"200":{"description":"Acknowledge receipt. Return any 2xx status code quickly. Response body is ignored."},"400":{"description":"Bad Request, malformed payload, invalid/missing signature, etc. Afriex will retry delivery."},"401":{"description":"Unauthorized, signature verification failed."}}}}},"tags":[{"name":"Balance","description":"View your business wallet balances."},{"name":"Checkout Sessions","description":"Create hosted checkout sessions."},{"name":"Rates","description":"Fetch real-time exchange rates."},{"name":"Customers","description":"Create and manage your customers."},{"name":"Payment Methods","description":"Register and resolve customer payout and collection methods."},{"name":"Media","description":"Generate presigned URLs for secure file uploads."},{"name":"Transactions","description":"Create and track deposits, withdrawals, and swaps."},{"name":"Payment Batches","description":"Manage payment batches, their recipients and their runs.\n\nWhere payload signing is enabled for your business, sign the JSON of the request body for POST and PATCH routes that take one. For GET routes with `page` and `limit`, and for the withdraw route, sign the query parameters as the server reads them, with defaults applied: a list call with no parameters signs `{\"limit\":100,\"page\":0}` and a withdraw with no `sessionId` signs `{}`. For the remaining routes (get, delete and remove-recipient) sign the path parameters, e.g. `{\"batchId\":\"...\"}`."},{"name":"SME Registration","description":"Register your business as an SME so its virtual accounts are issued under its own legal entity."},{"name":"Sandbox helpers","description":"Sandbox-only endpoints for testing: top up your balance, complete a transaction, pay into a virtual account, and send yourself a webhook."},{"name":"Webhooks","description":"Webhook event payloads."}]}