TRICKYwalkthrough
Reconciliation and Settlement
At the end of each day (T+1), the card networks send a settlement file: a batch report listing every authorized and captured transaction with amounts and statuses. Our reconciliation job compares this file against our ledger_entries table, line by line.
This is how we catch double charges, missing captures, and ambiguous timeout resolutions. The reconciliation runs as a batch job processing 432M transactions against the settlement file.
“Any mismatch (we say 'captured 50') triggers an alert for manual review.”
At 900 bytes per comparison (our record + network record), the job processes of data per run. We partition the reconciliation by merchant_id and run it in parallel across 50 workers, completing in under 2 hours. Settlement is the actual movement of money.
Card networks batch-settle once per day: they transfer the net amount (captures minus refunds) from the issuing bank to the acquirer, who then distributes to merchants. Settlement takes T+2 to T+3 business days.
Why not real-time settlement? Because card networks batch for efficiency and to allow time for disputes and chargebacks.
Trade-off: merchants do not receive funds for 2-3 days after a charge. Stripe and other modern processors offer 'instant payouts' by fronting the money and absorbing the settlement risk.