Invoice data extraction

Invoice data extraction turns a supplier invoice, whether PDF, scan or photo, into structured fields your accounts payable system can post. docRefinery's invoice OCR API covers 62 field definitions, from invoice ID to every line item, and returns JSON with a confidence score and page and box citations on extracted values. Fields that aren't on the page come back null.

Updated

Where invoice extraction fits in accounts payable

AP clerks and controllers use it at the front of the payables process, in place of typing invoices into the ERP. Approval and payment stay where they are. The output also feeds three-way matching, the control that compares the order, the delivery record and the supplier's bill and blocks payment on a variance. That is why line-level quantity, unit price and PO reference matter as much as the total.

Keying and chasing exceptions is where the cost sits. Ardent Partners puts the average cost of processing an invoice at $9.90, against $2.67 for best-in-class teams, with an average exception rate of 19.9% against 11.8% (a Medius-sponsored survey, not our measurement). A fixed supplier list sending the same forms every month is the best case for docRefinery: each layout is learned once and remembered. See document extraction for accounts payable.

Invoice fields docRefinery extracts

All 62 definitions are below, counting the two repeating tables and their columns. Your organisation decides which are switched on, sets a threshold for each, and can add custom fields.

The 62 invoice field definitions, by category
CategoryFields
Identity and datesInvoice ID, Invoice Type, Invoice Date, Due Date, Delivery Date, Service Period Start, Service Period End, Purchase Order
PaymentPayment Terms, Payment Method, Currency, Currency Exchange Rate, Supplier Payment Ref, Supplier IBAN, Supplier Bank Name, Supplier SWIFT/BIC
TotalsNet Amount, Total Tax Amount, Freight Amount, Discount Amount, Total Amount, Amount Paid Since Last Invoice, Amount Due
SupplierSupplier Name, Supplier Address, Supplier Email, Supplier Website, Supplier Phone, Supplier Registration, Supplier Tax ID
ReceiverReceiver Name, Receiver Address, Receiver Email, Receiver Website, Receiver Phone, Receiver Tax ID, Customer Account Number
Remittance and shippingRemit To Name, Remit To Address, Ship To Name, Ship To Address, Ship From Name, Ship From Address, Carrier
Line Item (table)Line Number, Description, Product Code, Quantity, Unit, Unit Price, Line Amount, Discount, Line Tax Rate, Line Tax Amount, Line Purchase Order, Line Delivery Date
VAT (table)Category Code, VAT Tax Rate, VAT Amount, VAT Tax Amount

Example invoice JSON

This is a trimmed excerpt of a finished run, with invented values. bbox gives the value's position as fractions of the page, and each alias is the name set under Return as, shown here at its default. The full response is in Extract a document.

Excerpt: invoice result
{
  "document_type": "invoice",
  "result": {
    "fields": [
      { "alias": "Invoice ID", "text": "INV-0042", "field_confidence": 0.98,
        "location": { "page": 1, "bbox": [0.66, 0.09, 0.81, 0.11] } },
      { "alias": "Supplier Tax ID", "text": "GB000000000", "field_confidence": 0.71,
        "location": { "page": 1, "bbox": [0.08, 0.17, 0.26, 0.19] } },
      { "alias": "Purchase Order", "text": null, "location": null },
      { "alias": "Line Item", "table": [[
        { "alias": "Description", "text": "Sample widget, blue", "field_confidence": 0.96,
          "location": { "page": 1, "bbox": [0.08, 0.42, 0.44, 0.44] } },
        { "alias": "Unit Price", "text": "12.50", "field_confidence": 0.97,
          "location": { "page": 1, "bbox": [0.62, 0.42, 0.70, 0.44] } }
      ]] }
    ],
    "extraction_approval": "human-approval",
    "low_confidence_fields": [
      { "alias": "Supplier Tax ID", "text": "GB000000000", "confidence": 0.71,
        "threshold": 0.85, "reason": "low_confidence" }
    ]
  }
}

What docRefinery brings to invoice extraction

docRefinery is a next-generation extraction system built for invoices that keep coming back. Eight things change on an AP desk.

  • Your names on every value. Each field has a Return as alias, so Supplier Tax ID can arrive as vendor_vat if that is the column your ERP import expects.
  • One format for the whole inbox. Invoices return the same field and table shape as purchase orders, receipts and statements, so one parser reads them all.
  • Line items as rows. Quantity, unit price, tax and PO reference stay together per line, ready for matching.
  • Suppliers remembered. Each layout is learned once, and a redesign is re-trained when it first arrives.
  • A source behind the figures. Extracted values and table cells carry page and box citations, so an approver checks the invoice itself.
  • Corrections that pay back. A clerk's fix becomes a suggested fix for that supplier's layout, tested on that layout's own invoices before anyone applies it.
  • Supplier-level insight. Insights shows vendors, flagged fields and auto-approval trends for your account, so a problem supplier stands out.
  • Overseas suppliers. 70+ languages and scripts are supported, so a foreign invoice doesn't need a second tool.

Data reaches your ERP through the API or an export today. Inbox pickup, webhooks and ERP connectors are in design on the roadmap.

What makes invoices hard to read

  • Four parties, four addresses. Supplier, receiver, remit-to and ship-to all look alike, and the wrong one is still a plausible address.
  • Line tables that break. Tables run across pages, lose their header row, or carry subtotals mid-table.
  • Mixed tax. One invoice can carry several VAT rates, stated per line and again in a summary block.
  • Rules differ by country. GOV.UK's list requires a unique number, the supply date and the amounts, not where they sit or what they are called.
  • Ambiguous dates. 03/04 means different months in different countries.
  • Marks on scans. Stamps and handwritten approvals often land on top of the figures.

How low-confidence invoice values are handled

Every value is checked against the threshold set for that field, so Supplier IBAN can demand far more than Supplier Website. Below the bar, the run is marked human-approval and the value waits in the review queue, where a clerk sees the box on the page and corrects it. A required field that can't be found is flagged as missing. You can also write a workflow rule such as "line amounts add up to the net amount, within a cent", and a failed rule is flagged the same way. Exports to JSON, CSV or XLSX carry the corrected values.

Common questions

Can I extract data from an invoice PDF through an API?

Yes. Send a PDF, PNG, JPEG or TIFF of up to 100 MB and poll for the JSON result. Starter is free up to 100 pages a month; the docs show the calls.

Does docRefinery do the three-way match?

No. It supplies the invoice side of the match: PO reference, quantities and prices, each scored. The match itself and payment stay in your AP or ERP system.

What happens when a supplier redesigns its invoice?

The new layout is learned in turn, and scoring and review carry on as before. The guide to vendor layout changes covers it.

Is it worth it if every invoice comes from a new supplier?

Less so, because layout memory pays off when senders repeat. A one-off invoice still gets your Return as field names, line items as rows, per-field thresholds and review, page and box citations, rules on the totals, and the same JSON format as everything else. What it misses is the head start a remembered layout gives.

Can invoice fields come back under our own column names?

Yes. Set a Return as alias on any field and that name becomes the key in the JSON and the header in a CSV export. Renaming changes the label only, never what is extracted, and the output format stays the same for every supplier.

Sources

  1. Ardent Partners, Accounts Payable Metrics that Matter, 2026 (sponsored by Medius)
  2. ERP Research: three-way matching
  3. GOV.UK: what an invoice must include

Related

Try it on your own documents.

Upload a real file and see each field with its confidence score, ready to check.

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