Finance

AI agents for invoice processing: what works and what breaks

Reading an invoice is the easy part. Matching it, querying it and posting it safely is where the design effort goes.

An AI agent can read supplier invoices in any layout, match them to purchase orders and goods receipts, and draft the accounting entry for review. It breaks where the data behind it is poor, where the right action depends on a conversation, and where tax treatment varies. Payments and changes to bank details should stay with a person.

Invoice processing is a common first workflow for an agent, for good reason: the volume is steady, the steps are known and the cost of delay is visible. It is also a workflow where a careless design moves money by mistake.

What the agent does

  1. Reads the invoice, whatever its layout, and extracts supplier, amounts, tax and line items.
  2. Matches it to a purchase order and a goods receipt.
  3. Flags mismatches: a different amount, a missing order, a duplicate.
  4. Drafts the entry for the accounts system.
  5. Sends anything unusual to a person, with the reason.

What works well

Reading varied layouts is the part that has improved most. Current models can take a PDF as an image of each page together with the text extracted from it, so the model sees the tables, stamps and layout as well as the words. No template is needed for each supplier.

The output can also be held to a fixed shape. With structured outputs, the model's reply is constrained to a schema you define, so supplier, invoice number, tax and each line arrive in the same fields every time. That guarantees the shape, not the truth of the values. A misread digit still fits the schema. The next check therefore belongs to ordinary code: the lines must add up to the total, the tax must equal the rate applied to the taxable value, and the invoice number must not already exist for that supplier.

Matching against orders works well when the reference data is clean, and accounting systems already define the method. Microsoft's finance documentation describes two-way matching of invoice prices against purchase order lines, and three-way matching that also checks quantities against the product receipt, each within a tolerance the finance team sets. The agent should apply your existing matching policy and tolerances, not invent its own. Drafting the posting, with every field shown for review, saves the most time per invoice.

Who should do which step

StepBest done byWhy
Read the invoice into fieldsThe modelLayouts vary too much for templates
Check totals, tax arithmetic and duplicatesPlain codeExact rules, no judgement needed
Match to order and receiptYour matching policy, with the agent finding the right orderTolerances are a finance decision
Query a mismatch with the supplierAgent drafts, person sendsThe wording commits the business
Post the entryAgent drafts, person approves until limits are provenPosting leads to payment
Change a supplier's bank detailsA person, alwaysA known route for payment fraud

This split follows the rule in our comparison of agents, RPA and plain automation: rules do everything they can, and the model handles only what needs reading.

What breaks

  • Supplier records with duplicates or old bank details. Clean the supplier list before the pilot, not during it.
  • Invoices that refer to an order in words rather than by number. Let the agent propose a match and show its reasoning, and have a person confirm.
  • Partial deliveries, credit notes and disputes, where the right action depends on a conversation. Route these to a person with the documents attached.
  • Tax treatment that varies by supplier or place of supply. Keep the tax rules in your accounts system and have the agent flag differences, not resolve them.

Indian invoices: check the e-invoice details

For invoices from Indian suppliers, the GST e-invoicing system gives the agent something firm to check. Notification 10/2023 (Central Tax) brought taxpayers with aggregate turnover above five crore rupees into e-invoicing from 1 August 2023. A supplier in scope uploads each business-to-business invoice to the Invoice Registration Portal, which returns a unique Invoice Reference Number, a signed e-invoice and a QR code.

An agent can record the reference number, check that the QR code is present, and send the invoice to a person when a supplier you would expect to be in scope has sent one without them. The threshold has been lowered more than once, so confirm the current position on the official portal or with your tax adviser. This describes the system; it is not tax advice.

Where a person must approve

Reading and matching can run unattended. Posting should start on ask-first, with limits: under an agreed amount, from a known supplier, matching its order exactly. Changes to bank details should always go to a person.

That last rule guards against payment diversion, where a message that appears to come from a supplier asks you to pay a new account. The FBI's Internet Crime Complaint Center advises businesses to verify any request to change account information through a secondary channel. The same notice records about 55 billion US dollars in what it calls exposed losses from business email compromise between October 2013 and December 2023.

An agent adds one more reason for the rule. An invoice is a document written by an outsider, and text inside it can be crafted to look like an instruction. The agent must treat everything on the page as data to extract, never as a command. We cover this in prompt injection, and the wider pattern in where an agent must stop and ask.

How to start

Take one supplier group and one entity. Run the agent beside the existing process for a few weeks and compare results before it posts anything. Measure touch time per invoice and the share handled without correction. Widen it only after those numbers hold.

During that period, keep a short log of four things.

  • Touch time per invoice, before and after.
  • The share of invoices handled without correction.
  • Which fields are corrected most often, and for which suppliers.
  • Mismatches the agent raised that a person agreed with, and mismatches it missed.

Common questions

Do we still need separate OCR software?

Not necessarily for the reading itself, because current models work from the page image directly. You may still want a scanning step that produces clean, upright, legible files, since a poor scan limits any reader. Test on your own worst invoices before deciding.

Can the agent pay invoices on its own?

It can be built to, and we would not start there. Let it draft and a person approve until the numbers show it is safe for a narrow class: small amounts, known suppliers, exact matches. Keep payment release and bank-detail changes with people.

Will it work with our accounting system?

That depends on how the system lets other software in. If it offers an API or an import file, the agent's draft entry can be loaded directly. If the only way in is the screen, the posting step may need RPA, which adds upkeep.

How accurate is the extraction?

No general figure will tell you, because it depends on your suppliers' layouts and the quality of your scans. Build a test set from your own past invoices with the correct values, and measure field by field. Our guide to testing an agent before launch explains how, and you can get in touch if you want help setting one up.

The assessment is the same thinking, applied to your systems.

Two to three weeks, a scope agreed in writing before it starts, and a document you can act on whether or not you hire us for the build.