Accounting Operations Track 1: AP intake with AI: three-way match and coding

Published by

on

The Pragmatic CFO: practical finance for the AI era

TL;DR Three-way match is a short list of rules: a real PO, goods received, price within tolerance, freight only when the PO allows it. An AI can apply those rules to every invoice line and draft the hold notes, but the receiving record is the evidence and a person releases every hold. In this lesson you work Larkspur’s 20 invoices for the week: 5 holds worth $19,649.00, one coding fix, and one near miss that should be approved, not held.

What you’ll practice

  • Writing the match rules and the price tolerance so the AI applies them the same way to every line.
  • Coding non-PO invoices from a rules table, including the one rule that overrides the vendor default.
  • Having the AI draft the hold reason and the question for the vendor or buyer, while a person decides and sends.

Time: about 35 to 45 minutes. You need the free Accounting Operations Track workbook (Excel) and any AI assistant that can read an uploaded spreadsheet. Larkspur Supply Co. is a made-up four-branch distributor, and every vendor, invoice and amount in the file is invented, so it is safe to upload.

Three-way match, written as rules

Three-way match compares the purchase order (what we agreed to buy, at what price), the receiving record (what arrived) and the invoice (what the vendor wants paid). The invoice is paid only when all three agree.

Written down, the match becomes rules an AI applies the same way to every line. Larkspur’s:

  1. The PO must exist and be for the same vendor. A PO number that is not in the PO file is a hold, even if a near match is obvious.
  2. Quantity billed cannot exceed quantity received. No receipt at all is a hold.
  3. Price within tolerance. The unit price is an exception only when it is more than 1% off the PO and the dollar variance on the line is more than $25.
  4. Freight only when the PO says “Freight billed”. Freight on a “Freight included” PO is an exception.
  5. Non-PO invoices are coded from the coding rules table. One rule overrides every vendor default: a single item of equipment costing $5,000 or more goes to 1500 Fixed assets.

Why two tests? A 1% test alone flags a $3 variance on a small order; a dollar test alone lets a 10% overcharge through on a cheap item. Both together keep the hold list short enough that people work it.

The receiving record is the evidence; the invoice is a claim. If the AI reasons “the vendor billed it, so it probably shipped”, the match has failed. No line in 1c_Receipts means not received until the branch says otherwise.

This extends Workbench Lesson 4: duplicate invoices and the bank reconciliation. That lesson catches the same invoice twice; this one catches the right invoice with wrong numbers.

The data

Sheet 1_AP_Inbox has the 20 invoices received the week of November 16, 2026, with PO number, quantity, unit price, freight and total. Fourteen carry a PO number and six do not. Sheet 1b_POs has 14 purchase orders with quantity, unit price, freight terms, GL account and branch. Sheet 1c_Receipts has 13 receiving lines. Sheet 1d_Coding_Rules has the default GL account for each non-PO vendor, plus the capitalization rule.

The prompts use the five-line format from the Workbench setup lesson: JOB, DATA, RULES, OUTPUT, PROOF.

Step 1: Match every PO invoice

JOB: You are an AP specialist running three-way match on this week's invoices before AP manager review.
DATA: Sheets 1_AP_Inbox, 1b_POs and 1c_Receipts in the attached workbook. USD, to the cent.
RULES: Work only the invoices that have a PO number. For each one: (1) the PO number must exist in 1b_POs and the vendor must match; if the PO is not found, say so and list any PO for the same vendor, item, quantity and price as a POSSIBLE match only, never as a correction. (2) Qty billed must be <= qty received in 1c_Receipts; no receipt line means not received. (3) Price is an exception only if the unit price differs from the PO by more than 1% AND (billed price minus PO price) x qty billed is more than $25. (4) Freight on a PO marked "Freight included" is an exception. Check every rule on every invoice and report every failure, not just the first. Do not assume goods arrived because they were billed.
OUTPUT: One table, all PO invoices: invoice ID, vendor, PO, qty billed, qty received, billed price, PO price, price variance % and $, freight, freight terms, status (CLEAR or HOLD), reason. Then a list of holds with the dollar amount at issue for each.
PROOF: State how many invoices you read in total and how many had a PO (20 and 14). Show the price variance arithmetic for every invoice where billed price differs from PO price, including any that pass.

