Skip to main content
POST
/
api
/
v1
/
transaction
curl --request POST \
  --url https://sandbox.api.afriex.com/api/v1/transaction \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "customerId": "69528240ba52c13b669fb239",
  "type": "WITHDRAW",
  "sourceAmount": "10",
  "destinationAmount": 5000,
  "sourceCurrency": "USD",
  "destinationCurrency": "NGN",
  "destinationId": "690df3281c11eea59108fcaf",
  "meta": {
    "reference": "ref-withdraw-001",
    "idempotencyKey": "idem-withdraw-001"
  }
}
'
{
  "data": {
    "status": "PENDING",
    "type": "WITHDRAW",
    "sourceAmount": "3.28847",
    "sourceCurrency": "USD",
    "destinationAmount": "5000",
    "destinationCurrency": "NGN",
    "destinationId": "690df3281c11eea59108fcaf",
    "customerId": "69528240ba52c13b669fb239",
    "transactionId": "69d60071ab82306f11b03393",
    "meta": {
      "reference": "ref-withdraw-001",
      "idempotencyKey": "idem-withdraw-001"
    },
    "createdAt": "2026-04-08T07:14:57.444Z",
    "updatedAt": "2026-04-08T07:14:57.444Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.afriex.com/llms.txt

Use this file to discover all available pages before exploring further.

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 only sourceAmount, sourceCurrency, destinationCurrency, and meta. The API calculates the actual destinationAmount at the live exchange rate.).

Authorizations

x-api-key
string
header
required

Static business API key from the dashboard

Body

application/json
destinationAmount
number<string>
required

The transaction amount in the destination currency.

Example:

"100.50"

destinationCurrency
string
required

The 3-letter ISO 4217 currency code of the destination currency (e.g., USD, NGN).

Example:

"USD"

sourceCurrency
string
required

The 3-letter ISO 4217 currency code of the source currency (e.g., USD, NGN).

Example:

"NGN"

meta
object
required

Optional meta data you can attach to the transaction.

customerId
string

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.

Example:

"69528240ba52c13b669fb239"

type
enum<string>

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 only sourceAmount, sourceCurrency, destinationCurrency, and meta — the API calculates the actual destinationAmount at the live exchange rate). If omitted, defaults to WITHDRAW.

Available options:
DEPOSIT,
WITHDRAW,
SWAP
sourceAmount
number<string>

The transaction amount in the source currency.

Example:

"100.50"

destinationId
string

Required for WITHDRAW transactions. The id of the destination payment method that money will be sent to.

Example:

"690df3281c11eea59108fcaf"

sourceId
string

Required for DEPOSIT transactions. The id of the source payment method that money will be pulled from.

Example:

"690df3281c11eea59108fcaf"

Response

Transaction created successfully.

data
object