Payout Architecture
Last Updated: 2026-12-01 Status: Complete
Payout architecture is the part of a PayFac platform that turns money the acquirer has deposited in aggregate into correct, traceable payouts to each sub-merchant. After reading this page you will be able to design the payout calculation, the schedule model, the split-funding ledger entries, the rail choice and the failure handling for returned payouts.
Quick Reference
| Topic | Rule of thumb |
|---|---|
| Funding time | A contract and risk decision, never a constant. Store a schedule per merchant. |
| Money | bigint minor units per currency. Never floating point. |
| Idempotency | Scheduled payouts: payout_{merchantId}_{currency}_{payoutDate}, enforced by a unique constraint. Manual or instant payouts use the caller's request key. |
| Same Day ACH limit | $1 million per payment |
| RTP limit | $10 million |
| FedNow limit | $10 million network maximum (participants set their own limit; default $100,000) |
| ACH return timeframe | Two banking days from the settlement date (unauthorized consumer debits allow longer) |
Rail limits, return timeframes and vendor behaviors on this page change. Values rendered from the fact registry are listed on Key Numbers. Confirm Nacha rule details with your ODFI or sponsor bank.
What Is the Funds Flow Behind a Payout?
Under card network rules the acquirer is responsible for paying merchants. An acquirer may pay a payment facilitator on behalf of its sponsored merchants, and the PayFac must then pay those merchants promptly. The sponsor agreement sets the detail: which account receives the funds (a settlement or for-benefit-of account), who holds reserves and what timing applies. See Sponsor Delegation and Financial Requirements.
The invariant from Module 4 still holds: the aggregate deposit must be explainable as the sum of per-sub-merchant allocations plus PayFac revenue. The ledger, not the bank, is the system of record for who is owed what. See Double-Entry Ledger and Balances.
Net vs Gross: What Does the Merchant See?
Module 4 defines net and gross funding. From the merchant's point of view:
- Net payout: one deposit equals sales minus refunds, fees, reserve and recoveries. Merchants need a payout report that decomposes it line by line, or support tickets follow.
- Gross payout: the deposit equals sales (less refunds). Fees are collected separately by debit or invoice, so the platform carries a fee receivable and a second cash flow.
Store the choice per merchant (or per pricing plan) and make the payout calculator branch on it. Never infer it from behavior.
How Do You Design Payout Schedules?
Model the schedule as data:
| Field | Purpose |
|---|---|
interval | daily, weekly, monthly or manual |
anchor | Weekday or day of month for weekly and monthly |
delay_days | Banking days between funds becoming available and payout |
minimum_amount | Per currency, in minor units. Below it, the balance rolls forward. |
rail_preference | Default rail and allowed fallbacks |
timezone | Merchant business day for cutoffs |
Stripe documents the same four intervals (manual, daily, weekly, monthly) for connected accounts, as a vendor example. Compute the next payout date from a banking-day calendar (weekends and Federal Reserve holidays for ACH), and treat "available" as a ledger state, not a date you assume. Do not hardcode T+N anywhere. See Balances for available vs pending.
How Do You Calculate a Payout?
Inputs: available balance per currency (the payable balance before any recovery), reserve requirements, negative-balance offsets, holds (risk, dispute, compliance), minimum payout amount and any payout fee.
Outputs: the payout amount, the ledger entries and a payout record in scheduled state.
Keep the calculation a pure function and put the side effects in a transactional service. If your ledger already nets recoveries into the payable, set negativeOffset to 0 to avoid subtracting it twice.
export interface PayoutInputs {
available: bigint; holds: bigint; negativeOffset: bigint;
reserveShortfall: bigint; payoutFee: bigint; minimum: bigint;
}
@Injectable()
export class PayoutCalculator {
calculate(i: PayoutInputs): bigint {
const amount =
i.available - i.holds - i.negativeOffset - i.reserveShortfall - i.payoutFee;
return amount >= i.minimum && amount > 0n ? amount : 0n;
}
}
@Injectable()
export class PayoutBatchJob {
constructor(
private readonly dataSource: DataSource,
private readonly calculator: PayoutCalculator,
private readonly ledger: LedgerService,
) {}
async runFor(merchantId: string, currency: string, payoutDate: string) {
const key = `payout_${merchantId}_${currency}_${payoutDate}`;
await this.dataSource.transaction(async (manager) => {
const inputs = await this.loadInputs(manager, merchantId, currency); // locks balance rows
const amount = this.calculator.calculate(inputs);
if (amount === 0n) return;
// INSERT ... ON CONFLICT (idempotency_key) DO NOTHING RETURNING id
const payout = await this.insertIfAbsent(manager, {
merchantId, currency, amount, status: PayoutStatus.Scheduled, idempotencyKey: key,
});
if (!payout) return; // a previous run already created it
await this.ledger.post(manager, buildPayoutEntries(payout, inputs));
await this.outbox.add(manager, 'payout.submit', { payoutId: payout.id });
});
}
}
The key extends the payout_{merchantId}_{date}_{sequence} shape from the blog post with the currency; without it a merchant's USD and EUR payouts on the same day would collide. One key per merchant, currency and payout date means a rerun of the same schedule reuses it. Manual or instant payouts use the caller's request key instead. The unique constraint prevents a race between two job runs; use ON CONFLICT DO NOTHING (or catch the unique violation, SQLSTATE 23505) so a duplicate skips one payout instead of failing the whole run.
Creating the payout posts the ledger entries (debit sub-merchant payable, credit payout clearing). Submission to the rail is a separate step fed by the outbox row, and a sweeper resubmits scheduled payouts older than your threshold, so a crash between commit and submit does not strand funds. This follows Idempotency in Payments: the key is tied to business intent and stops at your own boundary. When you send the file or API call to a bank, uncertainty is resolved with the bank's trace identifiers, not by assuming the key travels with it. See Idempotency and Event-Driven Architecture for the outbox.
Worked Example: Why the Reserve Base Is a Contract Term
A merchant has $10,000 of sales, $500 of refunds and $200 of platform fees in the period. The contract holds a 10% rolling reserve. The reserve base is a contract term; the two readings give different payouts:
| Reserve base | Reserve | Payout |
|---|---|---|
| Gross sales ($10,000) | $1,000 | 10,000 - 500 - 200 - 1,000 = $8,300 |
| Net sales after refunds ($9,500) | $950 | 10,000 - 500 - 200 - 950 = $8,350 |
Journal entries for the gross-sales reading (US dollars shown for readability; store minor units; settlement cash is simplified to one clearing account):
| Event | Debit | Credit | Amount |
|---|---|---|---|
| Sales settled | Settlement cash | Sub-merchant payable | 10,000 |
| Refunds | Sub-merchant payable | Settlement cash | 500 |
| Fees | Sub-merchant payable | Platform fee revenue | 200 |
| Reserve hold | Sub-merchant payable | Reserve payable | 1,000 |
| Payout | Sub-merchant payable | Payout clearing | 8,300 |
The payable ends at zero: 10,000 - 500 - 200 - 1,000 - 8,300. For the net-sales reading only the reserve line (950) and payout line (8,350) change. Encode the base as a field on the reserve policy (Reserves and Negative Balances) and have the contract, not the developer, choose it. Reserve percentages and holding periods are policy; see Reserve Management.
How Does Split Funding Become Ledger Entries?
Split funding divides one payment among parties. A $100.00 payment (10,000 minor units) might produce a sub-merchant net, a platform fee and PayFac revenue:
| Party | Ledger account | Example |
|---|---|---|
| Sub-merchant | Sub-merchant payable | 9,000 |
| Platform (ISV) | Platform fee payable | 700 |
| PayFac | PayFac revenue | 300 |
For a marketplace order paid to several sellers, create one payable credit per seller, linked to the same payment and order IDs, and balance the entry against the captured amount. Refunds reverse proportionally using a stated rule (pro rata or seller-first) so reversing entries remain deterministic. Fee computation is in Payment Fee Engine Design; the double-entry mechanics are in Double-Entry Ledger.
Which Payout Rail Should You Use?
| Rail | Speed | Limit | Reversible? | Use for |
|---|---|---|---|---|
| ACH | Banking days | Same Day ACH: $1 million | Returns possible | Default scheduled payouts |
| RTP | Seconds, 24/7 | $10 million | Final once credited | Instant payouts |
| FedNow | Seconds, 24/7 | $10 million network maximum (participants set their own limit; default $100,000) | Final once credited | Instant payouts (receiver must participate) |
| Wire | Per bank cutoffs | Bank-set | Recall is not guaranteed | Large or urgent amounts |
| Push-to-card (OCT) | Per issuer and program | Network and issuer rules | Not a purchase reversal | Instant payout to a debit card |
Details: ACH and Nacha, Real-Time Rails and Void vs Reversal vs Refund vs OCT. Build a rail selector as a decision table: amount, currency, merchant preference, destination capability and cost. Instant rails usually cost more, so treat an instant payout as a fee event (Fee Engine).
Payout State Machine and Failure Handling
A payout moves through scheduled, pending (submitted), in_transit, paid, failed or returned, with canceled allowed from scheduled or pending until the payout is released to the rail (cancellation posts reversing entries). At creation the ledger moves funds from the available payable to payout clearing (in transit); paid clears payout clearing against cash. The full transition table is in State Machines. The failure rules to design:
- Failed before send: reverse the ledger entries so the balance returns to the merchant. Never edit the original entries.
- Returned after
paid: ACH can return a payout after it looks complete. Post a reversing entry that re-credits the sub-merchant payable, set the payout toreturned, and block the destination bank account until it is fixed. - Return window: return timeframe: Two banking days from the settlement date (unauthorized consumer debits allow longer), so treat ACH
paidas provisional. A return also pauses further payouts to that merchant until the destination is resolved.
| Code | Meaning | Typical action |
|---|---|---|
| R01 | Insufficient funds | Rare for credits; investigate the origination account |
| R02 | Account closed | Block destination, request new account |
| R03 | No account or unable to locate | Block destination, request verification |
| R04 | Invalid account number structure | Block, ask merchant to correct |
| R16 | Account frozen or returned per OFAC instruction | Hold, escalate to compliance |
| R20 | Non-transaction account | Block, request a different account |
Notifications of Change. A NOC (C01 incorrect account number, C02 incorrect routing number) tells you the correct data. The originator must apply it: Make the requested change within six banking days of receiving the NOC, or before initiating another entry to that account. Automate it, record who and what changed, and keep an audit entry.
Bank account verification before the first payout, with trade-offs:
- Prenote: a zero-dollar entry. Optional; Optional; an Originator that sends a prenote waits three banking days before sending live entries. Slow, and it does not prove ownership.
- Micro-deposits: small deposits the merchant confirms. Proves control, adds days.
- Instant account verification: via a data aggregator with the merchant's consent. Fast; availability varies by bank.
Which method you require is a risk decision with your sponsor bank. The ACH return-rate thresholds are on Key Numbers.
Multi-currency payouts. Payout per currency from a per-currency balance. Convert only with an explicit FX entry; do not net currencies. Read minor-unit exponents from ISO 4217; some currencies have zero or three decimals. See Balances.
How Do You Reconcile Payouts to the Bank?
Each submitted payout stores the bank's trace number (ACH) or reference (wire, RTP, FedNow) when known. Daily, match bank statement lines to payouts by trace and amount, post the bank-side cash entry, clear the payout clearing account to zero, and raise an exception for anything unmatched: a payout with no statement line, a line with no payout, or a return. A nonzero payout clearing account is a signal of a missing, late or incorrect event. Matching keys and break handling are in Reconciliation; ledger-side checks are in Ledger Reconciliation.
Related Topics
- Reserves and Negative Balances — reserve holds and recovery that feed the payout calculation
- Payment Fee Engine Design — how fees are computed and collected
- Payout state machine — transitions and enforcement
- Clearing and Settlement — net vs gross funding and cutoffs
- Check your understanding: Money Movement Quiz
References
- Nacha Operating Rules — Nacha
- Originator Essentials — Nacha Risk Management Advisory Group, 2024
- ACH Return Code Reference — Modern Treasury (secondary)
- Manage payout schedule — Stripe documentation (vendor)
- ISO 4217 data standards — SIX