Understanding Your Wallet Structure
NextAPI uses a hierarchical wallet structure to organize and isolate funds across your platform.
Wallet Hierarchy
Partner (You)
├── Merchant 1
│ ├── Account A (Operating)
│ └── Account B (Reserve)
├── Merchant 2
│ ├── Account C (Sub-merchant wallet)
│ └── Account D (Sub-merchant wallet)
└── Merchant N
└── ...
Partner → Merchants → Accounts is the core hierarchy. Each level provides isolation and tracking.
Core Entities
Merchants
A merchant represents a business entity on your platform. If you're a SaaS platform, each of your customers is a merchant.
- Created via
POST /v2/merchants - Has a unique
idand your ownexternal_id - Groups related accounts together
Accounts
An account is a virtual wallet that holds funds. Each merchant can have multiple accounts for different purposes.
- Created via
POST /v2/accounts - Linked to a specific merchant
- Tracks balances independently
Balance Structure
Each account maintains multiple balance states:
{
"account_id": "acc_abc123",
"balances": {
"available": 100000,
"pending": 25000,
"reserved": 15000,
"total": 140000
},
"currency": "PHP"
}
| Balance | Description |
|---|---|
| Available | Ready for withdrawal or transfer |
| Pending | In transit or being processed |
| Reserved | Held for disputes or compliance |
| Total | Sum of all balance states |
All amounts are in centavos (PHP minor units). 100000 = PHP 1,000.00.
Fund Flow
Money In (Credits)
- Payment received via QRPH, bank transfer, or virtual collection account
- Funds land in the designated account
pendingbalance increases during processing- On confirmation,
availablebalance increases
Money Out (Debits)
- Payout request created from an account
availablebalance decreases,reservedincreases- On successful payout,
reserveddecreases - On failure,
reservedreturns toavailable
Fund Isolation
Each account's funds are completely isolated:
- No cross-account contamination: Account A's balance cannot affect Account B
- Independent tracking: Each account has its own posting history
- Audit trail: All balance changes are logged via postings (viewable at
GET /v2/accounts/{id}/postings)
Related
- The Lifecycle of a Payout — how funds move out
- Understanding Webhooks — get notified about balance changes
- API Reference: Accounts — account endpoints