Skip to Content
APITransactions

Transactions API

Create and manage money transfer transactions.

Create Transaction

const transaction = await afriex.transactions.create({ customerId: 'customer-id', destinationAmount: 10000, destinationCurrency: 'NGN', sourceCurrency: 'USD', destinationId: 'payment-method-id', meta: { narration: 'Payment for services', invoice: 'INV-001', idempotencyKey: 'unique-key-123' } });

Request Parameters:

FieldTypeRequiredDescription
customerIdstringID of the customer
destinationAmountnumberAmount to send
destinationCurrencystringTarget currency (e.g., NGN)
sourceCurrencystringSource currency (e.g., USD)
destinationIdstringPayment method ID to send to
meta.narrationstring-Transaction description
meta.invoicestring-Invoice reference
meta.idempotencyKeystring-Unique key for idempotency

Get Transaction

const transaction = await afriex.transactions.get('transaction-id');

List Transactions

const response = await afriex.transactions.list({ page: 1, limit: 20 }); console.log(response.data); // Transaction[]

Transaction Status

Transactions can have the following statuses:

StatusDescription
PENDINGTransaction created, awaiting processing
PROCESSINGTransaction is being processed
COMPLETEDTransaction completed successfully
SUCCESSTransaction successful
FAILEDTransaction failed
CANCELLEDTransaction was cancelled
REFUNDEDTransaction was refunded
RETRYTransaction is being retried
REJECTEDTransaction was rejected
IN_REVIEWTransaction is under review
Last updated on