Three-way matching: the documents, and the fields the join runs on
In short
Three-way matching in accounts payable compares what you agreed to buy, what arrived, and what you are billed for. Mechanically it is a join across a purchase order, a goods receipt and an invoice, keyed on PO number, PO line, item, unit of measure, quantity, unit price, currency and tax treatment. Every field in that key is somewhere the join can fail.
Key takeaways
- The 3 documents assert different things: a commitment, a delivery, a claim for money.
- It is a join, and it needs a key all 3 documents carry at the same granularity.
- 8 fields do the work: PO number, PO line, item, unit of measure, quantity, price, currency, tax.
- Two-way drops the receipt, four-way adds an inspection. Same join, fewer or more assertions.
- The supplier never agreed to your key. That is why matching is structurally brittle.
Three-way matching compares three documents that each assert something different: the purchase order says you committed to a quantity at a price, the goods receipt says a quantity arrived, and the invoice says money is owed. A match means all three agree, line by line, on the same key.
Calling it a comparison undersells it. This is a join, and a join needs a key all three carry, spelled the same way, at the same granularity. Most of what an AP team experiences as a matching problem is that key missing on one side, ambiguous on another, or held at a different level on the third.
| Document | Written by | What it asserts | Fields it brings |
|---|---|---|---|
| Purchase order | Your buyer | You committed to a quantity at a price | PO number, PO line, item code, quantity, unit of measure, price, currency |
| Goods receipt | Your warehouse or acceptor | A quantity arrived on a date | PO number, PO line, received quantity, unit of measure, date |
| Supplier invoice | The supplier's billing system | An amount is owed, on terms | Invoice number, supplier identity, PO reference if quoted, quantity, price, tax |
Only one of the three is written outside your control, and it is the one carrying the money.
The 8 fields the key is built from
- PO number. The only field linking an invoice to a commitment, and one the supplier copies by hand. Without it the join has no left-hand side, which is where a non-PO invoice leaves you.
- PO line. Decides whether the match is line-level or header-level. Suppliers quote the number far more often than the line, so engines fall back to comparing totals.
- Item code. Yours, theirs, or free text. Resolving a supplier part number is an alias lookup living in the vendor master record.
- Unit of measure. Ordered in cases, billed in each: both quantities correct, neither comparable. That is unit-of-measure drift.
- Quantity. Compared cumulatively against prior receipts and prior billings, so 3 deliveries and 2 invoices need running totals on both sides.
- Unit price. Compared within an allowed variance, itself a rule object — see what an engine may wave through.
- Currency. A number without a currency is not a price. EUR on the invoice against GBP on the PO is a different quantity, not a variance.
- Tax treatment. Tax is calculated, not matched. Compare net and evaluate tax separately, or a reverse-charge line fails against a gross-billed one.
One line, joined: where the tuples stop lining up
PO 4501182, line 20: 40 cases of item ITM-4471, 12 units to a case, at 18.40 the case. The warehouse receives 40 cases. The supplier bills 480 units at 1.55. Every number is right; the join fails anyway.
| Field | PO line | Goods receipt | Invoice line | Verdict |
|---|---|---|---|---|
| PO reference | 4501182 / 20 | 4501182 / 20 | 4501182, no line | Header-level only |
| Item | ITM-4471 | ITM-4471 | 4471-C "Widget, 12pk" | Needs an alias table |
| Unit of measure | CS | CS | EA | Fails without a conversion factor |
| Quantity | 40 | 40 | 480 | Equal after conversion, not before |
| Unit price | 18.40 | not carried | 1.55 | Equal per unit, not per line |
| Line net | 736.00 | not carried | 744.00 | Out by 8.00, rounding 1.5333 to 1.55 |
Four failures, none of them anybody's mistake. The supplier billed in the unit it ships in, rounded to the precision its system holds, and quoted the reference a human typed. Each needs a rule.
A matching engine does not fail because someone was careless. It fails because two companies described the same delivery in their own vocabularies, and nothing in between translated.
Dropping the receipt, or adding an inspection
- Two-way match. PO against invoice, no receipt in the join. Right where nothing physical arrives — a consultancy day, a licence renewal — so the only assertions are the commitment and the claim.
- Four-way match. Adds an inspection or acceptance record, so the join proves goods arrived and were accepted. Right where those are separate events: a certificate of analysis, an engineer's sign-off.
These are not tiers of rigour. Each drops or adds an assertion, and the right one depends on which assertions exist in your process. A three-way match where nobody posts receipts produces a permanent exception queue, not a stronger control.
The supplier never agreed to your key
A matched invoice is not a paid one either. Matching establishes the obligation; the payment clock runs from a date chosen separately, as invoice date, received date or approval date argues. That gap between a recognised obligation and money that has moved reappears as ledger balance against available balance.
Matching is therefore a data-modelling problem before a model problem, which is how we scope AI agents and automation in finance: an agent acting on a key nobody validated is the failure in putting AI agents into production. The rest of invoice to pay: capture, matching and approvals covers either side of the join, and our finance operations work is mostly making the join possible before making it automatic.
Frequently asked questions
Short answers to the follow-ups this page tends to raise.
What is three-way matching in accounts payable?
It is the control that clears a supplier invoice only when a purchase order, a goods receipt and the invoice agree. The PO asserts what was committed, the receipt what arrived, the invoice what is owed. The match joins all three on the same line and checks quantity and price agree within an allowed variance; anything else becomes an exception rather than a payment.
What documents are needed for a three-way match?
Three: the purchase order, the goods receipt or service acceptance record, and the supplier invoice. All three must reference the same PO line, or the match degrades into a header-level comparison of totals that cannot say which line the variance came from.
What is the difference between two-way and three-way matching?
Two-way compares the invoice against the purchase order only; three-way adds the goods receipt. The distinction is not strictness but which assertions exist. Two-way suits services and licences where no receipt is posted. Without one you are confirming you agreed to spend the money, not that you received anything.
- accounts payable
- invoice matching
- purchase orders
- AP automation
The work behind this page
Builds from our portfolio that this page draws on.
Read next
- Non-PO invoices: what an automated flow can match them against insteadNo purchase order means no agreed quantity, price or delivery to join against. Four substitute commitments, in order of strength, and what each one lets a system clear.definition
- The vendor master record: the fields that decide whether an invoice can be automated at allSix field groups, four fields almost nobody has, and the reason one supplier ends up as five rows. Most AP automation failure is a vendor master problem wearing a matching costume.definition
- Tolerance rules: what a matching engine is allowed to wave throughOne global percentage leaks on high-value lines and screams on low-value ones. A usable tolerance carries a basis, a direction, a percentage-and-absolute pair, a supplier override and a cumulative cap.definition
- The same invoice got paid twice: finding the near-duplicate your check missedThe exact-match check passed because the second document differed in one of the three fields it compares. Five ways one bill becomes two, the fuzzy key that catches each, and where the sweep belongs.diagnostic
Working on something in this space?
Tell us where you are in a sentence or two. We'll tell you honestly whether we're the right team, and what a sensible first slice of the work looks like.
Start the conversation