Document processing

Detect duplicate invoices with business keys and review

Reading time
9 minutes
Updated
Published
Written by
modernagents editorial teammodernagents is an AI automation agency from Austria for SMEs, based in the Vienna region.
AI-generated image: Banknote counter with an indigo feed tray on galvanised steel

A supplier sends its invoice by email, and a week later the same invoice arrives again as a scan because a colleague forwarded it. If you want to detect duplicate invoices, you have to notice this before the money goes out twice. At the same time, a corrected invoice must not simply end up in the bin.

The most reliable way is several checks in a row. They ask whether it is exactly the same file, whether company, supplier and invoice number match and whether a document looks similar but differs in one detail. AI can give hints in unclear cases. But whether an invoice is held, connected to an invoice that is already there or let through again needs rules your accounting team can understand and a controlled review process.

An example: a beverage wholesaler in Leiden with 35 employees has two companies, the trading business and a small service company for draught systems. Joost from accounting receives invoices by email, by post and sometimes as a photo from a driver's phone. Today, he compares new invoices with what he remembers. With the new setup, a program should check every invoice before it is posted and show him only the suspicious cases.

Key takeaways

  • The invoice number alone is not enough. Matching needs further details such as company, supplier, amount, currency and date.
  • If company, supplier and number are the same but the amount is not, the invoice is held and cleared by a person. The earlier version is not silently overwritten.
  • Every suspicion should show both originals side by side and say what matches and what differs.
  • Also test what happens when the transfer to the accounting system breaks off halfway.

01 / 09

Why are filenames and hashes insufficient?

Suppose the same invoice reaches Joost once as a PDF by email, once as a scan from the post and once as a phone photo. It is the same document each time, but these are three different files.

A program can calculate a hash for each file, a kind of fingerprint. If two files are identical byte for byte, they have the same hash. That is a good first filter for exact repeats, for example when exactly the same PDF file is forwarded twice. But the hash does not reliably detect that a new scan shows the same invoice.

The invoice number alone is not enough either. Two different suppliers can use the same number, and a supplier can change its numbering, for example at the turn of the year. And at the beverage wholesaler, invoices to the trading business and to the service company must not be lumped together by mistake. The comparison therefore needs several details together. Company, supplier and invoice number form what is called the business key, and amount, currency and date come on top.

ERP systems reflect such combinations. SAP's duplicate-invoice documentation names fields such as supplier, company code, reference, date and amount as relevant checks or criteria you can configure (checked on 26 September 2026). How your system actually behaves depends on the product and its settings. So test it with your own invoices.

02 / 09

Which layers of checking does duplicate detection need?

The check for duplicate invoices runs in five layers, each with its own comparison and its own intended outcome:

Layer What is compared What happens next
File Same hash in the same intake, such as the same mailbox The repeat is connected to the first invoice
Business key Company, supplier, invoice number Joost checks the invoice that is already there
Further details Amount, currency, date The suspicion is confirmed, or a conflict is flagged
Similarity Different spelling, different number or a different scan A suspicion that a person can review
Accounting system Is the invoice already captured, approved or paid? The next step depends on how far the invoice has already gone

Every suspicion should explain which details match and which differ. A note saying "AI says duplicate" is not enough for Joost to decide. He needs both originals side by side on screen, the key details that were compared, such as company, supplier and number, and the processing state of the first invoice.

Also think about how far back the program should search. If it only searches today's inbox, it can miss an invoice the supplier sends again although Joost already processed it last month. Searching only by number across years and all suppliers, on the other hand, creates unnecessary warnings. Agree the search scope with your accounting team.

03 / 09

How should repeated, corrected and recurring invoices and credit notes be handled?

Not every similar invoice is a mistake. At the beverage wholesaler, there are four typical cases, and each needs its own answer.

The first invoice arrives again. A driver photographs an invoice and sends it because he did not know it had already arrived by email. The program connects the photo to the existing invoice. Joost can still see where the photo came from, and no second payment is prepared.

An invoice is corrected. The number is the same, but the amount or individual lines have changed. This is a conflict that Joost has to clear from a business point of view, and the old version must not simply be overwritten. He records which version applies and how processing that has already happened is corrected, for example a posting or a payment.

A service repeats every month. Maintenance of the cold rooms costs the same amount every month, from the same supplier. Without a service period or a matching reference, it would be too broad to hold the second monthly invoice only because of amount and supplier. Cases like this show why similarity should first create a review note for Joost.

A credit note arrives. This case needs its own rule too: a reference to an earlier invoice number does not automatically make the credit note a duplicate of that invoice. And the sign of the amount alone does not reliably explain what is behind it either.

04 / 09

Four invoices with the same number: what happens?

