Skip to main content
GET
/
api
/
v1
/
payment-method
/
virtual-account
List existing virtual accounts
curl --request GET \
  --url https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account \
  --header 'x-api-key: <api-key>'
{
  "data": [
    {
      "paymentMethodId": "690cc5bbe2a1143ff6070119",
      "channel": "VIRTUAL_BANK_ACCOUNT",
      "customerId": "68e6717848e1f632e9686460",
      "institution": {
        "institutionName": "FIDELITY BANK"
      },
      "accountName": "Lily New",
      "accountNumber": "3820404958",
      "countryCode": "NG"
    },
    {
      "paymentMethodId": "690cc5bbe2a1143ff607011a",
      "channel": "VIRTUAL_BANK_ACCOUNT",
      "customerId": "68e6717848e1f632e9686460",
      "institution": {
        "institutionName": "FIDELITY BANK"
      },
      "accountName": "Lily New (Sales)",
      "accountNumber": "3820404971",
      "countryCode": "NG"
    }
  ],
  "total": 2,
  "page": 0
}

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.

Returns every active virtual account for the resolved customer-or-owner and currency. The endpoint is read-only: when no virtual account exists, you get a 200 response with data: [] rather than a 404. Pass customerId to scope the list to a specific end-user. Omit it to list virtual accounts that belong to the business owner. Important: Virtual accounts are only active in production and do not work on staging/dev.
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:
EndpointWhat it does
GET /api/v1/payment-method/virtual-accountLists existing virtual accounts (this page). Read-only.
POST /api/v1/payment-method/virtual-accountCreates a new virtual account. See Create Virtual Account.
GET /api/v1/payment-method/pool-accountReturns the business pool account for a country. Use the reference on the response to reconcile incoming deposits. See Get Pool Account.
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 from the dashboard

Query Parameters

currency
enum<string>
required

The 3-letter ISO 4217 currency code for the virtual account.

Available options:
USD,
NGN,
GBP,
EUR
customerId
string

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

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 virtual accounts in a single response.