DEV Community

Tidy Cents
Tidy Cents

Posted on

Why order-level matching fails for payment processor payouts (and what to match instead)

If you sell through a card processor or a marketplace, the bank does not see your orders. It sees payouts: one deposit that covers many orders, already net of fees, minus refunds, minus whatever reserve the processor is holding. Try to match orders to bank lines one by one and almost nothing matches.

The fix is to change the unit you match. Match payouts to bank deposits, then explain each payout from the inside.

The data shape

// all money in integer cents
const payout = {
  id: 'po_1042', paidOn: '2026-11-03', amount: 804_950,
  lines: [
    { type: 'charge', amount: 1_000_000 },
    { type: 'fee', amount: -35_050 },
    { type: 'refund', amount: -40_000 },
    { type: 'reserve_hold', amount: -50_000 },
    { type: 'reserve_release', amount: 0 },
    { type: 'chargeback', amount: -70_000 },
  ],
};
Enter fullscreen mode Exit fullscreen mode

Step 1: every payout must explain itself

Before matching anything, check that the lines add up to the payout. If they do not, the problem is in the export, not in the bank.

const explained = p => p.lines.reduce((s, l) => s + l.amount, 0) === p.amount;
Enter fullscreen mode Exit fullscreen mode

Step 2: match payout to deposit by amount, then by date window

function matchPayouts(payouts, deposits, windowDays = 3) {
  const used = new Set(), result = [];
  for (const p of payouts) {
    const cands = deposits.filter(d => !used.has(d.id) && d.amount === p.amount &&
      Math.abs(daysBetween(d.date, p.paidOn)) <= windowDays);
    if (cands.length === 1) { used.add(cands[0].id); result.push({ payout: p.id, deposit: cands[0].id, status: 'matched' }); }
    else result.push({ payout: p.id, deposit: null, status: cands.length ? 'ambiguous' : 'unmatched', options: cands.map(c => c.id) });
  }
  return result;
}
const daysBetween = (a, b) => (Date.parse(a) - Date.parse(b)) / 86_400_000;
Enter fullscreen mode Exit fullscreen mode

Two design choices matter here:

  1. Exactly one candidate or nothing. Two deposits of the same amount within the window are ambiguous, and a person decides. Auto-picking the closest date is how a reconciliation silently goes wrong.
  2. Timing is a window, not equality. A payout dated the 31st often lands on the 2nd. That is a timing item for the next month, not a missing payment.

Step 3: whatever is left is an exception with an owner

Unmatched payouts, unmatched deposits, payouts that do not explain themselves: each becomes a line with an amount, a reason, a person and a due date. The month is closed when that list is empty or every item has an owner.

The tool version

We built this into Month-End Reconciliation & Evidence Desk: it imports bank, processor and accounting exports (CSV or XLSX), matches grouped payouts net of fees, refunds and reserves, proposes date-window matches, leaves ambiguous ones for you to confirm, and closes the month with a printable evidence pack. $29 one-time, free demo on sample data. If you only need to find why one balance is out, the free Bank Reconciliation Difference Finder does that.

Tidy Cents makes tools for running your business. No AI guesses: every result shows its working.

Top comments (0)