Skip to main content
GET
Afriex SDK
An empty result is a 200 with data: [], not a 404. Virtual accounts are available in NGN, GHS, KES, and USD. See Create Virtual Account for which currencies your customers can hold and which are business-only. They also work in sandbox, where you fund them with Simulate Virtual Account Transfer.
Want to see virtual accounts in action? Learn how to build payment links using them: https://dev.to/afriex/send-a-link-get-paid-building-payment-links-with-afriex-13ak

Breaking change from earlier versions

Previously this endpoint returned a single virtual account and would create one on the fly when none existed. It now returns a list and never creates. The behaviour has been split into three explicit endpoints: If you were relying on the get-or-create behaviour, call GET first; when data is empty, follow up with POST to create one.

Virtual accounts are for end customers

Virtual accounts are designed for your customers as end users, meaning the people your business is acting on behalf of. Each virtual account is linked to a customerId (or to the business owner if no customerId is provided). Payments received into a virtual account are attributed to the associated customer in your Afriex system. Make sure you have created a Customer record before listing or creating virtual accounts for that person. See Create Customer.

Authorizations

x-api-key
string
header
required

Static business API key issued from the dashboard. A business can provision multiple API keys, each scoped to a configurable set of permissions (e.g. read transactions, create deposits, etc). Permissions are chosen per key at creation time in the dashboard and may be revoked by deleting the key. Manage your keys and their permissions under Developer → API keys in the dashboard.

A request whose key does not carry the permission the target endpoint requires is rejected with 401 Unauthorized, the same response an unrecognised, malformed, revoked or disabled key returns. The API does not distinguish the two cases on the wire.

See the Permissions reference for the permission each endpoint requires.

Headers

x-api-version
string

API version in ISO 8601 format. The only supported version is 2026-05-18, which is also the default when the header is omitted. Any other value is rejected with a 400 Bad Request.

x-api-signature
string

Signature of the request payload, used for request authentication where payload signing is enabled for your business.

Query Parameters

currency
enum<string>
required

The 3-letter ISO 4217 currency code for the virtual account. The listed values are the supported currencies; other valid currency codes pass validation and simply return an empty list.

Available options:
NGN,
GHS,
KES,
USD
customerId
string

Optional customer ID. When supplied, the lookup is scoped to that customer. When omitted, it resolves to the business owner.

country
string

Optional ISO 3166-1 alpha-2 country code.

amount
number

Optional positive amount.

reference
string

Optional merchant-supplied reference.

Response

Virtual accounts retrieved successfully (possibly empty list).

data
object[]
total
integer

Number of items in data.

page
integer

Page index. Currently always 0, the endpoint returns all matching VAs in a single response.