In brief
An AI Worker matches an invoice to the purchase order and goods receipt the way an experienced accountant does, only on every single invoice. It links each invoice line to the order line and the receipt, compares quantity, price and unit of measure, and checks whether any difference falls within the thresholds the company has set. Confident matches are prepared for posting. Partial deliveries, substitutes and price differences are described and left to a person to decide.
Three documents, three questions
Three-way matching is a control that answers three questions at once:
| Document | Question | Where it lives |
|---|---|---|
| purchase order | did the company order this, and at what price | ERP, purchasing module |
| goods receipt (PZ) | did the goods arrive, and in what quantity | ERP or warehouse system |
| invoice | how much the supplier wants for it | KSeF (Poland's national e-invoicing system) or the invoices@ mailbox |
An invoice paid without an order is a purchase outside control. An invoice paid without a receipt risks paying for goods that never arrived. An invoice with a price higher than the order is money the company loses quietly if nobody compares them. With a few dozen invoices a month, an accountant does this. With several hundred, each with many lines, the check turns into spot checks.
Matching step by step
The Purchase invoice checker from DYNAMINDS Labs works through an invoice in a fixed order.
- Header. It looks for the order by the number on the invoice. Suppliers often put it in the notes or in a line description, sometimes with a typo. When there is no number, it searches the supplier's open orders for matching items.
- Lines. It links each invoice line to an order line. The supplier's item name rarely matches the ERP item code, so the AI Worker uses the supplier's code, the EAN barcode, the history of earlier invoices and the item description.
- Receipts. For each line it finds goods receipts that have not yet been settled against another invoice.
- Comparison. It compares the invoiced quantity with the received quantity and the invoiced price with the order price, after converting units of measure.
- Result. Each line gets one of three results: matched, matched within tolerance, or discrepancy.
An invoice is ready for posting only when every line is matched or within tolerance. One line with a discrepancy holds the whole invoice.
Cases that break simple matching
Simple rules such as "order number plus amount" work for simple, complete deliveries. The rest are situations an accountant recognizes from experience, and an AI Worker needs them written down in its rules card.
Partial delivery. 1,000 m of cable was ordered, 600 m arrived and the invoice is for 600 m. That is a match, and the order stays open for 400 m. The next invoice for 400 m has to go against the next receipt, not the same one.
One invoice, several receipts. The supplier invoices all deliveries once a week. The AI Worker adds up the week's receipts and compares them with the invoice lines.
Different unit of measure. The order is in packs of 50, the invoice in pieces, the receipt in kilograms. Without a conversion factor from the item master, the comparison is meaningless. A missing conversion factor is a separate discrepancy to fix in the ERP.
Substitute. The supplier shipped a different item that serves the same purpose. Invoice and receipt agree, but the order does not. The AI Worker does not accept the substitute on its own, because that is a decision for purchasing or a process engineer.
Extra charges. Freight, returnable packaging, a fuel surcharge. When they are not on the order, the AI Worker checks the supplier's terms and marks the line as "cost outside the order".
Correction. The supplier issues a corrective invoice after a claim. The AI Worker links it to the original invoice and checks whether the correction equals the agreed difference.
A separate risk is the same invoice arriving twice, once through KSeF and once by email as a PDF. How to catch such cases is covered in Duplicate invoices and double payments.
Tolerance thresholds: who sets them and how
A tolerance threshold is the limit below which a difference does not hold an invoice. The finance team sets it together with purchasing, and the AI Worker only applies it. An example threshold table for a manufacturer:
| Type of difference | Example threshold | What happens above the threshold |
|---|---|---|
| unit price | up to 0.5% and no more than PLN 50 per invoice | list for purchasing with the difference calculated |
| quantity for items counted in pieces | 0 | list for warehouse and purchasing |
| quantity for weighed or measured items | up to 2% | list for warehouse |
| VAT rounding on the invoice | a few cents | list for the accountant |
| costs outside the order | 0 | list for purchasing |
The figures in the table are an example for discussion, not a recommendation. A threshold set too low buries the team in trivia. A threshold set too high lets through systematic overpricing by a fraction of a percent. That is why in a pilot it is worth counting how many invoices each threshold option would hold, using data from recent months.
What reaches a person and in what form
A discrepancy without context is just another thing to investigate. The AI Worker describes it so that the decision takes a moment. An illustrative example:
invoice: FS/2026/1187, supplier: bearing manufacturer
line 3: bearing 6204, invoice PLN 4.85/pc, order PLN 4.60/pc
quantity: 200 pcs, matches PZ/11/0398
difference: PLN 50.00, above threshold
context: last 6 invoices from this supplier at PLN 4.60; no price list change in ERP
proposal: price claim or price list update, purchasing decidesThe final decision belongs to a person: a claim to the supplier, accepting the new price or holding the payment. The AI Worker can draft the claim, but someone from purchasing sends it. The log shows who accepted a difference and when, which helps in the annual supplier review.
Matching relies on ERP data: orders, receipts, the item master and price lists. How to give an AI Worker safe access to that data is covered in AI Workers and ERP. The full day of work with KSeF invoices, from download to description, is shown in Processing KSeF e-invoices with an AI Worker.
Questions and answers
What if the company does not raise purchase orders for every purchase?
Then three-way matching covers only part of the invoices, usually goods and materials. Services and overheads without an order follow another path: a manager's approval and cost coding. The AI Worker recognizes which path an invoice should take and does not look for an order where the company does not require one.
Do goods receipts have to be entered on time?
Yes, it is a condition for a good result. If the warehouse enters receipts with a delay of several days, the invoice lands on the "no receipt" list even though the goods are on the shelf. The AI Worker can recheck such invoices every few hours, but the better fix is to shorten the time it takes to enter receipts.
How long does it take to prepare for this kind of matching?
Most of the work is writing down thresholds, exceptions and unit conversions. A pilot at DYNAMINDS Labs usually takes 4 weeks on the company's invoices, orders and receipts from recent months. It shows how many invoices pass without comments and how many stop at each type of discrepancy.
Can the AI Worker correct the price on the order by itself?
No. Changing a price on an order or in a supplier's price list is a purchasing decision. The AI Worker shows the difference and the supplier's price history and proposes what to do. A person with permission to change purchasing terms makes the change in the ERP.