The last PROOF line makes the AI show near misses too, so you can see a small variance was tested and passed, not skipped. The rules line also asks for every failure, because an invoice can be short-shipped and overpriced at once.

Step 2: Code the non-PO invoices

Non-PO invoices skip the match, so the control is coding. Each vendor has a default account, and the trap is a default that is wrong for one particular invoice.

JOB: You are an AP specialist coding non-PO invoices for approval.
DATA: Invoices in 1_AP_Inbox with no PO number, and sheet 1d_Coding_Rules.
RULES: Code each invoice to the vendor's default GL account in 1d_Coding_Rules. Then apply the "Any vendor" rule: if the description shows a single item of equipment costing $5,000 or more, code it to 1500 Fixed assets instead, whatever the vendor default. An invoice total over $5,000 is not enough by itself: it must be one item of equipment. Apply any branch split in the Note column.
OUTPUT: Table: invoice ID, vendor, description, amount, default GL, final GL, branch split, and a one-line reason wherever final differs from default.
PROOF: Confirm you coded 6 invoices and that any split adds back to the total. For every invoice over $5,000, say why it is or is not capitalized.

Step 3: Draft the hold reasons and the questions

A hold with no question attached sits until the vendor calls. Each hold should go out the same day with one question to the person who can answer it: the vendor for a billing error, the buyer for a PO problem, the branch for a missing receipt.

JOB: You are an AP specialist writing hold notes for the AP manager to review and send.
DATA: The hold list from Step 1.
RULES: For each hold, write: the hold reason in one sentence with the numbers; who should answer (vendor, buyer or receiving at the branch on the PO); and a short, polite draft message to that person asking one specific question. Use only facts from the workbook. Do not promise a payment date. Do not change any PO number, quantity or price yourself. These are drafts: a person reviews and sends them.
OUTPUT: One block per hold: invoice ID, amount held, reason, recipient role, draft message (under 80 words).
PROOF: Confirm the held total equals the sum of the held invoice totals, and that every hold from Step 1 has a note.

The kind of draft you want back, for Lumen (made up, like the file):

Hello, your invoice LL-11902 dated November 14 includes $180.00 of freight. Our PO-4408 is freight included. Could you send a credit memo for $180.00 or a revised invoice for $4,248.00? We will process it as soon as it arrives. Thank you, Larkspur Accounts Payable

The AP specialist checks it against the PO and sends it. The AI sends nothing.

What a good answer looks like

Show the answer key

The inbox: 20 invoices totaling $87,332.97: 14 with a PO, 6 without.

Holds (match exceptions)

InvoiceVendorTotalReasonAsk
AP-71204Foothill Electric Supply4,455.00Price 148.50 vs PO 142.00: +4.6%, 195.00 over POBuyer: was a price change approved? If not, vendor credit of 195.00
AP-71205Granite Tool Works4,725.00Billed 25 drill kits, received 20: 5 units (945.00) not receivedVendor: ship the 5 or send a credit memo; branch: confirm the count
AP-71208Lumen Lighting Wholesale4,428.00Freight 180.00 billed on a freight-included POVendor: credit memo for 180.00 or revised invoice for 4,248.00
AP-71212Atlas Fasteners2,496.00No receipt for PO-4412: goods not receivedReceiving at the East branch: did the anchor bolts arrive?
AP-71213Delta Safety Products3,545.00PO-4431 does not exist. PO-4413 has the same vendor, item, qty 25 and price 138.00, and was receivedBuyer: confirm PO-4413 is the right PO before anyone re-keys it

Total on hold: $19,649.00. Some teams pay the 20 drill kits that arrived (3,780.00) and hold only the 5 missing; that is a policy choice for the AP manager. The key holds the whole invoice.

