Skip to main content
POST
/
api
/
v1
/
transaction
Create a new transaction
curl --request POST \
  --url https://staging.afx-server.com/api/v1/transaction \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "customerId": "<string>",
  "destinationAmount": "100.50",
  "destinationCurrency": "USD",
  "sourceCurrency": "NGN",
  "destinationId": "690df3281c11eea59108fcaf",
  "meta": {
    "merchantId": "<string>",
    "narration": "<string>",
    "invoice": "<string>",
    "idempotencyKey": "<string>"
  }
}
'
{
  "data": {
    "transactionId": "<string>",
    "customerId": "<string>",
    "destinationId": "<string>",
    "sourceAmount": "<string>",
    "sourceCurrency": "<string>",
    "destinationAmount": "<string>",
    "destinationCurrency": "<string>",
    "type": "WITHDRAWAL",
    "status": "<string>",
    "meta": {},
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
}
Create a new transaction to process a payment for a customer. Supports deposits and withdrawals.

Authorizations

x-api-key
string
header
required

Static business API key from the dashboard

Body

application/json
customerId
string
required

The unique identifier of the customer.

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"

destinationId
string
required

The id of the destination payment method that money will be sent to.

Example:

"690df3281c11eea59108fcaf"

meta
object

Optional meta data you can attach to the transaction.

Response

Transaction created successfully.

data
object