Skip to content
Giminger ConsultingDE

Extract and check invoice data with AI

Key takeaway

For unstructured invoices, first define a fixed target schema, meaning which fields are extracted in which format. Fixed rules then check every result for totals, tax rates, duplicates and bank details, and only suspicious documents go to a review queue for a person.

Lessons in this path
  1. E-invoice, PDF and paper: where AI helps and where it does not
  2. Extract and check invoice data with AI
  3. Approval, ERP handover and audit-proof archiving

Define a target schema

A target schema is the list of fields that should end up in your system, with data type and format. Stick to the terms used by your ERP or accounting software and, where possible, the fields of EN 16931. That way AI results and structured e-invoices end up in the same format.

Excerpt of a target schema
FieldFormatRequired
Supplier (VAT ID or supplier number)text, checked against master datayes
Invoice numbertextyes
Invoice date, service dateISO dateyes
Net, tax per rate, grossdecimal, currencyyes
Purchase order numbertextif present
IBANtext, checksumyes
Line itemslist with quantity, price, itemdepends on process

Tools for extraction

There are three routes: features in your accounting or ERP software, specialised document processing services (intelligent document processing, often abbreviated as IDP) and general language models with structured output, connected via an automation tool such as n8n, Make or Power Automate. The built-in solution is the simplest, your own chain the most flexible.

For each option ask: where are the documents processed? Is there a data processing agreement? Is data used for training? Does the tool provide a source location in the document for each field so reviewers can compare quickly?

Rules every result must pass

The AI extracts, the rules decide whether a person needs to look. These rules are easy to implement and far more reliable than any model’s self-assessment:

  1. Net plus tax equals gross; line items add up to net.
  2. Tax rate is plausible for supplier and service.
  3. Invoice number and supplier have not already been posted (duplicate).
  4. IBAN matches the supplier master record.
  5. Order number exists and amount is within tolerance.
  6. Mandatory details under Section 14 VAT Act are present.

Changed bank details are the classic pattern in invoice fraud. They must never be accepted automatically, only after calling the supplier back on a known number.

Going deeper: measure accuracy per field

A statement like “the AI reads 95 percent correctly” is worthless as long as it is unclear what it refers to. Measure per field: for how many documents is the value exactly right, wrong or missing? An error in the IBAN weighs more than one in the service date. Create a test set of 50 to 100 real, already checked documents, mixed by supplier and quality.

Costs arise per page or per volume of data processed. Multi-page invoices with many line items are considerably more expensive and error-prone. Check whether you really need line items or whether header data plus order matching suffice. Repeat the measurement after every model or vendor change.

Example: a wholesaler with many small suppliers

Example (fictional): an electrical wholesaler has several hundred suppliers, many of them small and with their own PDF layouts. The team defines a target schema with twelve header fields and initially skips line items, because matching is done via the purchase order.

A test set of 80 checked documents shows: supplier, amounts and invoice number are almost always recognised correctly, the service date less often, and the order number is frequently missing because suppliers do not state it. The rules catch two documents where the bank details do not match the master record. After calling back, both turn out to be account changes; one had been properly notified, the other had not.

Common mistakes

  • Starting without a fixed target schema and extracting different fields each time.
  • Trusting the model’s confidence score instead of fixed plausibility rules.
  • Measuring accuracy as a single number instead of per field.
  • Automatically copying bank details from the invoice into the supplier master record.

Frequently asked questions

How many documents do we need for a meaningful test?

As rough orientation, 50 to 100, mixed by supplier, layout and scan quality. More important than volume is including difficult cases such as credit notes, multi-page invoices and poor scans.

Can we extract invoices with a general chat tool?

For a first impression yes, with anonymised examples. For production you need an integration with a contract, fixed schema, logging and rules. A chat window provides none of that.

Try it yourself

Define a target schema with at most 15 fields, assemble a test set of 50 already checked PDF invoices and run two tools on it. Evaluate accuracy per field.

Check your result

You can state for every field how often it is right, wrong or empty, and which rules send a document to human review.

Official documentation and sources

Practical guides and references