← Back to journal
AI and Accounting

AI Invoice Processing: A Three-Way Match You Can Audit

A confidence score is not a three-way match. What AI invoice processing should record for every match, how to set price and quantity tolerances, a worked example and the SQL that reruns it.

Cover image on a cream background with the headline "AI invoice processing: a three-way match you can audit", four cards showing a purchase order for 200 units at $18.50, a receipt for 180 units, an invoice for 200 units at $18.90 and rule 3WM-02 v4 returning a hold on quantity and price, plus Ardent Partners' 2025 average cost per invoice of $12.42 against $2.65 for best-in-class teams.
Short answer

In AI invoice processing, let AI read invoices and map invoice lines to purchase order lines, then let fixed tolerance rules compare the invoice, the PO and the receipt. Each match should record the source file, extracted fields, matched lines, the tolerance rule and version, the result and the reviewer.

"Matched, 97% confidence" is not something an auditor can test. A three-way match is three documents, a set of tolerances and a decision, and AI invoice processing should hand you all of them for every invoice it clears.

TL;DR: In AI invoice processing, let AI read invoices and map invoice lines to purchase order lines, then let fixed tolerance rules compare the invoice, the PO and the receipt. Each match should record the source file, extracted fields, matched lines, the tolerance rule and version, the result and the reviewer.

What is a three-way match in accounts payable?

A three-way match compares a vendor invoice with the purchase order and the receiving record, line by line, on item, quantity and price, before the invoice is approved for payment. If all three agree within tolerance, the invoice can be paid. If not, it goes on hold as an exception.

  • Two-way match: invoice against PO only. Common for services, where there is nothing to receive.
  • Three-way match: invoice against PO and receipt. The standard for goods.
  • Four-way match: adds an inspection or quality record to the three-way match.

The receipt is what makes the three-way match a fraud and error control. It proves you got what you are being billed for. In the ACFE's 2024 study of 1,921 occupational fraud cases, billing schemes appeared in 22% of cases, with a median loss of $100,000 (ACFE, Occupational Fraud 2024: A Report to the Nations).

Where does AI help in invoice processing, and where should it stop?

The slow parts of a match are reading and mapping, not comparing. That is where AI earns its place:

  • Extraction: reading vendor name, invoice number, dates, line descriptions, quantities, unit prices, tax and freight from a PDF or email.
  • Line mapping: working out that "SS Hex Bolt M8x40 (box/100)" on the invoice is PO line 3, "Bolt, stainless, M8 x 40mm, 100 ct".
  • Exception notes: drafting a plain-language reason for a hold, linked to the lines that caused it.

The comparison itself should not be a model's judgment. Once the lines are mapped, "is the price within 2%" is arithmetic. The match decision should come from a versioned tolerance rule, so the same invoice, PO and receipt always give the same result. A confidence score can tell a reviewer where to look. It should not be what releases a payment.

Cost is why teams automate. Ardent Partners' State of ePayables 2025, based on 204 AP and finance leaders, puts the average cost to process an invoice at $12.42, against $2.65 for best-in-class teams (Ardent Partners via Tradeshift, June 2025). Ardent also reports that best-in-class AP teams flag only 9% of invoices for issues, less than half the rate of their peers (Ardent Partners, Payables Place). Those are analyst survey figures; your own baseline is what counts.

What should every AI invoice match record?

If an auditor picks one paid invoice, you should be able to show how it was matched without rerunning anything by hand. This is the record to keep:

