Skip to main content
Back to Blog
Automation6 min read26.10.2026Sophera Consulting

How to automate payment matching when one transfer covers three invoices, a discount and a deduction

Automate payment matching for the transfers your ERP gives up on: bundled invoices, late cash discounts and deductions. A wholesale example, step by step.

This article was generated by AI. Labelled in accordance with Article 50 of the EU AI Act. Responsible for publication: Sophera Consulting.

Most ERP systems already match incoming payments against open invoices, and for the simple cases they do it well: one amount, one invoice, the invoice number in the payment reference. If you want to automate payment matching, those cases are not your problem. The work sits in the rest. A plumbing contractor pays three invoices in a single transfer, quotes two of the numbers, takes the cash discount on all three and holds back money for a cracked washbasin. A transfer like that goes to the suspense account and stays there until someone in accounts has time to pull it apart.

While it sits there, all three invoices count as unpaid. The customer gets a dunning letter for money they sent days ago, and your sales rep hears about it on the next visit. Discounts taken after the deadline slip through as well, because nobody recalculates every cent by hand.

How to automate payment matching for one messy transfer

The example below is constructed. It shows how we would build such an agent and does not describe a client case.

Say a plumbing and heating wholesaler supplies a few hundred trade businesses. Terms are 2 percent cash discount within ten days, otherwise 30 days net. The bank delivers the statement as a file every morning. On Tuesday it shows a credit of €4,826.63 from a plumbing contractor with the reference "INV 10817 10833 LESS DISC + BROKEN WB".

This customer has four open invoices:

  • INV 10817 for €2,140.00, discount period still running
  • INV 10833 for €1,860.50, discount period still running
  • INV 10851 for €1,012.80, discount period ended nine days ago
  • INV 10862 for €615.00, issued yesterday

Standard matching finds two invoice numbers, no matching total, and gives up. That is where the agent starts.

1. Who paid?

The payer's name and IBAN point to the customer record. The IBAN is on file, so the match is certain. When a customer pays from a new account for the first time, the agent suggests the customer by name and flags the match as uncertain. It never writes new bank details into the master data itself.

2. What does the reference say?

Two invoice numbers and two hints: a discount was taken, and something is "broken WB". A language model handles shorthand like this better than a search rule, because at a plumbing wholesaler "WB" almost certainly means washbasin. The next step shows whether that reading holds up.

3. Taking the amount apart

The two named invoices less 2 percent come to €2,097.20 and €1,823.29, or €3,920.49 together. That leaves €906.14 with no invoice named for it. The agent tries the remaining open items. INV 10851 with the discount is €992.54. Subtract €86.40 and you land exactly on the remainder. The transfer is now fully explained: three invoices, three discounts, one deduction of €86.40.

4. Checking each deduction

On 10817 and 10833 the discount is valid. On 10851 it isn't, since the period ended nine days ago, so the customer kept €20.26 they weren't entitled to.

For the €86.40 the agent searches the ERP and the customer's email thread. It finds a complaint from last Thursday: a washbasin from INV 10833 arrived cracked, price €86.40 gross. No credit note has gone out yet. So the deduction belongs to a real case, but the books don't cover it yet.

5. What accounts sees

The clerk gets a posting proposal:

  • INV 10817 and 10833 settled, discount valid
  • INV 10851 settled except €20.26, discount taken after the deadline
  • €86.40 linked to the open complaint, credit note pending

Each line shows its source: payment reference, invoice or complaint. Nobody redoes the arithmetic. The clerk checks the reasoning and approves.

6. The part that needs a decision

That leaves the €20.26. Whether you let a regular customer keep a late discount is a commercial question. We write that house rule down before we build anything, for example: write off differences under €25 for customers with no open reminders, claim back anything larger. Depending on the rule, the agent books the difference to discounts or drafts a friendly request in the customer's email thread. It also places a dunning block on INV 10833 until the credit note is posted. Otherwise your system chases the customer over the very washbasin that arrived broken.

Bulk payments from buying groups

Wholesale has a second hard case. If you bill through buying groups or central settlement providers, you receive one large sum covering many customers, plus a remittance advice as a PDF, a spreadsheet or an email. The agent reads the advice, splits the sum by customer and invoice, and checks every line the same way. If the advice is missing, it parks the payment and asks for it rather than guessing.

Transfers with no usable reference can often be resolved too, because the amount fits exactly one combination of open items. If several combinations fit, a person decides.

How much the agent posts on its own

That is your call. At first it prepares every difficult payment and accounts approves it. Later, payments it can explain completely and without any difference may be posted automatically, if you want that. Deductions, claims and new bank details stay with a person.

Sophera Consulting builds payment matching agents like this at a fixed price, with no subscription. The agent is set up in one to two days and tested against your real bank statements in the same week. A maintenance agent comes with the fixed price and raises a flag when the bank file format or an interface changes. Bank data is processed on European infrastructure or on your own hardware, and we bring the data processing agreement. In the free automation check we look at which payments keep getting stuck in your suspense account.

What we recommend

Skip the simple payments, your ERP already handles them. Take everything that landed in the suspense account over the last three months and note how each item was finally booked. That list tells you which cases are common in your business: bulk payments, late discounts, deductions for complaints. Measure the agent against it. If it explains those payments correctly and honestly flags the ones it can't, it is worth doing. The first thing to go is the reminder to a customer who paid long ago.

This article was created with the help of AI.

#Zahlungseingang#Offene Posten#Skonto#Buchhaltung#Großhandel#KI-Agenten#Festpreis