Get Pool Account - Afriex Business API

Afriex SDK

TypeScript

const poolAccount = await afriex.paymentMethods.listPoolAccounts({
  customerId: "customer-id",
  country: "NG",
});
curl --request GET \
  --url https://sandbox.api.afriex.com/api/v1/payment-method/pool-account \
  --header 'x-api-key: <api-key>'
import requests

url = "https://sandbox.api.afriex.com/api/v1/payment-method/pool-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/pool-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/pool-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/pool-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/pool-account")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.api.afriex.com/api/v1/payment-method/pool-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

Response Data

200

{
  "data": {
    "paymentMethodId": "69c2804b30314b491e48b305",
    "channel": "VIRTUAL_BANK_ACCOUNT",
    "customerId": "6929843e2c4653277440acc0",
    "reference": "6929843e2c4653277440acc0",
    "institution": {
      "institutionName": "UBA"
    },
    "accountName": "TEST",
    "accountNumber": "12345678",
    "countryCode": "NG"
  }
}

Description

Returns the business’s pool account for a given country. A pool account is a shared, Afriex-managed account that customers pay into; Afriex reconciles incoming funds to the merchant using the reference returned on this response. Important: Pool accounts are only active in production and do not work on staging/dev.

How the call works

  1. Call this endpoint with country (required). Optionally pass customerId to scope the response to a specific end-user.
  2. Afriex returns the pool account (account name, account number, institution) as a PaymentMethod, along with a reference.
  3. Share the account details with your customer so they can pay in. When Afriex receives the inbound funds, it uses the reference to attribute the deposit on your account.

The reference field

Every response includes a reference string. Persist it alongside the deposit you expect and use it to reconcile incoming pool deposits. When you pass a customerId, the response reference matches it, so the deposit can be attributed back to that customer on your side.

Currency is derived from country

Unlike dedicated virtual accounts, this endpoint does not take a currency parameter. The currency is determined by the country code (for example, NG resolves to NGN). Pool accounts are only available in countries where Afriex operates a pool; an unsupported country code returns a 400.

Authorizations

Query Parameters

Response

200

application/json

Pool account returned successfully.