Report names, columns and payout timing are from Stripe's documentation, checked on 14 November 2026. Itemized report column names change with report versions; check the version you download.
Payment reconciliation is proving that every sale you recorded became money in your bank account, and explaining every difference. For card payments, the money passes through three systems that each record it differently, so you match three ways:
| Source | What it records | On Stripe |
|---|---|---|
| Your ledger | Orders, at the price the customer agreed, and the refunds you issued | Your own database |
| The processor | Every movement through your balance: gross, fee, net, and which payout it went out in | Balance transactions; the payout reconciliation report |
| The bank | One deposit per payout, net of everything, on the day the bank posts it | Your bank statement |
That's three-way reconciliation: ledger to processor per order, processor to bank per payout. Matching only two of them is how a refund that never reached the processor, or a payout that never reached the bank, stays invisible.
What Stripe gives you
- Balance transactions. Stripe creates one for every movement in or out of your balance, each with
amount(gross),fee,net(amount minus fee),available_on, asourceID such asch_orre_, and areporting_category, all in the smallest currency unit (Stripe API). Stripe recommendsreporting_categoryovertypefor accounting (Stripe). - The payout reconciliation report. It matches each payout to the batch of transactions in it. The itemized download lists every payment, refund, dispute and fee in each payout, and can include your metadata, such as an order ID, as
payment_metadata[key]columns. An "Ending balance reconciliation" section lists what hadn't been paid out yet at the end of the period (Stripe). - The same thing by API. List balance transactions with
payout=po_..., and expanddata.sourceto get the charge or refund objects in one call (Stripe).
Two limits to know before you build on these. The report only works for automatic payouts: Stripe can't say which transactions a manual or instant payout contained, so reconciling those is on you, or you use the Balance report and treat Stripe like a bank account (Stripe). And the report groups a payout by its estimated arrival date, not the date your bank posts it, and its data runs on a separate schedule, so a payout can land before its report is ready.
Where the three disagree
| Break | What you see | The fix |
|---|---|---|
| Fees | The bank gets the net; your orders say gross | Book revenue at gross and each line's fee as an expense. Never net them |
| Currency conversion | A EUR order arrives as a USD balance transaction | Reconcile on the balance transaction's amount and exchange_rate. Stripe's example: EUR 10.00 at 1.234 is USD 12.34 (Stripe API) |
| Refunds | A negative line in a later payout than the sale | Match it to the order through charge_id and your metadata, not through the payout |
| Disputes | The disputed amount plus a fee leaves the balance; it can differ from the charge (FX, partial disputes) | Book the dispute as its own line; a win adds the amount back later (Stripe) |
| Failed refunds | Money comes back to the balance, up to 30 days later | It's a liability to the customer, not revenue (partial refunds) |
| Partial captures | A charge for the full authorization plus a partial_capture_reversal | Sum the two; Stripe gives the reversal its own category so it isn't counted as a refund (Stripe) |
| Failed payouts | The deposit never arrives; funds return to the balance | The itemized failed-payouts report names the payout that retried them (Stripe) |
| Timing | The order is Tuesday, the payout Thursday, the bank line Friday | Match on IDs, and use a date window only for the bank leg |
Funds aren't paid out until they're available: for a US account, Stripe lists initial settlement timing of 2 business days, and a new account's first payout typically comes 7-14 days after its first live payment (Stripe). A week's orders and a week's payouts never contain the same transactions, which is why you match on IDs rather than totals.
A three-way matcher in Python
This takes the itemized payout reconciliation CSV (downloaded with your order_id metadata column), your ledger's expected totals per order, and the bank's deposit lines, and returns every break:
import csv
from collections import defaultdict
from datetime import date
from decimal import Decimal
def load_itemized(path):
"""Stripe's itemized payout reconciliation CSV, downloaded with the
payment_metadata[order_id] column added."""
with open(path, newline="") as f:
return list(csv.DictReader(f))
def reconcile(rows, ledger, bank_lines, window_days=3):
"""Three-way match. Returns the breaks; an empty list means it all ties.
ledger: {order_id: Decimal}, what each order should have collected,
after the refunds you issued.
bank_lines: [(posted_date, Decimal amount, description)] from the bank.
"""
breaks = []
payout_net = defaultdict(Decimal)
payout_due = {}
collected = defaultdict(Decimal)
for row in rows:
payout_id = row["automatic_payout_id"]
payout_net[payout_id] += Decimal(row["net"])
payout_due[payout_id] = date.fromisoformat(
row["automatic_payout_effective_at"][:10])
# Fees, disputes and adjustments move the payout, not the order total.
if row["reporting_category"] in ("charge", "refund"):
order_id = row.get("payment_metadata[order_id]")
if not order_id:
breaks.append(("no_order_id", row["balance_transaction_id"],
Decimal(row["gross"])))
else:
collected[order_id] += Decimal(row["gross"])
# Leg 1: your ledger against Stripe, per order, at gross.
for order_id, expected in ledger.items():
got = collected.pop(order_id, Decimal("0"))
if got != expected:
breaks.append(("order_mismatch", order_id, got - expected))
for order_id, got in collected.items():
breaks.append(("not_in_ledger", order_id, got))
# Leg 2: Stripe's payouts against the bank, exact amount, near the date.
unmatched = list(bank_lines)
for payout_id, amount in payout_net.items():
hit = next((line for line in unmatched
if line[1] == amount
and abs((line[0] - payout_due[payout_id]).days) <= window_days),
None)
if hit:
unmatched.remove(hit)
else:
breaks.append(("payout_not_in_bank", payout_id, amount))
for posted, amount, description in unmatched:
breaks.append(("unexplained_deposit", description, amount))
return breaks
Each break type maps to a row of the table above. order_mismatch is usually a refund in a different period or a dispute; not_in_ledger is usually a webhook you never processed; payout_not_in_bank is a payout still in flight or one that failed. Run it daily, and anything older than your window is a person's job, not the script's.
The matching engine: tolerances, the six discrepancy types, and why provider IDs never line up cleanly. From chapter 20.
Core Reconciliation Engine
The reconciliation engine performs three-way matching between your internal database, payment provider reports, and bank statements. The complete implementation is in src/examples/20-reconciliation/reconciliation_engine.py.
from reconciliation_engine import ReconciliationEngine, MultiProviderReconciliation, ReconciliationStatus
from datetime import datetime, timedelta
# Initialize reconciliation engine
engine = ReconciliationEngine()
# Reconcile a single provider's settlement file
records = engine.reconcile_settlement_file(
settlement_file=settlement_file,
start_date=datetime(2024, 1, 15),
end_date=datetime(2024, 1, 16)
)
# Check reconciliation results
for record in records:
if record.status == ReconciliationStatus.UNMATCHED:
print(f"Discrepancy: {record.transaction_id} - {record.discrepancies}")
print(f" Variance: ${record.variance_amount}")
# Multi-provider reconciliation for all payment sources
multi_reconciler = MultiProviderReconciliation()
results = multi_reconciler.reconcile_all_providers(datetime.now() - timedelta(days=1))
for provider, records in results.items():
matched = sum(1 for r in records if r.status == ReconciliationStatus.MATCHED)
print(f"{provider}: {matched}/{len(records)} matched")
Key features of the reconciliation engine:
- Tolerance thresholds: $0.01 absolute and 0.1% percentage tolerance to prevent false positives from rounding
- Discrepancy classification: Identifies amount mismatches, timing differences, missing transactions, fee variances
- Multi-provider support: Reconciles Stripe, PayPal, Adyen, Square with provider-specific parsers
- Performance optimization: O(1) lookups using hash maps for matching 50,000+ transactions
Set tolerance thresholds before you start matching - $0.01 absolute and 0.1% percentage covers most rounding differences. Without tolerances, a business processing 50,000 monthly transactions will flag thousands of false discrepancies from penny rounding alone, and the real problems disappear into the noise.
Understanding the Reconciliation Engine Architecture
Three-way matching means resolving disagreements between three independent sources. Your database says you processed a $100 payment. Stripe says they took $3.20 in fees and sent you $96.80. Your bank shows $96.30 because there was an international wire fee nobody mentioned. The reconcile_settlement_file method's job is figuring out which numbers are right and where the gaps came from.
The matching algorithm uses transaction IDs as the primary key, but real-world IDs rarely line up cleanly. Stripe uses pi_1234567890, PayPal uses PAYID-LMNOP-QRS, your bank reference number is whatever the originating bank decided to send. Transactions also drift between periods, and refunds appear as standalone records that look like new charges. The lookup maps deliver O(1) performance because at 50,000 transactions a night, every millisecond matters.
The _create_reconciliation_record method sorts every discrepancy into one of six types. Missing internal records: the provider reports a transaction you don't have, often a webhook failure. Missing external records: you have a transaction the provider doesn't, often a failed payment your system didn't catch. The other four are amount mismatches (currency conversion or fee math), fee variances (retroactive adjustments), timing differences (end-of-day processing across timezones), and currency variance (exchange rate differences in multi-currency scenarios).
The tolerance_amount and tolerance_percentage settings prevent false positives. $0.01 absolute tolerance handles penny rounding; 0.1% percentage tolerance handles currency conversion variations. Without these, you'd flag thousands of false discrepancies daily and hide the real ones.
The MultiProviderReconciliation class handles the reality that most businesses use multiple providers, each with its own settlement file format and download cadence (Stripe daily, PayPal weekly). Per-provider error handling means one provider's failure doesn't stop the whole run.
The provider-specific code is where the complexity lives. The _download_stripe_settlement method fetches balance transactions for a date range, converts amounts from cents to dollars, pages through the API on high-volume days, and applies parsing logic that's Stripe-specific, which is different from PayPal's, which is different from Adyen's.
It runs in seconds instead of hours, gives you one view across every provider, and logs every decision it makes. What that buys you: books that match reality, missing transactions surfaced as fraud signals, fee overcharges caught early, cash-flow forecasts you can trust, and an audit trail that satisfies financial regulators.
Parsing bank exports and fuzzy-matching deposits that arrive late, batched or truncated. From chapter 20.
Bank Statement Reconciliation
Bank statement reconciliation matches bank deposits against expected settlements from payment providers. The complete implementation with multi-bank parsing is in src/examples/20-reconciliation/bank_statement_reconciliation.py.
from bank_statement_reconciliation import BankStatementParser, BankReconciliationEngine
# Parse bank statement (supports Chase, Wells Fargo, Bank of America)
parser = BankStatementParser()
bank_transactions = parser.parse_statement('chase_statement.csv', 'chase')
# Get expected settlements from your payment providers
expected_settlements = get_expected_settlements_from_database()
# Reconcile with fuzzy matching
reconciler = BankReconciliationEngine()
results = reconciler.reconcile_bank_statement(bank_transactions, expected_settlements)
# Review results by confidence level
for result in results:
if result['status'] == 'matched':
print(f"Matched: {result['bank_transaction'].amount}")
elif result['status'] == 'likely_match':
print(f"Likely match (confidence: {result['match_confidence']:.0%})")
else:
print(f"Unmatched: {result['bank_transaction'].description}")
Key features of bank statement reconciliation:
- Multi-bank parsing: Handles Chase, Wells Fargo, Bank of America CSV formats
- Fuzzy matching algorithm: Weighted scoring (50% amount, 30% date, 20% description)
- Confidence thresholds: >90% = matched, 70-90% = likely match, <70% = unmatched
- Pattern recognition: Identifies payment providers in bank descriptions ("STRIPE", "PYPL")
Bank Statement Reconciliation: Where Reality Meets Records
Bank statement reconciliation is where you find out whether the "successful" payment your processor reported actually landed in your account. It's the final check, and it's the one that catches money lost in transit.
The BankStatementParser class exists because banks don't standardize export formats. One bank gives you a CSV, another a slightly different CSV, a third a PDF. The parser pattern lets you add new bank formats without touching core logic, absorbs format changes when banks "improve" their systems, and handles different account types with different field conventions.
Fuzzy matching is essential because bank descriptions almost never match provider records exactly. Banks truncate descriptions to fit fixed widths ("STRIPE PAYMENTS 123456789" becomes "STRIPE PAY"). Settlement timing slips by hours or days. Amounts shift because of fees nobody disclosed. Small transactions get batched into single mysterious deposits.
The confidence scoring algorithm weights three factors. Amount matching carries 50% weight as the most reliable signal: exact matches score full confidence, penny differences from rounding still score high, and larger gaps drop confidence sharply. Date matching carries 30%: same-day matches are ideal, 1-3 day delays are common and acceptable, beyond 3 days suggests a real issue. Description matching carries 20%: pattern matching identifies payment providers, word similarity handles truncation, and provider-specific patterns improve accuracy.
The _load_payment_patterns method defines keywords that identify payment sources in bank descriptions. "STRIPE" in a bank description strongly suggests a Stripe settlement; multiple aliases ("PAYPAL" vs "PYPL") map to the same provider; patterns also distinguish settlement deposits from other transaction types like refunds and chargebacks.
The system also handles edge cases that break naive matchers: batched deposits where multiple transactions combine into one bank line item, split settlements where one transaction lands across multiple deposits, fee deductions that produce gross-vs-net differences, and returned deposits where failed settlements get reversed days later.
For speed, the engine pre-compiles its patterns, memoizes common calculations, batches database queries, and uses hash maps for O(1) lookups. The result is a matcher that catches the real discrepancies (weekend and holiday delays, international wires that take 3-5 days with multiple fees, currency conversion at bank-vs-provider rates, batch timing across multiple settlement days) without burying you in false positives. It's also the step that confirms money actually reached your account, validates fees, flags unexpected deposits as potential fraud, keeps your available balance accurate, and produces the financial trail auditors expect.
Banks batch small settlements into single deposits without itemizing individual transactions. If you see a $4,237.18 deposit but expected three separate settlements of $1,412.39 each, the bank likely combined them. Your matching algorithm needs to handle one-to-many and many-to-one matching - not just one-to-one - or batched deposits will show as unmatched.
Payment reconciliation software
Build or buy comes down to how many sources you have. One processor and one bank account is a scheduled job like the one above, plus the itemized report. Stripe's own reports, your accounting system's bank feed, and dedicated reconciliation tools all automate parts of it; a tool earns its price when you have several processors, several currencies and several bank accounts, because then the matching rules multiply. Whatever you pick, put the order ID in payment metadata from day one. Without a shared ID, every match is guesswork, and no software fixes that afterwards.
For the accounting model under the matches, see payments ledger. For what the fee lines are made of, see payment processing fees.
Questions
What is payment reconciliation?
Proving that every sale you recorded became money in your bank account, and explaining every difference. For card payments that means matching your ledger, the processor's records and the bank statement against each other.
What is three-way reconciliation in payments?
Matching three sources: your ledger to the processor per order, and the processor to the bank per payout. On Stripe the processor side is the balance transactions and the payout reconciliation report. Matching only two of them leaves breaks between the other two invisible.
How do I reconcile Stripe payouts with my bank?
Use the payout reconciliation report, or list balance transactions with the payout ID, to see every payment, refund, dispute and fee in each payout. The payout's net should equal one bank deposit. The report only covers automatic payouts, and it groups payouts by estimated arrival date rather than the date the bank posts them.
Why doesn't my Stripe payout match my sales?
Payouts are net of fees, refunds and disputes, include whatever became available since the last payout rather than one period's sales, and convert foreign-currency charges at the balance transaction's exchange rate. Match on IDs, not totals.
Do I need payment reconciliation software?
With one processor and one bank account, a scheduled job and Stripe's itemized report cover it. A dedicated tool earns its price with several processors, currencies and bank accounts. Either way, put the order ID in payment metadata so every match has a shared ID.