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

You can create DEPOSIT, WITHDRAW, and SWAP. Handle the other values when you read transactions back.

Transaction Channels

You don’t send WALLET, PAYMENT_LINQ, or ADMIN. They can appear on transactions you read, so handle them when you list transactions.

Transaction Statuses

IN_REVIEW and RFI_REQUESTED are review states: the transaction is still in flight and waiting on a review, not on you. Treat them as non-terminal and keep listening, rather than classifying them as failures.More generally, handle unrecognised statuses as non-terminal rather than failed. New values can be added, and existing ones do not change meaning.
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 a transaction with the same key (or the same reference) already exists or is still being processed, Afriex rejects the request with 409 DUPLICATE_REQUEST instead of creating a duplicate. Look up the original with List Transactions. A request that was rejected with 429 never created a transaction, so you can retry it with the same key. See Idempotency for how to recover after a timeout.

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. A payment method returns only the four fields above. These are accepted when you create one but are not returned on it:

PaymentMethodTransaction

Optional per-transaction details attached to a payment method.

PaymentMethodInstitution

A payment method returns only the fields above. These are accepted when you create one but are not returned on it: Use the List Institutions endpoint to retrieve valid institutions for a given country and channel.

PaymentMethodBankAddress

The postal address of the issuing bank, not the account holder. Populated per account by the provider that provisioned it, so it is present on virtual accounts and other account-shaped payment methods whose provider supplies it, and omitted otherwise.
This is the address to quote as the beneficiary bank when originating an international wire into a virtual account.
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.

PaymentBatch

A saved group of payout recipients funded from one wallet. Add recipients over time, then trigger the payouts in one call with Withdraw Batch. Each execution is recorded as a session.
The list endpoint returns a lighter shape (id, name, meta) without the full sourcePaymentMethod; call Get Payment Batch for the full record.

PaymentBatchRecipient

A recipient inside a batch: a payout target with a fixed amount for each run.

PaymentBatchSession

A single execution of Withdraw Batch. Each session records the recipient outcomes for that run. Bulk operations (bulk add recipients, withdraw) return a PaymentBatchOutcomes shape with successes and errors keyed by account number: each entry is either the created object or the reason it failed. Use this to reconcile which items landed.

Error Response

All API errors return a consistent JSON body:

Common error codes

There is no generic NOT_FOUND code. Missing resources return a specific code naming the resource, as above.