OCR vs AI document extraction: invoices, receipts and expense claims
OCR turns a scan into text, and AI extraction turns that text into the named fields your system can post. To automate invoices, receipts or expense claims you need both, plus checks that catch what a confidence score misses.
In short
- OCR turns a scan into text. AI extraction turns that text into named fields, such as supplier, invoice number, date, line items and total. To automate data entry you need both, plus checks on the result.
- A reliable pipeline has six steps: intake, split and classify, read, extract, check and route. Business-rule checks, such as line items adding up to the subtotal or an invoice matching its purchase order, catch the errors a confidence score misses.
- Measure accuracy per field on labelled past documents of your own before anything goes straight through. The document reading we’re adding to our ERP and WMS runs in shadow mode beside a company’s existing process before its first document type switches over.
- The feature you choose can change the bill more than the page count. In February 2025, AWS Textract lists US$0.0015 a page for plain text and US$0.05 for Forms, for the first million pages a month in US West (Oregon).
- Where a supplier sends a structured e-invoice, read its data instead of scanning the PDF. Coverage differs by country: Malaysia’s MyInvois reaches all remaining taxpayers on 1 July 2025, and most businesses with annual turnover below RM150,000 are exempt.
In November 2024 we started adding AI features to our five business systems, and one piece the ERP and the WMS share is document reading: supplier invoices read into draft bills in the ERP, delivery orders read at the WMS dock. In both, reading the page is one step of several, and checks written in code decide what goes through.
OCR (optical character recognition) turns a scanned page into text. AI document extraction turns that text into the named fields your system needs: supplier, invoice number, date, line items and total. To automate invoices, receipts or expense claims you need both, plus business-rule checks and a review screen for whatever fails them, because a misread field looks exactly like a correct one until a rule tests it.
Vendors sell the whole chain as “intelligent document processing” (IDP): OCR, extraction, checks and routing in one product. Whatever it’s called, what a finance clerk needs from an invoice is the five or six values that go into the accounting system, and a reason to trust them. The steps below follow the pipeline we’re building into the ERP and the WMS, and they carry over to any document type with fields to post.
1. AI document extraction reads new layouts, and still needs checks around it
AI extraction is the default because supplier invoice and delivery order layouts keep changing. It’s still only one step of the pipeline, and the three approaches differ in what they give you and where they break:
| Approach | What it gives you | Where it breaks |
|---|---|---|
| Plain OCR | All the text on the page, in reading order | Someone still has to find and type the fields |
| Template extraction | Fields read from fixed positions on a known layout | Every new supplier or layout change needs a new template |
| AI extraction | Named fields and line items, even from layouts it hasn’t seen | Can be confidently wrong, so it needs checks around it |
Here’s the same idea on the supplier invoice in the sample transaction on our ERP page: 400 sheets of 2 mm aluminium from a metal supplier, ordered on purchase order PO-0918 and received on goods receipt GR-0611. Each layer adds something the one before it can’t give you:
| Layer | What it gives you on that invoice |
|---|---|
| Plain OCR | The words and numbers on the page in reading order, from the supplier’s name to the bank details at the foot |
| AI extraction | Named fields: the supplier, the PO it quotes, the line for 400 sheets of 2 mm aluminium, the prices, the tax, the total and the bank account |
| Checks | The lines add up to the total, the tax rate is valid for the invoice date, the invoice isn’t a duplicate, the price matches PO-0918, the quantity matches GR-0611 and the bank account matches the supplier record |
Two of that page’s cases show why the checks matter more than the reading. In the short-delivery case, extraction reads 400 sheets correctly and the invoice still goes to review, because the goods receipt recorded 380. In the new-bank-account case, every field is read correctly and the invoice goes to review anyway, because the account differs from the supplier record. A confidence score can’t flag either one: both come from comparing the invoice with records it doesn’t contain. A misread total is caught the same way, because the line items no longer add up to it.
Is plain OCR ever enough on its own? Yes, when you need the words and no fields: a searchable archive, full-text search across old scans, or the input to a document Q&A tool that cites its sources. It’s also the cheapest option per page.
2. A document pipeline has six steps, and extraction is only the fourth
The two steps after extraction decide whether anything gets posted. Here is the pipeline, in order:
- Intake: collect documents from where they arrive (an email inbox, a WhatsApp number, an upload page or a scanner folder) and record who sent each one and when.
- Split and classify: one PDF often holds an invoice, a delivery order and a credit note, so split it into documents and label each type before reading anything.
- Read: run OCR with layout, so tables, stamps and handwriting keep their position on the page, and keep the page number and position of every word.
- Extract: map the content into a fixed schema per document type, with a pointer from every field to where it was found and, where the service provides one, a confidence score.
- Check: apply business rules, and compare each field’s confidence with the agreed threshold.
- Route: a document goes straight through only when every check passes and every field is above the threshold; everything else goes to a review screen with the scan beside the extracted fields, and the pipeline logs every correction.
Until you have measured accuracy on your own documents, people review everything, and section 9 says how to get those numbers.
Some pipelines keep that review for every document. On the computer-based test platform we built in 2024 for a national tutoring chain in Indonesia, a teacher photographs a printed or handwritten worksheet, and Claude 3.5 Sonnet reads it into questions, options, formulas and, where the sheet prints one, the answer key. The review screen shows each question beside its box on the photo, with its confidence, and the teacher checks every one before it goes live in the question set.
3. Business-rule checks catch what a confidence score misses
A confidence score measures how sure the model is, and a crisp invoice with a misread total can still score high. Rules written from how your business works are deterministic: the same document gets the same verdict every time.
Services such as Textract’s Analyze Expense and Azure AI Document Intelligence return a confidence score for each field. A general-purpose language model can state a confidence when asked, as Claude does on the tutoring platform’s review screen, but that number isn’t calibrated. So when a language model does the extraction, the rules carry more of the weight and more documents go to review.
The checks we’d add, by document type:
- Every document: line items add up to the subtotal, subtotal plus tax equals the total, and no date is in the future.
- Supplier invoices: the supplier and its bank account match your master data, tax is at the right rate for that supplier and date, the invoice number is new, and the invoice matches its purchase order (PO) and goods receipt on quantity and price. That last test is the “three-way match” a ready-to-use ERP (enterprise resource planning) system runs on every supplier invoice.
- Delivery orders: the lines match the PO before put-away, and a warehouse management system (WMS) can read the delivery order on arrival and still confirm the goods by scan.
- Expense claims: the claimant, the date and the category are valid, the amount is within the policy limit, and the receipt hasn’t been claimed before.
When a check fails, the document goes to a person with the scan beside it, and the pipeline logs the correction. Those corrections are the first place to look when accuracy drops, because they show which field on which kind of document went wrong.
4. We’re building document reading into our ERP and WMS with the rules in charge
Our ERP and WMS will read documents with Claude, a general-purpose language model, so they’re the case above where the rules carry the weight. Document reading is part of the AI work we started on the five systems in November 2024. The reviewer will see Claude’s confidence, and only the checks will decide where a document goes.
The three approaches from the comparison table, applied to supplier invoices:
- Plain OCR: the text of each invoice, with finance still finding and keying every field.
- Template extraction: one template per supplier layout, rebuilt each time a supplier changes its invoice.
- AI extraction with checks: fields and line items from layouts the model hasn’t seen, tested against the purchase order, the goods receipt and the supplier record before finance sees them.
We chose the third. Invoices arrive as PDFs, scans and phone photos from suppliers who change their layouts without notice, so templates would need constant upkeep, and plain OCR would leave the keying where it is.
In the ERP as we’re building it, a supplier invoice becomes a draft bill, and code decides which queue it lands in. A changed bank account always stops in review, and the WMS still confirms every delivery by scan, whatever the delivery order says. The invoice checks are on the ERP page, and the post on how we built the five systems covers the workflows the reading feeds.
5. Receipts have few fields and little to check them against
The merchant isn’t in your master data, there’s no purchase order, and thermal paper fades. Extract the merchant, date, total and tax, plus the tax registration number where tax is shown, and add these checks:
- Capture early: ask for a photo on the day of purchase, flat, with the whole receipt in frame. Thermal print fades, so that photo often ends up as the only legible copy.
- Catch duplicates: one receipt can be claimed twice, in different months or by two people who shared a bill, so compare merchant, date and total with earlier claims and send matches to a person.
- Check the tax number: where tax is shown, check that a registration number is present and in the expected format.
- Apply the policy: category limits and approval rules are checks too.
6. Documents in Singapore, Malaysia and Indonesia differ from the demo in five ways
Each of these needs its own rule or a labelled example, and a clean English demo invoice shows none of them:
- Number formats: Indonesian documents write Rp 1.250.000,00, with the full stop separating thousands and the comma marking decimals, so set the format per supplier or country and check it against the total, or an amount is out by a factor of a thousand or more.
- Dates: a date written 03/02/2025 is 3 February in Singapore, Malaysia and Indonesia, where the day comes first, so fix the date format per source instead of letting the model guess.
- Mixed languages: one clinic receipt in a staff medical claim can carry English headings, Bahasa Melayu item descriptions and a Chinese stamp. Anthropic’s multilingual support page scores Claude 3.5 Sonnet and Claude 3.5 Haiku in Indonesian and Simplified Chinese, among other languages, and doesn’t list Malay. Its scores come from translated exam questions, so they say nothing about a faded stamp on a phone photo. Dedicated OCR services differ by service and by feature, so check the provider’s language list for the feature you plan to use, and put mixed-language pages, Chinese stamps included, in your labelled set.
- Phone photos: expense claims and receipts arrive as phone photos at an angle, with shadows, folds and faded print, so straighten and clean the image before reading and expect more of them to need review.
- Handwriting and stamps: delivery orders and clinic receipts carry handwritten amounts and stamps across printed text, so treat those fields as review-required until accuracy on your own documents says otherwise.
7. Structured e-invoices skip the reading step, and the checks still apply
Where a supplier sends a structured e-invoice, read its data instead of scanning the PDF: there’s nothing to misread. The checks still apply, because an e-invoice can still be a duplicate, fail the PO match or carry a changed bank account. Coverage varies by country, business size and date, so each row names the dated source behind it:
| Country | System | Who it covers and from when | Source |
|---|---|---|---|
| Malaysia | MyInvois, run by HASiL (the Inland Revenue Board) | Phased in by annual turnover: above RM100 million from 1 August 2024, above RM25 million from 1 January 2025, and all other taxpayers from 1 July 2025. Most businesses with annual turnover below RM150,000 are exempt. Each phase starts with a six-month interim relaxation period. | HASiL: e-Invoice General FAQs, updated 28 January 2025 |
| Singapore | InvoiceNow (Peppol), for businesses registered for GST (goods and services tax) | A soft launch from 1 May 2025 lets existing GST-registered businesses send invoice data to IRAS early. It becomes a condition of voluntary GST registration for newly incorporated companies from 1 November 2025, and for all new voluntary registrants from 1 April 2026. IRAS plans to extend it to the remaining GST-registered businesses in phases, with details still to come. | IRAS: GST InvoiceNow Requirement |
| Indonesia | e-Faktur on Coretax, run by DJP (the Directorate General of Taxes) | Coretax went live for VAT-registered businesses (PKP) on 1 January 2025, and tax invoices are now made in it. DJP has said late invoices during the transition won’t draw administrative sanctions. A designated list of PKP that issue large numbers of tax invoices may keep using the older e-Faktur desktop app. | DJP: KT-02/2025, 10 January 2025, KEP-39/PJ/2025, 20 January 2025, amending KEP-24/PJ/2025 of 15 January 2025 |
How you receive the data differs by country. In Singapore, the GST InvoiceNow requirement is about sending invoice data to IRAS (the Inland Revenue Authority of Singapore), and you receive Peppol invoice data only if the supplier sends the invoice to you over InvoiceNow. For MyInvois and Coretax, ask the supplier for the validated e-invoice data as well as the PDF. Keep extraction for the PDFs, photos and paper that remain.
Malaysia’s rules don’t turn every receipt into an e-invoice. Where the buyer doesn’t ask for an e-invoice, the seller can, for most sales, issue a normal receipt and report the sale in a monthly consolidated e-invoice (HASiL e-Invoice General FAQs, 28 January 2025, questions 28 and 95). Receipts from staff expenses will still need reading. These rules change often, so check the official pages before planning around them.
8. The feature you choose changes the bill more than the page count
AWS Textract and Azure price each feature per page, and a language model charges per token. The prices below are the list prices on each provider’s pricing page in February 2025. Textract’s rows are for the first million pages a month in US West (Oregon), from the AWS Textract pricing page. Azure AI Document Intelligence prices per 1,000 pages on its pay-as-you-go S0 tier, here for Southeast Asia (Azure AI Document Intelligence pricing). Anthropic’s pricing page lists Claude 3.5 Sonnet at US$3 per million input tokens and US$15 per million output tokens, and its vision guide puts a full-size page image at about 1,600 tokens.
Prices differ by region, and the region you run in also matters for personal data, so check both. At 5,000 pages a month:
| Feature | List price | 5,000 pages a month |
|---|---|---|
| Textract Detect Document Text (plain text) | US$0.0015 a page | US$7.50 |
| Textract Analyze Expense (invoices and receipts) | US$0.01 a page | US$50 |
| Textract Analyze Document, Forms | US$0.05 a page | US$250 |
| Azure Read (plain text) | US$1.50 per 1,000 pages | US$7.50 |
| Azure prebuilt Invoice model | US$10 per 1,000 pages | US$50 |
| Claude 3.5 Sonnet, page sent as an image | US$3 per million input tokens, about 1,600 a page | About US$24, plus output tokens |
Choosing Forms over plain text multiplies the Textract bill by more than 30, while doubling the pages only doubles it. For example, a 3-page invoice costs US$0.15 at list price through Forms and US$0.03 through Analyze Expense, which is the feature built for invoices and receipts.
The cheaper Claude 3.5 Haiku takes text only for now (Anthropic, 22 October 2024), so reading a scan with Claude means Claude 3.5 Sonnet. Its output tokens come on top of the input in the table, and they depend on how many fields and line items each page returns.
These are list prices for the reading alone. Hosting and staff time in the review queue come on top, and a cheaper feature that sends more documents to review can cost more overall.
9. Measure extraction accuracy per field on your own documents
Don’t accept a single accuracy number from a vendor, including us. Measure it on your own documents, in five steps:
- Collect: take a few hundred past documents of one type, bad photos included.
- Label: have someone who processes them today record the correct value for each field.
- Run: run the pipeline and compare field by field.
- Report per field: a supplier name may be near perfect while line-item quantities lag, and a per-document figure hides that.
- Track the straight-through rate: the share of documents that pass every check with every field above the agreed threshold.
Re-run the set every time the pipeline changes, because it’s how you know whether a change helped. Once documents go straight through, keep reviewing a sample of them so a drop in accuracy shows up early.
The document reading we’re adding to our ERP and WMS goes through this for each company. It runs in shadow mode next to the existing process, on that company’s labelled documents, and the first document type switches over only when the per-field results hold up.
Code gets the same treatment in a 4-week sprint: the author of each pull request and then the technical lead review it, and the tests in CI must pass before it merges. We’ve built with Claude since June 2024, and the post on that change explains why the tests, read as closely as the code, are what decide whether a change Claude drafted merges.
10. Each country sets its own rules for the personal data in documents
Expense claims, payslips, receipts and identity documents carry personal data, from identity numbers and bank details to health information. Each country has its own law for it:
- Singapore: the Personal Data Protection Act (PDPA) makes scale one trigger for reporting a breach. The Personal Data Protection Commission’s advisory guidelines on key concepts say you must report a breach affecting 500 or more people to the PDPC within 3 calendar days of assessing that it’s notifiable.
- Malaysia: its own PDPA, as amended by the Personal Data Protection (Amendment) Act 2024, is coming into force in three stages: 1 January, 1 April and 1 June 2025 (P.U. (B) 522, gazetted 24 December 2024). From 1 April 2025, data processors, such as a vendor running your pipeline, must meet the Security Principle. From 1 June 2025, a data controller must notify the Commissioner of a personal data breach as soon as practicable, and data controllers and processors must appoint a data protection officer (DPO).
- Indonesia: Law No. 27 of 2022 on Personal Data Protection took effect on 17 October 2022 and gave organisations two years to comply, a period that ended on 17 October 2024. You must notify the people affected and the authority of a breach within 3×24 hours (Article 46).
Decide before the build which fields the pipeline needs and mask the rest. Limit who can open the review queue, since it shows the full scan, and set how long documents and extracted data are kept.
11. Five mistakes to avoid in an extraction project
- Every document type at once: each type needs its own schema, checks and labelled set, so start with one.
- Confidence without checks: a confident misread goes straight through unless a rule catches it.
- No labelled set: without one, no one on the team can tell whether a change helped.
- The most expensive feature by default: Forms extraction on pages that only needed text multiplies the bill.
- Manual entry switched off too early: run both side by side until the results agree.
12. Takeaways
Start with one document type that has real volume and a clear owner. We recommend supplier invoices: the fields are well defined, the purchase order gives each one a record to check against, and the cost of manual entry is easy to count. Other types wait until the first one goes straight through.
Put the rules in charge of routing, and treat the confidence score as one more input. In the invoice reading we’re adding to our ERP, the checks against the purchase order, the goods receipt and the supplier record decide what finance sees, and Claude’s confidence is only shown to the reviewer. A score measures how sure the model is, and the rules measure whether the numbers hold together.
Measure per field on a few hundred labelled documents before anything goes straight through, and keep the set. Run it again whenever the instructions or the model change, and let corrections from production add new cases to it.
Price the feature as well as the pages, and count review time in the bill. Textract’s plain text and Forms differ by a factor of more than 30 on the same page, and a cheaper feature that sends more documents to review can cost more in staff time than it saves.
Reading only ever produces a draft: the system’s own rules check it and finance posts it, which keeps the ledger logic standard. We build extraction like this into the systems companies already run, as part of our AI integration service. If someone on your team types up the same documents every day, tell us which ones, and we’ll reply within 24 hours and ask for a sample.
Frequently asked questions
What is the difference between OCR and document extraction?
OCR (optical character recognition) converts an image of a page into text. Document extraction takes that text and its layout and returns named fields, such as the supplier name, invoice date, line items and total, in a structure your accounting or expense system can accept. Extraction can be confidently wrong, so it needs checks around it.
Is OCR enough for invoices?
Not if the goal is to post invoices into your accounting system. Plain OCR returns the text, so someone still has to find and type the fields, while extraction returns named fields such as supplier, invoice number, date and total, ready to be checked. OCR alone is enough for a searchable archive, for full-text search or as the input to document Q&A.
Do we still need a template for each supplier?
Usually not. Older tools read fields from fixed positions on a known layout, which broke whenever a supplier changed its invoice. Current layout-aware and language models read layouts they haven’t seen before, although a few high-volume layouts can still be worth tuning.
What accuracy should we expect?
No general figure is worth relying on, so measure it on your own documents: a few hundred past documents of one type, with the correct values recorded by the people who process them today. Report accuracy per field rather than per document, because a supplier name can be read almost perfectly while line-item quantities lag.
Can extraction run without anyone checking it?
Not at first. Until you have measured accuracy on your own documents, people review everything. After that, a document goes straight through only when every check passes and every field is above the agreed confidence threshold, and you keep reviewing a sample of those documents so a drop in accuracy shows up early.
Can it read documents in Bahasa and Chinese?
Yes, with checks. Anthropic’s multilingual support page scores Claude 3.5 Sonnet in Indonesian and Simplified Chinese, among other languages, and doesn’t list Malay. Dedicated OCR services differ by service and by feature, so check the provider’s language list for the feature you plan to use, and put mixed-language pages in your labelled set. Number and date formats need explicit rules: Rp 1.250.000,00 is one million two hundred and fifty thousand rupiah, and 03/02/2025 means 3 February.