API ReferenceSubaccounts

Subaccounts

Subaccounts let you split payments between your platform and the merchants or sellers on it. They are the foundation of marketplace and multi-vendor payment flows — each subaccount maps to a business that has its own settlement bank account and percentage of every charge.

Provider support

Subaccounts are currently supported by Paystack (primary) and Flutterwave. You must have at least one of these providers configured under Provider Keys before creating a subaccount.

Endpoints

POST/v1/subaccounts
GET/v1/subaccounts
GET/v1/subaccounts/:id

Create a Subaccount

Registers a new subaccount with the provider and stores the returned subaccount code against your merchant record. The subaccount code is used when routing a payment split.

POST
/v1/subaccounts

Creates a subaccount for a business and returns the provider-assigned subaccount code.

Request body

ParameterTypeRequiredDescription
business_namestringRequiredTrading or legal name of the sub-merchant.
settlement_bankstringRequiredCBN bank code for the settlement account (e.g. "058" for GTBank).
account_numberstringRequired10-digit NUBAN bank account number belonging to the sub-merchant.
percentage_chargenumberOptionalPercentage of each charge to credit to this subaccount. Value between 0 and 100. Defaults to 0.
descriptionstringOptionalA short description of the subaccount or the business.
primary_contact_emailstringOptionalEmail address of the primary contact for this subaccount.
primary_contact_namestringOptionalFull name of the primary contact.
primary_contact_phonestringOptionalPhone number of the primary contact (international format recommended).
provider_idstringOptionalForce a specific provider: paystack, flutterwave. Omit to use your default configured provider.
Example requestbash
curl -X POST https://api.popfab.io/v1/subaccounts \
  -H "Authorization: Bearer sk_test_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "business_name": "Ada Stores",
    "settlement_bank": "058",
    "account_number": "0123456789",
    "percentage_charge": 20,
    "description": "Online fashion retailer",
    "primary_contact_email": "ada@adastores.com",
    "primary_contact_name": "Ada Okafor",
    "primary_contact_phone": "+2348011223344"
  }'
201 Created — Subaccount objectjson
{
  "provider_subaccount_code": "ACCT_xyz123",
  "business_name": "Ada Stores",
  "settlement_bank": "058",
  "account_number": "0123456789",
  "percentage_charge": 20,
  "active": true
}
To split a payment to a subaccount, include the subaccount_code in your payment request's metadata and configure a routing rule to apply it, or use the routing_override field.

List Subaccounts

GET
/v1/subaccounts

Returns a cursor-paginated list of your subaccounts, newest first.

Query parameters

ParameterTypeRequiredDescription
limitintegerOptionalResults per page. Default 20, max 100.
cursorstringOptionalPagination cursor from a previous response next_cursor field.
List subaccountsbash
curl "https://api.popfab.io/v1/subaccounts?limit=50" \
  -H "Authorization: Bearer sk_test_YOUR_API_KEY"

Get a Subaccount

GET
/v1/subaccounts/:id

Retrieves a single subaccount by its POPFAB ID.

Get subaccount by IDbash
curl https://api.popfab.io/v1/subaccounts/ppfb_sub_01HXA3KBZQM4Z3YWN5E6R7VP8S \
  -H "Authorization: Bearer sk_test_YOUR_API_KEY"

Provider Capability

ProviderCreateListSplit Payments
Paystack
Flutterwave
Monnify
Squad
Interswitch