Clear to approve: 15 invoices totaling $67,683.97: AP-71201, AP-71202, AP-71203, AP-71206, AP-71207, AP-71209, AP-71210, AP-71211, AP-71214, AP-71215, AP-71216, AP-71217, AP-71218, AP-71219 and AP-71220. Check: 19,649.00 plus 67,683.97 is 87,332.97.

The false positive to avoid: AP-71209 Northstar Abrasives billed 22.80 against a PO price of 22.75. That is +0.2%, or 7.50 on 150 boxes. It fails neither test. Approve it. An AI that holds it has applied “any price difference” instead of your tolerance.

Freight that is fine: AP-71203 Delta (145.00) and AP-71207 Keystone (210.00) bill freight on “Freight billed” POs.

Coding the non-PO invoices

InvoiceVendorAmountFinal GL
AP-71215Bluegrass Power & Light4,318.626200 Utilities, North branch
AP-71216Pinecrest IT Services6,250.006500 Software and IT
AP-71217Apex Legal LLP3,480.006600 Professional fees
AP-71218Meridian Fuel Services11,742.356300 Vehicle and fuel
AP-71219Keystone Hydraulics7,895.001500 Fixed assets (default was 6310 repairs)
AP-71220Evergreen Janitorial5,600.006100 Rent and occupancy, 1,400.00 to each of the four branches

AP-71219 is one electric pallet jack at $7,895.00. The vendor default books it as a repair; it is equipment over $5,000, so it is capitalized. A coding fix, not a hold: it stays in the 15 to approve. Meridian (11,742.35), Pinecrest (6,250.00) and Evergreen (5,600.00) are also over $5,000, but none is a single item of equipment, so none is capitalized.

Where AI goes wrong on this task

Our view of the usual failure points:

  • “Fixing” the PO number. The model finds PO-4413 with the same item, quantity and price and quietly matches to it. It is probably right, which is the danger: the buyer confirms, because the same goods can also be billed twice.
  • Trusting the invoice over the receipt. The Atlas invoice looks normal in every way. It is a hold because nothing was received, and only the branch can change that.
  • Holding inside tolerance. Flagging the 7.50 Northstar variance trains your team to ignore the hold list. State both tests and make the AI show its arithmetic.
  • Reading “over $5,000” as “capitalize”. The fuel bill is the biggest non-PO invoice in the file. It is an expense. The rule is about one item of equipment.

What stays with a person

The AI matches, codes and drafts. The AP manager approves the clear list, owns the holds and decides policy questions such as paying for partial receipts. The buyer confirms PO problems, the branch confirms receipts, and the AP specialist sends every message. The controller owns the capitalization policy and signs off on additions like the Keystone pallet jack. If you are looking at dedicated tools for this step, see our guides to AI accounts payable software and AI agents for AP and expenses.

Check yourself

Northstar billed 22.80 against a PO price of 22.75. Hold or approve?

Approve. The variance is +0.2% and 7.50 in total. Larkspur’s rule needs both more than 1% and more than $25 before it is an exception.

Why is the Delta invoice on hold when PO-4413 obviously matches it?

Because the invoice cites PO-4431, which does not exist. The AI can point to PO-4413 as a possible match. The buyer confirms it, and only then does AP re-match the invoice.

The Keystone pallet jack invoice has no PO. Is it a hold?

No. The fix is the account: 1500 Fixed assets instead of the 6310 default, because it is one item of equipment over $5,000.

What is the evidence that goods arrived?

The receiving record in 1c_Receipts. Not the invoice, not the vendor’s word and not the AI’s inference. PO-4412 has no receipt line, so the Atlas invoice is held.

Who sends the hold note to Lumen?

A person on the AP team, after checking it. The AI only drafts.

Your turn: try it on your own data

Export a week of invoices, the POs and receiving lines behind them, and your coding defaults. Put your own tolerance in the RULES line and run the three prompts. Invoices are internal data and bank details never belong in an upload: check the data zones in the Workbench setup lesson and use your company-approved tool before you start.

Next: Accounting Operations Track 2: Review the weekly payment run with AI

New here? Start here to find the best guide for your job, or use the free finance templates, the CFO metrics library and the CFO moves tracker.