Article · Agents by Business Function

AI Invoice Processing: The Process Invoice by Invoice, From OCR to Posting

Arkatai 7 min

Processing an invoice looks trivial until you multiply it by thousands a month and discover that almost none of them arrive the same way. Different formats, different channels, lines that do not match the order, discounts agreed by phone, a delivery note that showed up two weeks before the invoice. AI invoice processing is not about reading the document — classic OCR already did that — but about deciding what to do with what is read. This article walks through the process invoice by invoice and marks where OCR falls short and what an agent’s judgment adds.

It is the most mature case within finance, which is why I treat it on its own. The full finance function — reconciliation, close, collections, expenses — is in AI in finance operations, and the catalog by function is in enterprise AI agents use cases. The background on what it means for an agent to operate a process rather than just read it is in AI agents in operations.

The process, step by step

Multichannel receipt

Invoices do not come through a single door. They arrive as PDFs by email, as scanned paper, through a supplier portal, sometimes embedded in the body of an email. The first job is to gather them all into a single flow, normalize the format, and log the entry. An agent watches the channels, captures each invoice, and pulls it into the process, without depending on someone forwarding the email to the right mailbox.

Data extraction

This is where classic OCR shows its limits. A template OCR reads the invoice from the supplier it knows and gets lost with the next format. It extracts text, not meaning. It hands you a string where the purchase-order number should be, but it does not know that field is the PO number if it sits somewhere other than expected.

An agent extracts by understanding, not by position: it identifies supplier, net, taxes, PO number and line items even when the layout changes, and when something does not fit, it flags it instead of inventing it. That is the first real difference: it does not fill gaps with plausible data. It flags the doubt.

Matching against order and delivery note

This is the heart of the process, and where the agent’s judgment pays for itself. Matching means checking that what the supplier bills lines up with what was ordered and with what was received. There are two modes:

  • Two-way matching: the invoice is compared against the purchase order. Is the supplier billing what was ordered, at the agreed prices? It fits services and purchases with no physical receipt.
  • Three-way matching: invoice, purchase order and goods-receipt note are compared. Was the same thing ordered, received and billed, in quantity and price? It is the standard control for goods, because it closes the gap between “I ordered it”, “it arrived” and “I am being billed”.

OCR gives you the invoice data, but matching requires cross-checking it against two other documents and judging whether the differences are tolerable. A rounding cent is not a discrepancy. One missing unit on the delivery note is. That is where a rigid flow breaks and an agent decides within the tolerances it has been given.

Handling discrepancies

When something does not match, the real work begins. The agent classifies the discrepancy — price difference, quantity difference, invoice with no order, pending delivery note — and acts on the rule: if it is within tolerance, it lets it through while documenting the adjustment; if not, it prepares the case and escalates it to the right person, with the three documents and the difference already flagged.

The value is not only detecting the discrepancy, which OCR can too if you program the comparison. It is preparing the resolution: gathering the context, proposing the likely cause, leaving the person a decision rather than an investigation.

Approvals

Every organization has its circuit: amounts a manager approves, others that go up to the director, spend that requires two signatures. The agent routes each invoice through the flow that applies under its rules, chases the pending approval, and does not let an invoice sit stuck in the inbox of someone on holiday with nobody noticing.

Posting

With the invoice matched and approved, the agent prepares the entry — account, cost center, taxes — and records it in the system, leaving a trace of every step: what it read, what it matched it against, which rule it applied, who approved. That record is what lets you audit later without reconstructing anything by hand.

Where classic OCR falls short and what the agent adds

It pays to be precise, because OCR is not useless: it is a component. What fails is asking it to be the whole process.

TaskClassic OCRAgent
Read text from the invoiceYes, if the format is knownYes, and tolerates new formats
Understand which field each value isBy position; fragileBy understanding; robust
Match against order and delivery noteOnly if the exact rule is programmedJudges tolerances and edge cases
Decide what to do with a discrepancyNo; it stops or failsClassifies, resolves or escalates with context
Leave a trace of the decisionLogs what it readLogs what it decided and why

The line I use with boards is short: OCR reads, the agent decides. A project that confuses the two ends up with a very good reader and a process that still depends on a person reviewing invoice by invoice.

Classic OCRAgentReads text from a known formatTolerates new formats, no templateJudges tolerances in matchingStops at the discrepancyOCR reads; the agent decides
Where they split: OCR reads known text and stops at the discrepancy; the agent tolerates new formats and judges whether the difference against order and delivery note is tolerable.

What it takes to put it in production

Three layers, the same as any operation with agents. Permissions bound up to what amount the agent posts without approval and what it must never touch, as I set out in AI agent permissions and controls.

PERIMETER IN ACCOUNTS PAYABLEAGENTReadsinvoice · order · GRNWritesaccounting entry✕ Forbiddenpayment · deletionhuman approvalabove the thresholdTRACE · every invoice reconstructable
The perimeter in accounts payable: the agent reads the three documents and writes the entry; payment and deletion stay out, and above the threshold posting asks for approval.

Escalation decides which discrepancies go up to a person and with what context. And audit: every invoice leaves a reconstructable trail, which I cover in auditing AI agent decisions. Before it gets real work, its quality is measured against known cases, as I describe in AI agent evaluation.

Frequently Asked Questions

How is AI invoice processing different from ordinary OCR?

OCR reads text from the document. An agent understands what each value means, cross-checks it against the order and the delivery note, judges whether the differences are tolerable, and decides what to do with the ones that are not. OCR is a component of the process, not the process. The difference shows precisely in the exceptions, which is where the real work lives.

What is two-way and three-way matching?

Two-way matching compares the invoice with the purchase order: is what was ordered being billed, at the agreed prices? Three-way matching adds the goods-receipt note: was the same thing ordered, received and billed? Three-way is the standard control for goods because it closes the gap between what was ordered, received and charged.

Can an agent post invoices without supervision?

Yes, within limits you set: amounts below a threshold with a clean match can post on their own. Above that, or on any discrepancy, it escalates to a person. You start with heavy supervision and loosen it where the data proves reliability, never on faith on day one.

Does it work if my suppliers send invoices in very different formats?

That is precisely the case where an agent beats template OCR. It extracts by understanding, so it tolerates new formats without configuring a template per supplier, and when a value does not fit it flags it instead of inventing it. The variety of formats stops being the bottleneck.