Suppose that in this example four documents reach the beverage wholesaler within a few days. The packaging supplier from Germany (supplier A) sends invoice R-2026-081 for EUR 1,200. Two days later, the same invoice arrives again as a scan, and then a haulier (supplier B) sends its own invoice, which happens to be numbered R-2026-081 too, for EUR 900. Finally, the packaging supplier sends a corrected version for EUR 1,150.

What arrives What the program compares What happens
Supplier A, R-2026-081, EUR 1,200 First invoice The invoice is created
The same invoice as a scan, two days later Different hash, but company, supplier and number match. Amount and currency confirm the suspicion The scan is connected to the existing invoice
Supplier B, R-2026-081, EUR 900 Different supplier Separate invoice
Supplier A, corrected version, EUR 1,150 Same company, same supplier, same number, different amount Held until Joost has cleared it. He checks whether the first invoice was already posted or paid and which correction is needed

Joost creates the first invoice as usual. The scan has a different hash, but company, supplier and number match, and amount and currency fit too. So he can connect the scan to the invoice that is already there. The haulier's invoice has the same number but comes from a different supplier and is a separate invoice.

The corrected version for EUR 1,150 is neither thrown away nor accepted automatically. Because company, supplier and number are the same but the amount is not, the program holds it until someone has cleared it. Joost checks whether the first invoice for EUR 1,200 has already been posted or even paid and decides what has to be corrected. The document history is kept.

These four cases belong together in the test before you accept the program. If you only test two identical PDF files, you check the easiest part, and the important decisions for your accounting stay untested.

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

05 / 09

How do you prevent duplicates caused by technical retries?

A duplicate invoice can also appear when the invoice arrived only once. Suppose the program sends Joost's invoice to the accounting system. It is created there, but the confirmation does not come back in time. The program assumes the attempt failed and sends the invoice again, so now it is in the accounting system twice.

That is why comparing the invoices themselves is not enough. The program has to remember which invoice it has already sent, and it must not simply create it again on a new attempt. If no answer comes, it first checks whether the invoice is already in the accounting system.

How exactly this works depends on the interface to your accounting system or another destination system. So agree with your provider how they make sure each invoice is created only once, what happens with a repeated delivery and how they reconcile with the destination system. A program that only reads text from invoices (OCR) does not solve this question.

Build a deliberate interruption into the test. Joost should then be able to see which invoice is in limbo, look it up in the accounting system and carry on without losing the original and without creating another invoice. If he has to delete records blindly to do that, the program is not ready to run without supervision.

06 / 09

How do you measure protection and review burden?

To measure how well the program protects you, count three things separately: how many real repeats the program found, how many duplicate invoices it missed and how many genuine invoices it held by mistake. Many hits sound good, but they can also mean that the rules raise suspicion too easily. Also look at how long Joost needs on average to clear a case and how old the open holds are.

For the review, Joost needs a screen of his own on which it is clear who is responsible. There he picks a clear decision with a reason for each suspicion: connected, separate invoice, corrected version or still unresolved. When he releases a suspicion, it should be possible to understand later why. Do not delete invoices or other documents automatically just because a rule found a similarity.

You can start this week. Begin with the routes by which most invoices come in, at the beverage wholesaler the invoice mailbox. Include invoices that are already posted and those still waiting for approval. The goal is protection against processing an invoice twice that Joost understands, that still lets genuine invoices through quickly and keeps corrections and their history visible.

07 / 09

For your IT team

Store your own standardised comparison values next to the original values. You can standardise spaces and upper and lower case for search. But do not remove leading zeros and meaningful parts of the number without thinking. Going too far here can make different invoices look the same.

Against technical retries, you need a stable identifier for each case and controlled retry logic, in addition to checking the documents. A typical cause is a timeout that runs out after the destination system has already created the invoice. Store the status before handover and the identifier from the destination system after confirmation. If the answer is missing, first establish whether the invoice already exists in the destination system. A retry must not automatically trigger a new record.

Also test invoices that arrive at the same time. Two runs working in parallel must not both decide, based on an outdated query, that the invoice "does not exist yet".

08 / 09

Take the worksheet

Worksheet

Download the editable CSV table

LayerDetectsRemaining gap
File hashIdentical bytesSame invoice in another format
Business keySupplier and invoice number within tenantMissing or misread number
Similarity reviewSuspicious dates, amounts and linesWhether similar documents are actually duplicates

Columns to fill in, in the file: Your value / observation, Owner, Next action.

Download the editable CSV table (CSV). Add your own values, owners and open actions. This worksheet contains no measured client results.

09 / 09

These guides and service pages cover the decisions next to duplicate-invoice detection:

For a review of your workflow, start with a short description of how invoices run at your business today, the systems involved and typical exceptions. Discuss it with modernagents.

ShareEmail

Related reading

AI document processing

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

Robert Van Ysendyck · Founder & Managing Director