Invoice data extraction: fields, line items and what to look for in an API

Invoice data extraction turns a supplier invoice, whether PDF, scan or photo, into structured fields and line items that accounts payable can validate, match and post. Header fields are the easy part. What separates a good invoice tool from a poor one is line items, totals that reconcile, and what happens when a value is missing or doubtful.

Updated

What fields should invoice data extraction return?

Invoice data extraction returns two kinds of data: header fields, which appear once, and line items, which repeat. Amazon Textract’s list of standard fields is a fair picture of the market: invoice number and date, vendor and receiver details, tax IDs, PO number, payment terms, subtotal, tax, total and amount due, then item, quantity, unit price and line total. For a vendor-neutral baseline, the European standard EN 16931, in the business rules published by Peppol, requires every invoice to have an invoice number, an issue date, a currency code and at least one line. Suppliers label these differently, so a tool must map “Bill No.” and “Invoice #” to one name. Extract only what a later step uses. Each extra field is one more thing to check, and the invoice field reference shows what a full set looks like.

Invoice fields and the check each group should pass
GroupTypical fieldsCheck before posting
IdentityInvoice number, issue date, due date, currencySupplier plus invoice number is not a duplicate; dates are plausible
PartiesSupplier, tax ID, bill-to, remit-toSupplier matches the vendor master; changed bank details go to a person
ReferencesPO number, delivery date, payment termsPO exists and is open; terms match the supplier record
TotalsSubtotal, tax, shipping, discount, total, amount dueThe arithmetic reconciles
Line itemsDescription, product code, quantity, unit price, line totalQuantity times price equals the line; lines sum to the subtotal

Why are invoice line items hard to extract?

Line items are hard because a table on a page is a visual arrangement, not a data structure. Extraction has to find columns that may have no ruling lines, keep a wrapped description attached to the right row, and carry a table across a page break with or without a repeated header. Amazon warns of inconsistent results from merged cells and irregular tables. Microsoft’s documentation expects merged cells to score lower, and expects a row split across pages to score lower than its neighbours. One shifted row can do more harm than a missing header field, because quantity and price feed the purchase order match. Test with long tables, discount lines, zero-priced lines and mixed tax rates. Be realistic about need, too: if you code invoices at header level and never match lines, line-item accuracy may not be worth paying for.

How do you check that extracted invoice totals are right?

An invoice checks itself, and that makes it easier to validate than most documents. The EN 16931 rules state the arithmetic plainly. BR-CO-10 says the sum of line net amounts equals the stated line total. BR-CO-13 says the total without VAT equals the line net amounts, less document-level allowances, plus document-level charges. BR-CO-15 says the total with VAT equals the total without VAT plus the VAT amount. Run the same checks on extracted data, with a small tolerance for rounding, and many misreads surface without a person reading anything. A failed check has two possible causes: the tool misread the page, or the supplier made a mistake. Both deserve a look, so route the invoice to review either way. A pass is good evidence and not proof, because two consistent misreads can still balance.

Where does extraction sit in the accounts payable workflow?

  1. Capture: invoices arrive by email, portal, post or EDI.
  2. Extraction: fields and line items are read, with a confidence for each value.
  3. Validation: duplicates, arithmetic and vendor master checks run.
  4. Matching: two-way matching compares the invoice with the purchase order; three-way matching adds the goods receipt, usually within a price tolerance.
  5. Coding and approval: the invoice gets its accounts and a sign-off.
  6. Posting and payment: the ERP records the liability and schedules payment.

Published benchmarks show why this chain gets attention. Ardent Partners’ AP Metrics that Matter in 2025, drawn from 212 AP professionals, put the average at $9.40 and 9.2 days per invoice, with a 14% exception rate. Best-in-class teams reported $2.78 and 9.0%, against $12.88 and 22.0% for all others. Ardent’s State of ePayables 2025 gives $9.84, 8.2 days and 18.4%. Its AP Metrics that Matter in 2026, a separate report sponsored by Medius, an AP automation vendor, gives $9.90 against $2.67 for best-in-class, and exception rates of 19.9% against 11.8%. These are survey results, so read them as direction, not as targets. Look closely at what Ardent counts as an exception: coding errors, missing information, approval bottlenecks and missing purchase order data. Better extraction addresses only part of that list. A perfect read of an invoice with no matching PO is still an exception, so be wary of any promise that extraction alone will clear your queue.