Checklist of ten fields every AI three-way match should record, grouped into source, extraction, match and decision, from the source file hash and extracted fields with page location to the tolerance rule version, result, reviewer and timestamp
  • Source: the original invoice file, a hash of it, and when and how it arrived.
  • Extracted fields: each value with where it came from on the page and the extraction confidence.
  • Corrections: any field a person changed after extraction, with the old value, new value and who changed it.
  • Line mapping: which PO line each invoice line was mapped to, and why (item code, description match or a person's choice).
  • Receipt: the receiving record ID, date and quantity received.
  • Comparisons: quantity billed vs received, unit price billed vs PO, with the variance in dollars and percent.
  • Tolerance rule: the rule ID and version that was applied.
  • Result: matched, held, or partially matched, with the reason code.
  • Reviewer: who approved an exception or override, what they decided and why.
  • Timestamps: extraction, match, approval and payment release.

An auditable match is one where every input, rule and decision behind a payment can be retrieved and rerun. Our AP automation audit-trail checklist covers the wider AP process, including approvals and vendor changes.

Want every match to come with the source rows, the rule and the SQL behind it? Join the Yoraito waitlist for early access.

How should you set three-way match tolerances?

Tolerances are policy choices. Write them down, version them, and limit who can change them. The values below are examples to adapt, not benchmarks.

  • Unit price: invoice price within 2% or $50 per line of the PO price, whichever is lower. Above that, route to the buyer.
  • Quantity: quantity billed must not exceed quantity received. Short billing can pass; over billing holds.
  • Freight: match to PO freight terms. Unplanned freight above a set dollar amount holds.
  • Tax: recalculate from the ship-to address and compare. Differences above a few dollars hold.
  • Invoice total: a hard cap on total variance per invoice, so many small line variances cannot add up unnoticed.
  • No PO: invoices without a PO route to the requester, never to auto-approval.

Percent tolerances alone let large invoices through with large dollar variances. Pair every percent with a dollar cap.

What does a worked three-way match look like?

Here is an illustrative example. PO 4512 orders 200 units at $18.50. The receiving dock logs 180 units. The invoice bills 200 units at $18.90.

Worked three-way match card comparing PO 4512 for 200 units at 18.50 dollars, a receipt for 180 units and an invoice for 200 units at 18.90 dollars, showing a quantity fail, a 2.16 percent price variance above a 2 percent tolerance, an invoice total of 3,780 dollars against a matched value of 3,330 dollars, and a hold
  • Quantity: billed 200, received 180. Over billing by 20 units. Fail.
  • Price: $18.90 against $18.50 is a $0.40 variance, 2.16%. Above the 2% tolerance. Fail.
  • Invoice total: 200 x $18.90 = $3,780.
  • Matched value: 180 received x $18.50 PO price = $3,330.
  • Difference: $450, of which $378 is the 20 billed-but-not-received units at the invoice price and $72 is the price variance on the 180 received units.
  • Result: hold. Quantity goes to receiving, price goes to the buyer. If both are resolved in the vendor's favor the invoice pays in full; otherwise the vendor issues a credit or a corrected invoice.

The same match as a query, so the result can be rerun later:

-- Rule 3WM-02 v4: qty billed <= qty received;
-- unit price within 2% or $50 per line, whichever is lower
SELECT i.invoice_id,
i.line_no,
p.po_id,
p.po_line,
i.qty AS qty_billed,
r.qty_received,
i.unit_price,
p.unit_price AS po_price,
ROUND((i.unit_price - p.unit_price) / p.unit_price * 100, 2) AS price_var_pct,
CASE -- first failing check wins
WHEN i.qty > r.qty_received THEN 'HOLD_QTY'
WHEN ABS(i.unit_price - p.unit_price) * i.qty
> LEAST(0.02 * p.unit_price * i.qty, 50) THEN 'HOLD_PRICE'
ELSE 'MATCHED'
END AS match_result
FROM invoice_lines i
JOIN line_mapping m ON m.invoice_id = i.invoice_id AND m.line_no = i.line_no
JOIN po_lines p ON p.po_id = m.po_id AND p.po_line = m.po_line
JOIN (SELECT po_id, po_line, SUM(qty) AS qty_received
FROM receipt_lines GROUP BY po_id, po_line) r
ON r.po_id = p.po_id AND r.po_line = p.po_line;

The line_mapping table is where AI does its work. Everything after the join is a fixed rule.

How do you review match exceptions without slowing payments?

  • Route by exception type. Quantity holds go to whoever owns receiving, price holds to the buyer, no-PO invoices to the requester.
  • Set a response time. Give each route a due date so exceptions do not age past the vendor's payment terms.
  • Require a reason for every override. "Approved" is not a reason. "Vendor price increase agreed by email on Oct 12, PO updated" is.
  • Check AI extractions before they reach the ledger. Misread quantities and prices are the main AI risk here. Our post on catching AI errors before they reach the general ledger covers the controls.
  • Set thresholds for human review by amount and vendor risk. See our guide to human-in-the-loop review thresholds.

What will auditors test in an AI-assisted AP process?

  • Tolerance configuration: the current rules, their change history and who approved each change.
  • Reperformance: for a sample of paid invoices, can the match be rerun from stored inputs and give the same result?
  • Overrides: every override above tolerance, with approver and reason.
  • Extraction accuracy: how AI-extracted fields are checked, and how corrections are logged.
  • Access: who can change tolerances, vendor master data and payment release, and whether those duties are separated.

For the fields an AI system should log across every action, see our AI audit trail checklist.

FAQ

What is the difference between two-way and three-way matching?

A two-way match compares the invoice with the purchase order. A three-way match adds the receiving record, so you confirm the goods arrived before paying. Two-way is common for services; three-way is standard for physical goods.

What is a typical three-way match tolerance?

There is no single standard. Many teams set a small percentage for unit price paired with a dollar cap per line, and allow no over billing on quantity. Set tolerances in a written policy and record each change.

Can AI fully automate three-way matching?

AI can automate the slow parts: reading invoices and mapping invoice lines to PO lines. The comparison should run as a fixed tolerance rule, and exceptions and overrides still need a named reviewer.

What happens when an invoice fails a three-way match?

It goes on hold with a reason code. The exception routes to receiving, the buyer or the requester depending on the cause, and is resolved by a corrected invoice, a credit note, an updated PO or an approved override with a reason.

What is the next step?

Pull ten paid invoices from last month and try to show, for each, which PO line and receipt it matched and which tolerance applied. Any invoice where you cannot answer that is where to start. To hear when Yoraito opens up, join the waitlist.