In brief
Duplicate invoices are caught at four points: invoice entry, matching to the goods receipt, the payment batch and the bank statement. KSeF, Poland's national e-invoicing system, rejects an invoice with the same seller tax ID, type and number, but it will not stop the same invoice keyed in again from a PDF, an invoice reissued under a new number, or a full payment on top of a down payment. An AI Worker compares documents by content, not only by number, and hands suspect pairs to a person.
What KSeF solves and what it does not
Since domestic invoices started going through KSeF, part of the problem has gone away. The system checks uniqueness on three fields: the seller's tax ID, the invoice type and the number assigned by the seller. If such an invoice is already in the system, the new one is rejected with error code 440 ("Duplikat faktury", duplicate invoice). The check covers 10 full years from the end of the year of issue.
That protects you from one case: a seller sending the same invoice twice. The other cases that end in a double payment happen on the buyer's side, or involve what are formally two different documents.
| Case | Why KSeF will not stop it | How to recognize it |
|---|---|---|
| the same invoice from KSeF and from a PDF email, entered twice | the second copy was created in the ERP, not in KSeF | same tax ID, amount and date, number written differently ("FV/11/015" and "FV 11 15") |
| the seller reissued the invoice under a new number instead of a credit note | the numbers differ | same lines, quantities and purchase order |
| down-payment invoice and final invoice, with the full final amount paid | two valid invoices | the final invoice does not deduct the down payment, or the payment ignores it |
| pro forma paid, then the invoice paid again | a pro forma is not an invoice | one transfer referencing the pro forma, another the invoice number |
| foreign PDF invoice sent to two addresses | it does not go through KSeF | same number and amount from two mailboxes |
| the same supplier in two ERP vendor records | payments go to two "different" vendors | same tax ID or bank account in two records |
Four control points
- Invoice entry. Before the invoice is saved in the ERP, it is compared with documents from recent months: same tax ID, same gross amount, a nearby date, and the number after normalization (no slashes, spaces or leading zeros). The output is not "duplicate or not" but a list of pairs with a reason.
- Matching to the purchase order and goods receipt. A second invoice for the same goods finds no open quantity on the goods receipt, because the first invoice has already used it. This is the strongest signal, because it does not depend on the number or the format.
- The payment batch. Before the batch goes out, check whether the batch or the transfers from the last 30 days already contain the same amount to the same account with a similar reference.
- The bank statement. After the fact you see two payments against one invoice, or a credit balance on the supplier's account. This is where prevention ends and recovery begins.
The earlier, the cheaper. A duplicate caught at entry costs one click, while a double transfer means writing to the supplier, waiting for a refund or agreeing to offset it against the next payment.
Why a simple ERP rule is not enough
Most ERP programs block a second invoice with the same number from the same supplier. The trouble is that duplicates rarely carry an identical number. Someone retyped it from a PDF with a typo, the supplier changed its numbering, or a foreign invoice reads "INV-2026-0451" in one email and "2026/0451" in another.
A rule based on amount and date has the opposite problem: a service provider bills the same amount every month, and each invoice looks like a duplicate of the last. After a week the team stops reading the warnings.
An AI Worker looks at the content: which lines, which purchase order, which period. The October subscription and the November subscription have the same amount but a different period in the text, so they do not make the list. A "reissued" invoice has a different number but the same lines and the same order, so it does.
How it works with an AI Worker
The Purchase invoice checker downloads invoices from KSeF and the invoices@ mailbox, checks the tax ID, prices, quantities and payment terms, then matches each invoice with the purchase order and goods receipt. An invoice that finds no open quantity on the receipt goes onto the discrepancy list with a note on what does not match (for example, quantity above what was received). Posting, and accepting an invoice without a goods receipt, stay with a person. Matching is covered in detail in Matching an invoice to the purchase order and goods receipt.
On the payment side, the Bank statement checker reads the statement, matches its items to invoices and flags underpayments, overpayments and duplicates. Refunding an overpayment and reposting are approved by a person. The statement process is described in Bank statement reconciliation. Some duplicates are removed at the source by the ERP master data keeper, which looks for duplicate vendors and proposes merges for approval.
A worked example: a company receives 900 cost invoices a month, and 15% arrive as PDFs outside KSeF. If one document in a hundred from that group gets into the ERP twice, there are one or two pairs to check every month. Not many, but a single double payment for a machine delivery pays for the control for years.
What to do when a duplicate has already been paid
- Check on the bank statement that both payments actually left, not just that they were ordered.
- Agree the refund method with the supplier: a return transfer or an offset against the next invoice. Keep the agreement in writing.
- Reverse the duplicate document in the ERP according to company rules, so the supplier balance shows the real overpayment.
- Add the case to the control's test set. Every duplicate caught after the fact is a pattern that should be stopped at entry next time.
How to measure the quality of such controls on a sample is covered in How to measure the quality of an AI Worker's work.
Questions and answers
Do duplicate invoices still happen after KSeF?
Yes, though less often. KSeF rejects a second invoice with the same seller tax ID, type and number, but it does not see a copy keyed in manually from a PDF, foreign invoices outside the system, or an invoice reissued under a new number. Those cases have to be caught on the buyer's side, at entry and at goods receipt matching.
Does the AI Worker delete or block a duplicate invoice by itself?
No. It points to a pair of documents with the reason, for example "same lines and same goods receipt as the invoice of November 4". Whether it is a duplicate, a correction or a separate delivery is decided by someone in finance, and the AI Worker records that decision in its log.
How do you avoid false alarms on recurring invoices?
Compare content, not only amount and supplier. An invoice for a subscription, rent or maintenance contains the billing period. A control that reads it tells the next month apart from a duplicate document, and the team does not get warnings it has to dismiss every week.
How much data do I need to see whether the problem exists at all?
An export of cost invoices and transfers from 6–12 months is enough. Comparing pairs by tax ID, amount and content shows how many suspect cases there were and how many ended in an overpayment. Such a review is a good first step of a pilot.