const response = await afriex.paymentMethods.listVirtualAccounts({
customerId: "customer-id",
currency: "USD",
});curl --request GET \
--url https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account \
--header 'x-api-key: <api-key>'import requests
url = "https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"paymentMethodId": "690cc5bbe2a1143ff6070119",
"channel": "VIRTUAL_BANK_ACCOUNT",
"customerId": "68e6717848e1f632e9686460",
"institution": {
"institutionName": "FIDELITY BANK"
},
"accountName": "John Doe",
"accountNumber": "0123456781",
"countryCode": "NG",
"currency": "NGN",
"capabilities": [
"DEPOSIT"
],
"status": "active"
},
{
"paymentMethodId": "690cc5bbe2a1143ff607011a",
"channel": "VIRTUAL_BANK_ACCOUNT",
"customerId": "68e6717848e1f632e9686460",
"institution": {
"institutionName": "FIDELITY BANK"
},
"accountName": "John Doe (Sales)",
"accountNumber": "0123456782",
"countryCode": "NG",
"currency": "NGN",
"capabilities": [
"DEPOSIT"
],
"status": "active"
}
],
"total": 2,
"page": 0
}List Virtual Accounts
Returns every active virtual account for the resolved
customer-or-owner and currency. Read-only: when no virtual account
exists, the response is 200 with data: [].
Pass customerId to scope the list to a specific end-user; omit it
to list the virtual accounts belonging to the business owner.
Breaking change from earlier versions: the previous endpoint
returned a single virtual account and would create one on the fly
when absent. It now returns a list and never creates. The create
path lives at POST /api/v1/payment-method/virtual-account; the
POOL_ACCOUNT variant has moved to
GET /api/v1/payment-method/pool-account.
const response = await afriex.paymentMethods.listVirtualAccounts({
customerId: "customer-id",
currency: "USD",
});curl --request GET \
--url https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account \
--header 'x-api-key: <api-key>'import requests
url = "https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/payment-method/virtual-account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"paymentMethodId": "690cc5bbe2a1143ff6070119",
"channel": "VIRTUAL_BANK_ACCOUNT",
"customerId": "68e6717848e1f632e9686460",
"institution": {
"institutionName": "FIDELITY BANK"
},
"accountName": "John Doe",
"accountNumber": "0123456781",
"countryCode": "NG",
"currency": "NGN",
"capabilities": [
"DEPOSIT"
],
"status": "active"
},
{
"paymentMethodId": "690cc5bbe2a1143ff607011a",
"channel": "VIRTUAL_BANK_ACCOUNT",
"customerId": "68e6717848e1f632e9686460",
"institution": {
"institutionName": "FIDELITY BANK"
},
"accountName": "John Doe (Sales)",
"accountNumber": "0123456782",
"countryCode": "NG",
"currency": "NGN",
"capabilities": [
"DEPOSIT"
],
"status": "active"
}
],
"total": 2,
"page": 0
}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.
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:| Endpoint | What it does |
|---|---|
GET /api/v1/payment-method/virtual-account | Lists existing virtual accounts (this page). Read-only. |
POST /api/v1/payment-method/virtual-account | Creates a new virtual account. See Create Virtual Account. |
GET /api/v1/payment-method/pool-account | Returns the business pool account for a country. Use the reference on the response to reconcile incoming deposits. See Get Pool Account. |
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 acustomerId (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
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
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.
Signature of the request payload, used for request authentication where payload signing is enabled for your business.
Query Parameters
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.
NGN, GHS, KES, USD Optional customer ID. When supplied, the lookup is scoped to that customer. When omitted, it resolves to the business owner.
Optional ISO 3166-1 alpha-2 country code.
Optional positive amount.
Optional merchant-supplied reference.
