
A wallet shows ₦20,000, but the customer can spend only ₦12,000. Is money missing? Not necessarily. One number may describe the recorded balance, while another accounts for money already committed to a transfer or held under a restriction.
The engineering problem is not choosing a nicer label. It is making sure every screen, payment decision and support explanation uses the same meaning. This article focuses on those balance meanings and the ledger entries behind them, rather than tracing a payment from checkout to payout.
Start by defining the question each balance answers
Posted balance answers: what do the completed entries in this ledger currently add up to? “Posted” is a recording state. Your integration must define which external event is sufficient to post an entry; writing it does not itself move money at a bank.
Pending incoming amount answers: what money is expected but not yet usable? Stripe’s balance documentation, for example, distinguishes pending payment proceeds from funds available for use. Availability timing varies with the payment method and location.
Available balance answers: how much may this account use for this operation now? A conservative wallet policy can exclude unsettled incoming funds and deduct outgoing commitments before they complete. Eligibility for a payout may also depend on restrictions beyond the numeric balance.
Reserved amount needs a reason. It could mean money committed to a particular outgoing instruction, or a processor’s risk reserve. Those are different things. Stripe describes risk reserves as funds held to cover potential refunds and disputes. The applicable terms determine release; an app should not invent a date.
The word “pending” can mislead an integration
Never assume that two providers use identical definitions. In Modern Treasury’s ledger model, pending balance includes both posted and pending entries. It is not simply a bucket containing only incoming money awaiting settlement.
If your interface says “Incoming: ₦5,000,” derive that amount from the appropriate entries. Do not copy a field called pending_balance into the label without checking its definition. Document the currency, included transaction states and treatment of holds beside each calculated balance.
A fictional wallet, with numbers you can follow
Consider a simplified wallet operated by ExamplePay. This is an educational design, not a description of a real provider. Ignore fees and currency conversion. A customer has ₦20,000 of posted funds. A separate ₦5,000 incoming transfer is awaiting confirmation, so it cannot yet be spent.
- Before any outgoing instruction: posted funds are ₦20,000, pending incoming is ₦5,000, and available funds are ₦20,000.
- The customer requests an ₦8,000 transfer: ExamplePay reserves ₦8,000 for that instruction. The customer’s total posted entitlement remains ₦20,000, but available funds become ₦12,000.
- The transfer completes: the entitlement falls to ₦12,000 and the ₦8,000 reservation disappears. Available funds remain ₦12,000. Deducting another ₦8,000 from available funds would count the same payment twice.
- Alternatively, the transfer is definitively cancelled before payment: the reservation is released and availability returns to ₦20,000. A timeout alone is not evidence that cancellation is safe.
If the incoming ₦5,000 later qualifies for posting under the agreed policy, it increases posted and available funds. Until then, showing it separately gives the customer useful information without promising spending power they do not have.
Where double-entry fits
Double-entry means each transaction has equal total debits and credits. The effect depends on the account type: a debit increases an asset but decreases a liability. Modern Treasury’s guide explains these conventions.
In our fictional operator’s books, customer balances are liabilities: amounts owed to customers. On the original confirmed ₦20,000 funding, debit the cash asset ₦20,000 and credit the customer liability ₦20,000. This records both the asset received and the obligation created.
One possible reservation model splits that liability into “available” and “reserved for transfer” subaccounts. Reserving ₦8,000 debits the available liability and credits the reserved liability by the same amount. No cash moves; total customer liabilities stay ₦20,000.
On confirmed completion, debit the reserved liability ₦8,000 and credit cash ₦8,000. On cancellation instead, debit the reserved liability and credit the available liability. A real integration may need clearing accounts and more intermediate events. Another valid model uses pending entries rather than a posted reclassification. Choose a consistent model; do not combine both and subtract the hold twice.
A correct calculation can still fail under concurrency
Suppose two ₦8,000 requests simultaneously read an available balance of ₦12,000. Each passes a separate check, yet together they need ₦16,000. The check and reservation must be protected as one operation, rather than trusting an earlier screen value.
Modern Treasury documents balance and version conditions for this problem. Whatever implementation you choose, test simultaneous requests and ensure retries refer to the same business instruction instead of creating additional reservations.
Make balances explainable, not just correct
A useful account screen separates spendable funds, incoming amounts and active holds. Each hold should have an amount, currency, reason and reference. Show a release estimate only when the underlying rules support one.
Keep completed financial entries auditable. Modern Treasury’s transaction-state guidance uses reversing transactions rather than rewriting posted entries to undo their effect. The practical lesson is to preserve why a balance changed, including corrections.
Before release, test completion, cancellation, partial completion, duplicated notifications and late confirmations. For every case, ask: what is owed, what is committed, and what may be spent? If the team can answer those questions from the records, the balance becomes something customers and support staff can understand.