Subaccount onboarding
Create and activate a connected subaccount, and grant it capabilities.
6 min read
Before it can be used, a subaccount goes through a short lifecycle.
Lifecycle
| Status | Meaning |
|---|---|
pending | Created, not yet active. |
active | Can be operated via X-Sync. |
cancelled | Deactivated. |
expired | No longer usable. |
There is no separate restricted/disabled intermediate state — a subaccount is
pending, active, or terminal (cancelled/expired).
Create a subaccount
POST
https://api.wajub.com/accountscurl https://api.wajub.com/accounts \
-H "Authorization: sk.xxxx" \
-d '{
"reference": "shop-amina",
"capabilities": ["read", "payments", "refunds"],
"pricing": { "percentage_fee": 2.5, "currency": "XAF" },
"callback": "https://example.com/sync-webhooks"
}'Response
{
"status": "Created",
"code": 201,
"account": { "id": "acc_7Yh2Mp", "reference": "shop-amina", "status": "pending" }
}Regenerate the account token
Each subaccount has a token you can rotate if it's ever exposed:
curl -X POST https://api.wajub.com/accounts/acc_7Yh2Mp/token -H "Authorization: sk.xxxx"Webhook events
Listen for account.created, account.updated, account.deauthorized,
account.payment_activated, and account.payment_suspended to track a subaccount's lifecycle and
its capacity to transact.
Was this page helpful?