Automating invoice intake with LLMs without losing the audit trail
A document-processing pipeline that extracts invoice data reliably, flags what it is unsure about, and keeps finance and auditors comfortable.

Accounts payable is one of the most reliable places to get real value from language models. The inputs are messy, the outputs are structured, the volume is steady, and the humans doing the work today would happily hand over the typing. It is also a place where a confident mistake costs real money and where auditors will eventually ask how a number got into the ledger. The pipelines we build for finance teams are designed around that second fact first.
Why templates and classic OCR stopped being enough
Template-based extraction works when you have ten suppliers who never change their layout. Most mid-sized businesses have hundreds of suppliers, and a meaningful share send scanned PDFs, photos of paper invoices, or emails with the details in the body. A distribution client we worked with received about 3,200 invoices a month from over 700 suppliers. Their template tool covered the top 40 suppliers and left the rest to two people typing data by hand.
Modern multimodal models read these documents far better than template systems. They handle layout changes, multi-page line items and invoices in several languages without per-supplier configuration. What they do not do on their own is tell you when they are wrong, and that is the problem the rest of the pipeline exists to solve.
The pipeline, stage by stage
- Intake. Invoices arrive by a dedicated mailbox, supplier portal uploads or scanner. Every file gets an immutable ID and a hash, and the original is stored untouched.
- Classification. A cheap model call decides whether the document is an invoice, credit note, statement, or something else entirely. Statements and remittance advice are a surprising share of what lands in AP mailboxes.
- Extraction. A stronger model extracts header fields and line items into a strict JSON schema, returning the page and region where each value was found.
- Validation. Deterministic rules check the output: line items sum to the subtotal, tax matches the expected rate for the supplier's jurisdiction, the supplier exists in the vendor master, the bank details match what is on file, and the invoice number is not a duplicate.
- Matching. Where purchase orders exist, lines are matched against the PO and goods receipt, with tolerances agreed with finance.
- Routing. Documents that pass everything post as drafts to the ERP. Anything that fails a rule goes to a review queue with the specific reason highlighted.
The model does one job in this pipeline: turning pixels into structured fields. Every decision about whether those fields are acceptable is made by rules that finance can read and change.
Let the model read. Let rules decide. Let people handle the exceptions the rules surface.
Confidence you can act on
Asking a model how confident it is produces numbers that look precise and mean little. We get usable confidence in other ways. We run extraction twice on high-value invoices with different prompts and compare results field by field; disagreements go to review. We cross-check totals arithmetically. We compare extracted supplier details against the vendor master. And we track historical accuracy per supplier, so a supplier whose invoices have been extracted perfectly 200 times gets lighter scrutiny than a new one.
The bank detail check deserves special mention. Changed bank details on an otherwise normal invoice are the signature of invoice fraud. Our pipelines never update vendor bank details from an invoice, and any mismatch blocks the document and alerts a named person in finance, regardless of how confident the extraction looks.
The audit trail auditors actually want
When we first ask finance teams what their auditors need, the answer is usually vague. When we ask the auditors, it is very specific: for any posted transaction, show the source document, what was extracted, what was changed by whom and when, and which rules it passed. We record all of that:
- The original file and its hash, retained according to the client's document retention policy.
- The exact model, prompt version and raw output for every extraction.
- Each validation rule result, pass or fail, with the values it compared.
- Every human edit as a before-and-after diff with the reviewer's identity and timestamp.
- The ERP document ID the invoice was posted to.
This makes year-end audits faster than the manual process ever was, because every question has a click-through answer instead of a search through inboxes.
Results and what to expect
For the distribution client, about 78% of invoices now post as drafts without human edits, and review time on the remainder dropped from roughly six minutes to under two, because reviewers see the document next to the extracted fields with the failing check highlighted. Field-level accuracy on a 400-invoice holdout set sits at 98.6%, and duplicate payments, previously a few a quarter, have not recurred.
Running costs average around four cents per invoice, including double extraction on high-value documents. The build took seven weeks, most of which went into ERP integration and agreeing validation rules with finance, not into the model work.
If you are considering something similar, a few rules of thumb:
- Start with the review queue interface, because that is where your team will spend its time.
- Agree tolerances and approval thresholds with finance in writing before building.
- Keep posting as drafts until you have months of measured accuracy.
- Measure accuracy by field, not by document, so you know where errors concentrate.
This work sits in our document processing AI practice, and the ERP side usually overlaps with our ERP and inventory integration team. The same pattern works for purchase orders, delivery notes and expense receipts, and connecting the whole flow end to end is classic workflow automation.
Scope your AP pipeline
Send us a sample of 50 anonymized invoices and a description of your ERP, and we will tell you what share can realistically be automated and what it will cost to build. Request a fixed-price quote and expect a reply within 24 hours.



