Transactions

Create a new transaction

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.

post/api/v1/transaction

Request

Request body

OR
OR

Example request

{
  "customerId": "69528240ba52c13b669fb239",
  "destinationCurrency": "USD",
  "sourceCurrency": "NGN",
  "destinationId": "690df3281c11eea59108fcaf",
  "sourceId": "690df3281c11eea59108fcaf"
}

Response

Transaction created successfully.

Example response

{
  "data": {
    "meta": {
      "failureReason": {
        "code": "AFX_VELOCITY_LIMIT_EXCEEDED"
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.