How to Automate Invoice Processing with OCR and ChatGPT
A practical guide to automating accounts payable with OCR and ChatGPT — how the extraction pipeline actually works, where confidence thresholds and approval gates belong, and the bank-detail fraud check no model can do for you.
Published
The short answer: Pair a layout-aware OCR step with a language model that turns the extracted text into structured invoice fields, then send anything below a confidence threshold — and every change of supplier bank details, without exception — to a human. The technology handles keying and matching well. It does not handle invoice fraud, and that is the part that costs real money.
Accounts payable is one of the last genuinely manual processes inside an otherwise automated finance function. An invoice arrives as a PDF, someone reads a handful of numbers off it, types them into the accounting system, chases a manager for approval, and later answers the supplier's email asking when they will be paid. Two hundred times a month.
It is exactly the shape of work current AI is good at. What most write-ups skip is the part that decides whether the project is a net gain or a new liability: an automated AP pipeline is also an automated path from an email inbox to your bank's payment file. Get verification wrong and you have built a fast, well-documented process for wiring money to whoever spoofed your supplier most convincingly.
Where Does AP Time Actually Go?
Measure before you automate, because the assumption is usually wrong.
Keying invoice data. Reading supplier, invoice number, date, currency, line items, tax and total off a document and typing them in. Tedious, error-prone, and the piece AI extraction removes almost entirely.
Matching. Confirming the invoice corresponds to something you ordered and received, at the price agreed. Partly automatable, and wholly dependent on having purchase orders and receipts to match against.
Chasing approvals. Usually the biggest chunk of the clock. An invoice sits nine days not because anyone is typing but because it is behind four hundred emails in a budget holder's inbox. Automating extraction while leaving approvals untouched will barely move your days-payable numbers.
Handling exceptions. Missing PO numbers, quantity mismatches, credit notes, partial deliveries, wrong currency. Disproportionately time-consuming, and where automation helps least.
Only the first is fully addressed by AI extraction. Still worth doing, but set the expectation before anyone builds a business case on it.
Building the Pipeline — OCR First, Then AI Extraction
Why Is OCR a Different Job From the Language Model?
Treating these as one step is where most home-built pipelines get into trouble.
OCR converts pixels into characters with their positions on the page. Mature document-AI services — Google Document AI, AWS Textract, Azure AI Document Intelligence, ABBYY — return layout-aware output: words with bounding boxes, detected table structure, often tentative key-value pairs. That geometry matters more than people expect. A number is recognisable as the grand total partly because of where it sits and what sits next to it, not only because the word "Total" appears nearby.
The model's job starts after that: turning inconsistently-labelled text into a clean structured record. "Inv. No.", "Invoice #" and "Ref" mean the same thing; 03/04/26 has three incompatible readings; a line item may wrap across two rows. That normalising judgement is what the model is for.
Multimodal models can read an invoice image directly and skip the OCR call, and on clean digital PDFs they often do this well — reasonable for a few invoices a day. At volume the two-stage pipeline is usually better: cheaper per document, you can store OCR output and re-run extraction after a prompt change without reprocessing originals, and you can point at the exact region a value came from. That last one matters the first time an auditor asks where a figure originated.
Either way, ask for strict JSON against a fixed schema and instruct the model to return null for anything it cannot find rather than inferring a plausible value. A missing field routes to a human; a confidently invented one does not.
How Do Confidence Thresholds and the Approval Gate Work?
Three-way matching is the traditional control: the invoice must agree with the purchase order and the record of what was received, at line level, within a tolerance you set. Without PO discipline this control does not exist, and no amount of AI substitutes for it.
Confidence comes in two flavours and only one is reliable. What the model reports about itself is a weak signal — models are quite capable of being confidently wrong. Internal consistency is far more useful: do line items sum to the subtotal, does subtotal plus tax equal the total, does the supplier exist in your master file, is this invoice number a duplicate, is the tax rate plausible for that jurisdiction? These arithmetic and cross-reference checks catch more genuine errors than any self-reported score, and they are cheap to implement.
Then route by risk, not by confidence alone. Always send to a human: anything above a value threshold you choose, any first-time supplier, any invoice whose payment details differ from what you hold, and any duplicate candidate.
One rule worth treating as absolute: extraction may post an invoice, but it must never release a payment. Straight-through processing to an approved payable is a reasonable target. Straight-through processing to money leaving the account is not, at any confidence level.
A Worked Example — From PDF in an Inbox to an Approved Payable
A supplier emails an invoice to a dedicated AP mailbox. The pipeline hashes the attachment and discards an exact duplicate of something already processed — worth doing first, because suppliers resend.
OCR returns text with layout. The extraction step passes it to the model with your schema and gets back a structured record: supplier, tax registration number, invoice number and date, currency, line items, tax, total, payment terms, and the bank details printed on the document.
Validation runs next, in ordinary code rather than in the model. The arithmetic must reconcile, the supplier must resolve to your master file, the invoice number must not already exist against that supplier, the currency must be one you transact in. Matching follows: find the purchase order, compare quantities and prices line by line, check the goods receipt. A clean match produces a draft payable with the original PDF attached and the OCR coordinates stored, so any figure traces back to its spot on the page.
Now the check that earns its place. Compare the bank details on this invoice against the details held for that supplier. Identical, and it joins the approval queue as normal. Different in any respect — account number, bank, beneficiary name, even a changed SWIFT code — and it stops dead and goes to a named person for out-of-band verification. Not a reply to the email. A phone call, to the number you already had on file before this invoice arrived.
Approval then happens as it always did, and the payable joins a payment run that a human releases. The AI has removed the typing and most of the matching, and has not been allowed anywhere near the decision to send money.
AI Invoice Extraction vs Dedicated AP Software vs Manual Entry
- Setup cost and time — Manual entry wins; nothing to set up. A custom AI pipeline is weeks of work. Packaged AP software sits between, usually days if your ledger is one it already supports.
- Per-invoice running cost — The AI pipeline is cheapest at volume. Packaged software charges per document or per user and can become the largest line as volume grows. Manual entry looks free and is simply paid in salary instead.
- Accuracy on messy documents — Packaged software wins, not narrowly. Vendors trained on millions of real invoices including bad photographs. A general model is respectable on clean PDFs and noticeably weaker on a creased scan shot at an angle.
- Approval workflow and audit trail — Packaged software wins clearly. Routing, delegation, thresholds and an immutable audit log are the product, not an add-on, and rebuilding them properly is most of the work in a custom pipeline.
- Fit with an unusual ledger — The custom pipeline wins. If your accounting system is regional, older or heavily customised, packaged connectors often do not exist at all.
- Fraud controls out of the box — Usually packaged software, though this varies enough to be a specific question during evaluation. Supplier bank-detail change alerting is the feature to ask about by name.
Honest guidance: below roughly a hundred invoices a month, fix your approval workflow before automating extraction at all. Above that, evaluate packaged AP software first and build custom only when packaged options genuinely cannot reach your ledger — what you would be rebuilding is mostly workflow and audit machinery, not the clever part.
The Fraud Angle Nobody Automates Away
Changed bank details are the entire attack. Mature invoice fraud is not a fake company. It is a real invoice for goods you really ordered, with one field altered. Everything else reconciles perfectly, which is why it survives every check aimed at arithmetic correctness.
Lookalike domains and hijacked reply chains. The email may come from a domain one character different from your supplier's, or genuinely from your supplier's mailbox after their account was compromised — the attacker replying inside a real thread, with real history above their message.
Urgency is the tell. Pressure to pay before a deadline, a warning about supply interruption, an apology for short notice about a "new banking arrangement". Urgency exists to make someone skip verification.
The model reads the document, not the situation. An extraction model accurately reports the account printed on the page. That is the job you gave it. It has no view on whether that account belongs to your supplier.
Verify out of band, against details you already held. Any change to payment details triggers a phone call to a number that was on file before the change was requested, made by someone other than whoever is processing the invoice. Make it non-skippable, and make sure everyone knows that being slow here is never the wrong answer.
Getting This Right — Payment-Data Governance, Email Security, and When to Bring in IT
Invoices are not neutral documents: they carry your suppliers' bank details, your negotiated pricing, contract references, and the names of real people. Decide deliberately which provider and tier you use, and read the data-handling and training terms that actually apply — business and API tiers commonly differ from consumer chat products, and terms change, so check the provider's current documentation. Route documents through an API from your own application rather than having staff paste attachments into a chat window.
The pipeline needs an API key, a mailbox connection and write access to your accounting system — a combination worth treating as sensitive. Keys belong in a secrets manager, the mailbox connection should be scoped to the AP mailbox alone, and the accounting integration should have the narrowest permission set that lets it create draft payables and nothing more. Our AI+ support practice covers setting this kind of pipeline up governed from the start, and managed IT support handles identity, access and lifecycle once more than one person depends on it.
The mailbox itself is now a production input to your payment process, which changes what it needs: authentication controls on the domain, filtering that catches lookalike sender domains, and alerting when a supplier thread behaves oddly. That is what managed email security exists for, and it is the highest-leverage thing to do alongside an AP automation project, because it addresses the failure mode that costs six figures rather than the one that costs an afternoon. If your interest is the expense side rather than supplier invoices, our companion piece on automating expense categorisation with ChatGPT and QuickBooks or Xero covers that workflow. Brocent has run managed IT across Asia since our founding in Beijing in 2007, with headquarters in Singapore and a Hong Kong office since 2016.
Frequently Asked Questions
Can AI reliably read a scanned or photographed invoice?
Reliably enough to be useful, not reliably enough to be unsupervised. Clean digital PDFs extract very well and flat scans are usually fine. A photograph taken at an angle in poor light, a creased fax, or handwriting over printed text is where accuracy drops — and it drops silently, because the output still looks confident.
Should an AI-extracted invoice ever be paid automatically?
No. Automating extraction and posting is reasonable; automating payment release is not, regardless of confidence scores. Keeping a human at the payment gate costs almost nothing — payment runs are batched anyway — and it is the control standing between an extraction error and money leaving the account.
What accuracy rate is realistic?
Measure your own rather than trusting a headline number, because accuracy depends almost entirely on your document mix. Run a few hundred real invoices through, compare field by field against what a person extracted, and count errors per field rather than per document — 98% field accuracy still means a meaningful proportion of invoices contain at least one wrong field. Track the total, the bank details and the invoice number separately.
How do we catch a changed bank account?
Store the payment details you hold for each supplier, compare every incoming invoice automatically, and make any difference an unconditional stop. Verify by phoning a number you already held, using someone other than whoever is processing the invoice. Do not verify by replying to the email, and do not accept a new number supplied in the same message that requested the change.
Is it safe to send supplier invoices to an AI provider?
It is a decision to make deliberately. Invoices contain third-party bank details and personal data, so check what the provider's current terms say about retention and training for your specific tier, whether the processing region suits your obligations, and what your supplier contracts commit you to. Many organisations conclude a business or enterprise API tier is acceptable and a consumer chat product is not.
Do we still need purchase orders if we automate extraction?
Yes, more than ever. Three-way matching is what makes automated processing safe, and it needs a purchase order and a receipt to match against. Without POs the pipeline can confirm an invoice is arithmetically correct and internally consistent, which is not the same as confirming you ordered the goods, received them, or agreed that price.
Where to Start
Spend a week measuring before building anything: count invoices, time the stages, and find out how much delay is keying and how much is approvals sitting in inboxes. If it is approvals, fix that first — cheaper project, bigger effect. If keying is genuinely the constraint, pilot on one supplier category with clean PDFs, keep a person reviewing every extraction for the first month, and build the bank-detail comparison before anything else. If you would rather have the pipeline, the mailbox controls and the access model set up together by people who have done it before, get in touch.
Share:
Ready to take action?
Turn these insights into a roadmap for your business.
Book a 15-minute no-obligation consultation with our APAC IT experts. We'll review your current setup and provide a tailored IT roadmap within 24 hours.
Free Checklist
10 Critical Checks Before Expanding IT to Greater China
PIPL compliance, network segmentation, bilingual helpdesk setup, and more — everything your IT team needs before Day 1 in China.
Request the checklist →📬 Monthly Asia IT Insights
China compliance updates, cybersecurity alerts, and IT tips for APAC teams — once a month.
No spam. Unsubscribe anytime.