Skip to main content
This page documents the key data models returned and accepted by the API, including all enumerated values and field-level details.

Customer

On create and update requests, supply the customer’s full name as fullName; responses return it as name. KYC details are submitted separately through the Update KYC endpoint.

Transaction

Transaction Types

Transaction Channels

Transaction Statuses

Subscribe to Transaction Events to receive real-time status updates instead of polling the API.

TransactionMeta

The meta object passed when creating a transaction. idempotencyKey and reference are required.
Always provide a unique idempotencyKey per transaction attempt. If you retry a failed request with the same key, Afriex will return the original transaction instead of creating a duplicate.

Server-set meta fields

Afriex also sets fields on meta after the transaction is created. These echo alongside any fields you passed on create.

Failure reasons

When a transaction reaches FAILED or REJECTED, meta.failureReason explains why using 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.
The AFX_* set may grow over time as new failure modes are surfaced. Existing values will not change meaning. Handle unknown codes by falling back to message.

PaymentMethod

Empty fields are omitted from responses. Account-shaped channels (BANK_ACCOUNT, MOBILE_MONEY, SWIFT, etc.) populate accountName, accountNumber, and institution; the CARD channel instead populates last4, brand, expiration, and cardName.

Payment Channels

Not every channel is valid when creating a payment method. The Create Payment Method endpoint accepts a narrower set of channels; the list above covers all channels that can appear on a returned payment method.

Payment Method Statuses


PaymentMethodRecipient

Recipient contact details attached to a payment method, when supplied.

PaymentMethodTransaction

Optional per-transaction details attached to a payment method.

PaymentMethodInstitution

Use the List Institutions endpoint to retrieve valid institutions for a given country and channel.
On Create Transaction, correspondentBankName and correspondentBankAccountNumber can also be passed at the top level as a fallback when the destination payment method lacks them (USD WITHDRAW with meta.settlement: "request"). The values stored on the payment method take precedence; the two fields must be supplied together.

Error Response

All API errors return a consistent JSON body:

Common error codes