What should you evaluate in an invoice extraction API?

Evaluation checklist for an invoice extraction API
AreaQuestion to askWhat to look for
EvidenceDoes each value carry a score and a page location?Per-field confidence and coordinates, including on line items
Missing valuesWhat comes back when the PO number is absent?Null or empty, never a plausible substitute
Line itemsDo rows survive page breaks and wrapped text?Row-level accuracy on your longest invoices
Bundled filesCan one PDF hold several invoices?A separate result for each invoice
NormalisationHow are 1.234,56 and 03/04/26 handled?Stated rules for decimals, dates and currency
New suppliersHow does it do on a supplier it has not seen?Scores from a test set split by sender
Form changesWhat happens when a supplier redesigns?An answer to these questions
ReviewWho sees doubtful values, and how?The source page beside the value, with corrections captured
OperationsWhat are the limits, errors and async options?Documented file limits, error codes and a way to handle long files

Run the checklist on a test set you labelled yourself, with suppliers held out from any setup work, as the pillar guide explains. If receipts or utility bills also reach AP, test them separately: they fail in different ways.

Does e-invoicing make invoice extraction unnecessary?

For invoices that arrive as valid structured data, yes: you parse them, you do not extract them. EN 16931 defines the data model, and Peppol BIS Billing 3.0 publishes a UBL format and validation rules built on it. If a supplier can send that, take it, because no extraction beats perfect data. Regulation is pushing in this direction. Under the EU’s VAT in the Digital Age package, member states can introduce mandatory e-invoicing under specific conditions, and digital reporting for cross-border B2B transactions applies from 1 July 2030. Few AP teams will get there all at once, though. Adoption depends on the country and on each supplier’s systems, so most teams should plan for a mix of structured invoices and PDFs for some time. Design the workflow so both routes end in the same validation and matching steps.

Where does docRefinery fit?

docRefinery is one option if your invoices come from the same suppliers month after month. It returns invoice fields and line items through an API, under the Return as names you choose and in the same format as every other document type. It learns each supplier’s layout once and remembers it, returns null for absent fields, and shows reviewers the source page next to the value. Rules can check that lines add up to the total, and a reviewer’s correction can become a suggested fix for that supplier. It will not replace your ERP’s matching or your approval rules. Try it on your own files on the free Starter plan, up to 100 pages a month, or read the quickstart. The comparison page says where other tools are the better choice.

Common questions

What is the difference between invoice OCR and invoice data extraction?

Invoice OCR turns the page image into text. Invoice data extraction identifies which text is the invoice number, the total and each line item, and returns those as structured fields. OCR alone leaves the mapping to you.

What is three-way matching?

Three-way matching compares an invoice with its purchase order and the goods receipt, so a supplier is paid only for what was ordered and delivered, within set price tolerances. Two-way matching compares the invoice with the purchase order alone. Both need accurate line-level data.

Do I need line items, or are header fields enough?

It depends on what happens next. Header fields are enough to post a non-PO invoice to one account. Line items are needed for purchase order matching, line-level coding and spend analysis. If no later step reads the lines, leave them out.

Can invoice data extraction run with no human review?

For some invoices. Invoices that pass confidence thresholds, arithmetic checks and matching can post untouched. Keep a person on changed bank details, high values and failed checks, and sample the automated stream so that silent errors still get caught.

Sources

  1. Ardent Partners, AP Metrics that Matter in 2025 (February 2025, PDF)
  2. Ardent Partners, The State of ePayables 2025, Part Nine: AP Benchmarks (Payables Place, January 2026)
  3. Ardent Partners, Accounts Payable Metrics that Matter in 2026 (sponsored by Medius)
  4. Peppol BIS Billing 3.0: EN 16931 model bound to UBL, rules
  5. Peppol BIS Billing 3.0
  6. European Commission: VAT in the Digital Age
  7. Amazon Textract: Analyzing invoices and receipts
  8. Amazon Textract: Best practices
  9. Microsoft Learn: Interpret and improve accuracy and confidence scores
  10. Microsoft Learn: Three-way matching policies

Related

See it on a real document.

Upload a file you know well and check every field against the page it came from.

100 pages a month free. No credit card, no sales call.