How do I match a lump-sum remittance to many open invoices?
Match against the remittance detail that comes with the payment — a BAI2 lockbox record, an EDI 820 advice, or a remittance email listing invoice numbers — rather than guessing how a lump sum splits. When that detail is missing, fall back to amount-combination matching, and treat any leftover as its own item to resolve, not force-fit into an invoice it doesn't match.
Part of the accounts receivable and collections guide.
| Primary matching source | Remittance detail attached to the payment — BAI2 lockbox record, EDI 820, or a remittance advice |
|---|---|
| BAI2 | A bank-defined flat-file format that carries invoice-level detail alongside lockbox deposits (Bank Administration Institute standard) |
| Fallback when detail is missing | Amount-combination matching — testing whether the lump sum equals the sum of a specific set of open invoices |
| What not to do | Splitting the lump sum evenly, or applying it oldest-invoice-first, without evidence that's actually how the customer intended it |
| Leftover balance | Treated as its own unresolved item (unapplied cash or a deduction), not forced onto an invoice it doesn't reconcile to |
Why guessing the split is worse than leaving it unapplied
A single wire or check covering a dozen open invoices doesn't come with an obvious answer for how it splits — and applying it oldest-invoice-first, or evenly across everything open, without evidence that's actually what the customer intended, can close out the wrong invoices while leaving the ones the customer actually meant to pay still open. A wrong match is arguably worse than no match: unapplied cash is visibly unresolved and gets investigated, while a wrong match looks resolved and quietly misstates which specific invoices are actually still owed.
What a BAI2 lockbox record actually provides
BAI2 is a bank-defined flat-file format, originally specified by the Bank Administration Institute, used to transmit deposit and transaction detail from a bank to a corporate treasury or AR system. When a customer pays through a lockbox, the bank's BAI2 file can carry lockbox remittance records listing the specific invoice numbers and amounts included in that deposit — turning a single lump-sum bank deposit back into its constituent invoice-level detail without anyone having to call the customer to ask.
What to do when remittance detail is missing or incomplete
Not every payment arrives with clean remittance detail — a wire with no accompanying advice, or a BAI2 record that lists an amount but not which invoices it covers. The fallback is amount-combination matching: testing whether the payment total equals the sum of some specific subset of that customer's open invoices. A lump sum that exactly equals three specific open invoices, and no other combination of open invoices on that account, is strong evidence for that match even without explicit remittance detail — though it's meaningfully weaker evidence than an actual remittance record naming the invoices directly, and should be treated with more scrutiny.
Why a leftover balance needs its own resolution, not a shortcut
A lump sum rarely divides evenly. Once the matched portion is applied, whatever's left over — too little to close the next invoice, or an amount with no combination that matches anything open — shouldn't be force-applied to the nearest invoice just to zero it out. That leftover is either a deduction (see the short-payment and deduction page) or genuinely unapplied cash, and it needs the same classification discipline as any other unmatched amount, not a shortcut that makes the reconciliation look cleaner than it actually is.
Next step
Map the finance workflow with the most exposure and prove the automation path.
Bring the invoice, contract, payment reconciliation, or customer finance workflow you have to defend at audit. Loopfour can map the trigger, controls, integrations, and approval loop.
Field mapping
A $27,650 lockbox deposit mapped line-by-line to four invoices, with a leftover
| BAI2 lockbox detail record | Invoice # | Amount applied | Result |
|---|---|---|---|
| Detail line 1 | INV-8801 | $9,200.00 | Matches invoice exactly — closed |
| Detail line 2 | INV-8815 | $6,450.00 | Matches invoice exactly — closed |
| Detail line 3 | INV-8822 | $11,000.00 | Matches invoice exactly — closed |
| Remaining deposit | None listed | $1,000.00 | No matching detail line — held as unapplied cash, not forced onto INV-8830 ($1,050) despite being close |
$26,650 of the $27,650 deposit matches explicit BAI2 detail lines and closes three invoices cleanly. The remaining $1,000 is close to, but not exactly, the $1,050 balance on INV-8830 — without an explicit remittance line naming it, applying that $1,000 to INV-8830 would be a guess, not a match. It's held as unapplied cash pending confirmation, rather than applied on a near-miss.
Frequently Asked Questions
Sources
Related
Topic
AR & Collections
Accounts receivable is the money customers owe a business for goods or services already delivered on credit — a current asset on the balance sheet until it's collected. AR and collections, as a practi…
Read moreHow-to
How do I automate applying incoming payments to open invoices?
Match on an exact amount plus invoice reference first, auto-applying with no human involved, then use fuzzy or confidence-scored matching for near-misses like a payment short by a fee. Route anything that can't be matched confidently to an exception queue rather than guessing, and require an invoice reference at the point of payment wherever possible to maximize the automatic-match rate.
Read moreDiagnostic
How do I handle a customer short-payment, deduction, or chargeback on an invoice?
First classify the deduction — valid claim (damaged goods, pricing error, an agreed promotion) versus unauthorized short-pay. Valid claims get coded to the right expense/contra-revenue account and closed out; unauthorized ones get disputed and either recovered or written off. Applying the payment before classifying the gap creates unapplied-cash and aging problems downstream.
Read moreDiagnostic
What is unapplied cash in AR and how do I clear it?
Unapplied cash is a customer payment that's been received and recorded, but not yet matched to a specific open invoice — it sits in a clearing or unapplied-payments balance instead of reducing a receivable. It's cleared by identifying which invoice(s) the payment is actually for and applying it; until that happens, it inflates cash while AR aging still shows the invoice as fully open.
Read more