AI Invoice Data Extraction: Invoices, Commercial Invoices and Delivery Notes
Invoice data extraction is the process of turning an invoice, whether a digital PDF, a scan or a phone photo, into structured data: vendor, invoice number, dates, totals, tax and every line item. Today it is done with OCR to read the text and AI to understand which text is which field. Done well, it removes most manual data entry from accounts payable, customs paperwork and goods receiving. Done carelessly, it quietly puts wrong numbers into your books. This guide explains how the technology works, how to measure and protect accuracy, how to connect it to QuickBooks or an ERP, and what it costs.
How OCR plus AI extraction works
A modern extraction pipeline has four stages.
1. Intake and splitting
Documents arrive by email, upload, scanner or shared folder. The first job is often not reading at all but sorting: one PDF may contain five invoices, or one invoice may be split across two files. A pipeline that assumes one document per file will produce merged or half-empty records the first time a supplier sends a batch.
2. OCR
Optical character recognition converts the page image into text, with the position of each word on the page. Digital PDFs usually already contain text, so OCR matters most for scans and photos, where skew, shadows and low resolution cause misread characters such as a 5 read as an S.
3. Field extraction
This is where the approaches differ.
- Templates and rules read fixed positions or patterns. They are precise for one layout and break when a supplier changes theirs.
- Pretrained document models from cloud providers recognize common invoice fields across many layouts. The Azure Document Intelligence invoice model, for example, extracts key fields and line items from invoices, utility bills and purchase orders, handles phone images, scans and digital PDFs, supports invoices in 27 languages, and returns JSON that includes confidence values.
- Large language models read the OCR text, or the page image directly, and fill in a schema you define. Their strength is flexibility: fields no pretrained model knows about, such as a harmonized tariff code or a delivery note's received quantity, can be requested in plain language. Their weakness is that they can produce a confident, plausible value that is not on the page.
In practice, the strongest pipelines combine them: OCR or a document model for text and layout, a language model for mapping and unusual fields, and rules to check the result.
4. Validation
Every extracted record is checked before it goes anywhere. Line items should sum to the subtotal, subtotal plus tax should equal the total, dates should be plausible, the vendor should exist in your records, and the invoice number should not be a duplicate. These checks are cheap, and they catch many extraction errors, including the plausible-but-wrong values language models sometimes produce.
Commercial invoices and delivery notes are different documents
Most invoice tools are built for supplier invoices in accounts payable. Two other document types come up constantly in logistics, wholesale and manufacturing, and they need their own fields.
Commercial invoice data extraction
A commercial invoice accompanies goods crossing a border. For US imports, the required contents are set out in 19 CFR 141.86, and they go well beyond a normal invoice: the port of entry, details of the sale and the parties, a detailed description of the merchandise with its marks and numbers, quantities in weights and measures, the purchase price or value of each item and its currency, itemized charges such as freight, insurance and packing, any rebates or drawbacks, and the country of origin.
A useful commercial invoice data extractor has to capture those fields per line, not just a total, because customs brokers and logistics systems work line by line. It also has to deal with multi-page tables that continue across pages and with invoices issued in other languages and currencies.
Delivery note data extraction
A delivery note, also called a packing slip or goods received note, lists what was shipped and often what was actually received. The fields that matter are the order or reference number, item codes, ordered versus delivered quantities, and notes about damage or shortages. Prices are often missing entirely.
The value of delivery note data extraction usually comes from matching: comparing the delivery note against the purchase order and the supplier's invoice, so you only pay for what arrived. That three-way match is tedious by hand and well suited to automation, as long as the extraction is reliable at the line-item level.
Accuracy and human-in-the-loop review
Vendors like to quote a single accuracy number. Ignore it. Accuracy depends on your documents, your fields and your layouts, so it has to be measured on your own samples.
A sound approach:
- Collect a real sample. Pull a representative set of documents, including the ugly ones: faxed scans, phone photos, multi-invoice PDFs and your most unusual suppliers.
- Label the correct answers. Record the correct value for every field you care about.
- Measure per field. An invoice total may be nearly always right while line-item descriptions are often wrong. One overall percentage hides that.
- Set confidence thresholds. Each extracted value should carry a confidence score. Above the threshold, the record flows through. Below it, or when a validation rule fails, the record goes to a person.
- Keep measuring. Track how often reviewers correct each field. If corrections rise, a supplier changed a layout or a new document type appeared.
The review step is not a sign that the automation failed. It is what makes it safe to connect extraction to money. A reviewer who checks only the flagged documents side by side with the original is far faster than someone typing all of them, and nothing wrong slips through silently.
This is how we design our document data extraction service: every record carries a confidence score, low-confidence records are flagged for a person to check, and accuracy is measured on your own samples before anything else is built.
Integrating with QuickBooks and ERP systems
Extraction is only useful when the data lands where work happens.
For QuickBooks Online, the Accounting API has a Bill object for recording vendor bills and an Attachable object for attaching files, so a pipeline can create the bill and attach the original PDF for audit. A sensible pattern is to create bills in a state your team reviews and approves rather than posting them straight to the ledger.
For an ERP or a custom database, the options are usually an API, a database write, or a structured file import. Whatever the target, plan for:
- Master data matching. Vendor names on invoices rarely match your vendor list exactly. Matching on tax ID, address or a mapping table beats guessing on names.
- Account and item mapping. Line items need to be coded to expense accounts, items or cost centers. Rules handle the repeat suppliers; the rest go to review.
- Duplicate protection. The same invoice can arrive twice, for example by email and by mail. Check vendor plus invoice number plus amount before creating anything.
- An audit trail. Keep the original file, the extracted values, the confidence scores and who approved what.
The movement between inbox, extraction, review and accounting is itself a workflow, and a tool such as n8n can orchestrate it; see our guide to n8n workflow automation for small businesses. The extracted records belong in a proper database, and our Supabase vs Firebase comparison explains why we favor Postgres for that kind of data.
Costs, and whether to build or buy
Per-page processing costs
Cloud extraction APIs are priced per page. As of September 2026, the Amazon Textract pricing page lists its Analyze Expense API, which handles invoices and receipts, at $0.01 per page for the first million pages and $0.008 per page after that in US West (Oregon), with a free tier of 100 pages a month for three months for new AWS customers. At 2,000 pages a month, that is about $20 in processing. Language model calls, where used, are billed separately by the provider based on usage.
For most small and midsize businesses, processing is the smallest cost in the project.
Where the real cost is
The larger costs are the ones specific to your documents: handling splits and multi-page tables, adding fields generic models do not cover, writing validation rules, building the review screen, integrating with your accounting or ERP system, and maintaining all of it as suppliers change their layouts.
Buy when
- Your documents are mostly standard supplier invoices.
- Your accounting system is directly supported by the tool.
- Volume is modest and a per-document subscription is predictable.
- You are fine with the tool's review interface and data location.
Build when
- You process commercial invoices, delivery notes or other documents the off-the-shelf tools handle poorly.
- You have many layouts, multi-document PDFs, or documents in several languages.
- You need three-way matching or custom validation rules.
- The data has to land in a custom database, an ERP without a ready integration, or a system you control.
A custom pipeline does not mean building OCR from scratch. It usually means combining existing OCR and AI services with your own splitting, validation, review and integration logic, which is exactly the part off-the-shelf tools cannot adapt to you.
Where to start
Gather a sample of documents from your last month, including the difficult ones, and list the fields you actually need and where they must end up. That sample is the most valuable input to any extraction project, bought or built, because it is the only honest test of accuracy.
If your documents are messier than the tools expect, our invoice and document data extraction service builds pipelines that split and stitch documents, score every record's confidence, flag the uncertain ones for review, and deliver the results as CSV, Excel, JSON or straight into your database. For extraction as part of a wider automation, see our AI workflows service. Or send us a few sample documents and we will tell you honestly what extraction can handle for them.
Frequently asked questions
Can AI extract data from invoices accurately?
Yes, on clean digital PDFs it usually does very well, and on scans and photos it depends on image quality and layout variety. The only meaningful accuracy figure is one measured on a sample of your own documents, field by field.
What is a commercial invoice data extractor?
It is a tool that reads commercial invoices used in international shipping and pulls out fields such as the seller, buyer, item descriptions, quantities, prices, charges and country of origin into structured data for customs, logistics or accounting systems.
Can invoice data be sent straight into QuickBooks?
Yes. QuickBooks Online has an Accounting API with a Bill object for vendor bills and an Attachable object for attaching the source file, so extracted data can create a draft bill for approval.
How much does invoice OCR cost per page?
Cloud APIs are priced per page; for example, Amazon Textract's expense analysis API is listed at $0.01 per page for the first million pages in US West (Oregon) as of September 2026. Build, validation and integration work are separate costs.
Should I build or buy invoice extraction software?
Buy an off-the-shelf tool if your documents are standard invoices and your accounting system is supported. Build a custom pipeline when you have unusual documents like commercial invoices or delivery notes, many layouts, or a system the tools do not connect to.
Does AI extraction work on scanned or handwritten documents?
Printed scans and phone photos work when they are reasonably clear. Handwriting, stamps and faded thermal paper are harder and should be tested on real samples before you rely on them.