Reserves and Negative Balances
Last Updated: 2026-12-01 Status: Complete
A rolling reserve is a held portion of a sub-merchant's funds, and a negative balance is what remains when the platform has paid out more than the merchant is owed. This page covers the engineering of both: reserve data model and release jobs, and a recovery waterfall for negative balances. Reserve policy (how much, for how long, for which risk level) is in Reserve Management and is not repeated here.
Quick Reference
| Concept | Engineering meaning |
|---|---|
| Rolling reserve | Withhold a percentage of each settlement; each hold creates a release record with release_at |
| Fixed reserve | A target amount, funded upfront or withheld until the target is met |
| Capped reserve | Rolling until a cap is reached, then withholding stops |
| Terms changes | Versioned, effective-dated, applied prospectively |
| Negative balance | Never silently ignored: recover in a defined order, then escalate |
Vendor behaviors below (Stripe, Adyen) are examples taken from their documentation and can change. Confirm liability and reserve-holding arrangements with your sponsor bank agreement and legal counsel.
How Do You Model Reserve Types as Mechanics?
| Type | Funding | Release |
|---|---|---|
| Rolling | Percentage of each settlement | Each hold released at its own release_at by a scheduled job |
| Fixed | Upfront deposit, or withholding until target reached | On a date, on an event (for example account closure plus a dispute window) or manually |
| Capped | Rolling until total held equals the cap | As rolling, and holds resume if the held total falls below the cap |
All three reduce to the same primitives: a policy that decides how much to hold, a hold record, and a release record. The base for the percentage (gross sales or net after refunds) is a contract term; see the worked example in Payout Architecture.
Data Model
CREATE TABLE reserve_policy (
id uuid PRIMARY KEY,
merchant_id uuid NOT NULL,
version int NOT NULL,
type text NOT NULL, -- rolling | fixed | capped
rate_bps int, -- basis points, rolling and capped
base text NOT NULL, -- gross_sales | net_sales
target_minor bigint, -- fixed target
cap_minor bigint, -- capped limit
hold_days int, -- release delay, from contract
effective_from timestamptz NOT NULL,
effective_to timestamptz,
UNIQUE (merchant_id, version)
);
CREATE TABLE reserve_hold (
id uuid PRIMARY KEY,
merchant_id uuid NOT NULL,
policy_id uuid NOT NULL REFERENCES reserve_policy(id),
source_ref text NOT NULL, -- settlement or payout reference
currency char(3) NOT NULL,
amount_minor bigint NOT NULL CHECK (amount_minor > 0),
release_at timestamptz,
status text NOT NULL, -- held | partially_applied | applied | released
UNIQUE (policy_id, source_ref)
);
CREATE TABLE reserve_release (
id uuid PRIMARY KEY,
hold_id uuid NOT NULL REFERENCES reserve_hold(id),
amount_minor bigint NOT NULL CHECK (amount_minor > 0),
reason text NOT NULL, -- scheduled | early | applied_to_loss | termination
approved_by text,
released_at timestamptz NOT NULL
);
Ledger entries: a hold debits the sub-merchant payable and credits the reserve payable; a release does the opposite. Reserve payable stays a liability to the merchant, so total merchant funds are conserved. See Double-Entry Ledger and the reserved balance in Balances.
Who physically holds reserve funds (the sponsor bank, the PayFac, or both) depends on the sponsor agreement. The ledger tracks the obligation to the merchant either way; the bank account that backs it is a treasury decision. See Financial Requirements and Sponsor Delegation.
What Happens When Terms Change?
- Mid-stream changes: insert a new
reserve_policyversion witheffective_from; never update the old row. The new policy applies prospectively to settlements after that instant. Existing holds keep their originalrelease_atunless a documented rule or approval says otherwise. - Early release: a
reserve_releasewith reasonearly, an approver and a ledger entry. Require two-person approval for large amounts (set the threshold from your own risk appetite). - Applying reserves to losses: when a chargeback or negative balance exceeds the payable, apply held reserve with reason
applied_to_loss(a partial amount is allowed) and set the hold topartially_applied, orappliedonce fully consumed. The entry debits reserve payable and credits the sub-merchant payable. - Termination: stop new holds, keep existing holds until the exposure window your contract defines has passed (chargebacks can arrive well after the last sale), then release the remainder and pay it out.
Scheduled Release Job
@Injectable()
export class ReserveReleaseJob {
constructor(private readonly dataSource: DataSource, private readonly ledger: LedgerService) {}
@Cron(CronExpression.EVERY_HOUR)
async run(): Promise<void> {
const due = await this.dataSource.getRepository(ReserveHold).find({
where: { status: ReserveStatus.Held, releaseAt: LessThanOrEqual(new Date()) },
take: 500,
});
for (const hold of due) {
await this.dataSource.transaction(async (m) => {
const locked = await m.findOne(ReserveHold, {
where: { id: hold.id }, lock: { mode: 'pessimistic_write' },
});
if (!locked || ![ReserveStatus.Held, ReserveStatus.PartiallyApplied].includes(locked.status)) return;
if (await this.hasOpenLiability(m, locked.merchantId)) return; // negative balance? skip
// remaining = amount_minor - sum(reserve_release rows: releases and applications)
const remaining = locked.amountMinor - (await this.sumReleases(m, locked.id));
if (remaining <= 0n) return;
await this.ledger.post(m, releaseEntries(locked, remaining));
await m.save(ReserveRelease, { holdId: locked.id, amountMinor: remaining, reason: 'scheduled' });
await m.update(ReserveHold, locked.id, { status: ReserveStatus.Released });
});
}
}
}
The status check under a row lock makes reruns safe. A hold's status is held, partially_applied (some of it applied to losses), applied (fully consumed) or released; the amount still held is always amount_minor minus the sum of its reserve_release rows, whatever the reason. Skipping holds for merchants with open liabilities keeps the reserve available to cover them; a refinement is to apply the hold to the liability first and release only the surplus.
How Do Negative Balances Arise?
| Cause | Example |
|---|---|
| Refunds exceeding sales | Merchant refunds more than it processed since the last payout |
| Chargebacks | Dispute debit arrives after payout; see Chargeback Lifecycle |
| Fees | Monthly or event fees exceed available balance |
| Returned recovery debit | An ACH debit used for recovery is returned (for example R01) after the payable was already credited |
Recovery Waterfall
The order is a policy choice; this is a common one because it uses money you already control first. Rules to enforce:
- The debit step needs a valid authorization on file. Keep authorization records for the period the rules require (Two years from the termination or revocation of the authorization) and confirm the language with legal counsel and your ODFI.
- Cap debit attempts and pause payouts when the cap is reached. Stripe documents a maximum number of debit attempts, after which it pauses payouts (vendor example).
- Write-off is an expense entry (debit loss expense, credit the payable) that requires approval and a reason; it is never an edit of earlier entries.
Who Bears the Loss?
Liability is a contract and product decision. Stripe Connect exposes it per account (controller.losses.payments set to stripe or application); for platform-liable accounts Stripe may hold a reserve on the platform balance, and per its documentation a collection transfer from the platform clears a balance that stays negative for 180 days. In Adyen for Platforms, the platform's liable balance account can be debited when user balances go negative. Model liability as a field per sub-merchant (loss_bearer: platform, payfac, sponsor_bank, merchant_only) so recovery code knows which ledger account absorbs a write-off. Your actual allocation among platform, PayFac and sponsor is set by your agreements.
What Should a Refund Do When the Balance Is Insufficient?
| Option | Effect | Risk |
|---|---|---|
| Fund from platform | Refund proceeds; merchant balance goes negative | Platform credit exposure |
| Block | Refund rejected with a clear error | Customer harm, support load |
| Allow negative | Same as funding, with a limit | Needs per-merchant exposure caps |
Choose per risk tier and make it a policy field rather than code. Always cap the allowed negative amount.
Monitoring Exposure
Alert on total negative balance by merchant and in aggregate, age of each negative balance, number of failed debit attempts and reserve coverage ratio. Set thresholds from your own baseline. Tie alerts to merchant-level actions (hold payouts, tighten reserve, review) described in Ongoing Monitoring.
Worked Example: Recovering a Negative Balance
A merchant has a payable of $300. A $800 refund is processed. Later $200 of new sales settle, $100 of reserve is held, and the rest is collected by ACH debit.
| Step | Debit | Credit | Amount | Payable after |
|---|---|---|---|---|
| Refund | Sub-merchant payable | Settlement cash | 800 | -500 |
| New sales settle | Settlement cash | Sub-merchant payable | 200 | -300 |
| Apply reserve | Reserve payable | Sub-merchant payable | 100 | -200 |
| ACH debit received | Settlement cash | Sub-merchant payable | 200 | 0 |
A negative payable is an amount the merchant owes. If the debit failed and collections gave up, the final entry would be: debit loss expense, credit sub-merchant payable, 200.
@Injectable()
export class NegativeBalanceRecoveryService {
constructor(private readonly dataSource: DataSource, private readonly ledger: LedgerService) {}
async recover(merchantId: string, currency: string): Promise<void> {
await this.dataSource.transaction(async (m) => {
let owed = -(await this.ledger.payableBalance(m, merchantId, currency)); // lock the account
if (owed <= 0n) return;
owed -= await this.applyReserve(m, merchantId, currency, owed);
if (owed > 0n) {
await m.save(RecoveryCase, {
merchantId, currency, amountMinor: owed.toString(),
step: RecoveryStep.AchDebit, // next steps run asynchronously with retry caps
});
}
});
}
// applyReserve posts reserve-payable to sub-merchant-payable entries and returns the amount used
}
With a derived payable balance, netting happens automatically because a negative payable reduces the next positive balance. Do not subtract it again in the payout calculator (set negativeOffset to 0); see Payout Architecture.
recover() can run repeatedly, so enforce one open case per merchant and currency and upsert into it:
CREATE UNIQUE INDEX recovery_case_one_open
ON recovery_case (merchant_id, currency) WHERE status = 'open';
-- INSERT ... ON CONFLICT (merchant_id, currency) WHERE status = 'open'
-- DO UPDATE SET amount_minor = EXCLUDED.amount_minor
In the service, replace m.save(RecoveryCase, ...) with that upsert (for example m.upsert with a raw ON CONFLICT clause, or createQueryBuilder().insert().orUpdate(...)), so a second call updates the amount instead of opening a duplicate case.
Related Topics
- Payout Architecture — where reserve holds and offsets enter the payout calculation
- Payment Fee Engine Design — fees that can drive balances negative
- Reserve Management — reserve policy
- Balances — available vs reserved balances
- Check your understanding: Money Movement Quiz
References
- Account balances (Connect) — Stripe documentation (vendor)
- Account structure resources — Adyen documentation (vendor)
- Nacha Operating Rules — Nacha