LR
← All projects
01Live demo

Invoice intake with matching

Ten documents the way they really arrive: PDF, stamped scan, skewed phone photo, crumpled receipt, e-invoice. Four errors and a tight discount deadline are planted. All companies are made up.

The problem

Why bother? Because retyping costs money.

Every one arrives differently
96 % · 93 %
receive invoices by email · still accept them by post

A PDF in the inbox, a stamped letter, a phone photo, a receipt from a jacket pocket, plus e-invoices as XML. Someone types in the values, digs out the purchase order and delivery note and compares line by line.

What it costs
$9.90
per invoice on average, best teams: $2.67

Almost one invoice in five becomes an exception that has to be sorted out by hand: wrong quantity, different price, missing purchase order. On average it takes over 9 days for an invoice to get through. US figures; there are no current German ones.

What you gain
36,7 %
annual interest lost by missing a 2% early-payment discount

No more retyping. Overbilled quantities and duplicate invoices surface before payment, not after. Discount deadlines stop slipping: 2% for paying in 10 instead of 30 days works out at 36.7% a year. And every decision can be traced.

5.3 s
per document (avg)
0.48 US¢
per document (avg)
188/189
fields read correctly
344 €
caught in 10 documents
Inbox · 10 documents
<ubl:Invoice>
<cbc:ID>LL-2026-55821</cbc:ID>
<cbc:IssueDate>2026-09-30</cbc:IssueDate>
<cac:OrderReference>
<cbc:ID>BE-2026-0421</cbc:ID>
</cac:OrderReference>
<cac:LegalMonetaryTotal>
<cbc:PayableAmount>51.31</cbc:PayableAmount>
...
XML
The model detects document type and paper corners. Photos are flattened in the browser from those corners.

Recorded on 01/10/2026. Draft: Gemini's free tier allows 20 requests per day and model, so the readings come from three Gemini Flash versions. The final run will be Gemini 3.8 Flash throughout.

Production-ready

Not a pilot. Five points make the difference.

79% of companies report rolling out AI agents. Only 11% run them in production (Gartner 2026). The model is rarely the problem. These five points are.

✓

Approval

Nothing gets paid automatically. A human reviews amber cases, red ones are blocked, green ones are posted with one click.

✓

Traceable

Every value shows where it came from. Every finding names its rule and numbers.

✓

Permissions

The model only reads. No write access to the ERP, no access to payments.

✓

Cost

0.48 US¢ per document, measured. 1,000 documents a month: about €4.16.

✓

Test

188 of 189 fields, 8 of 9 documents fully correct. All 4 planted errors and the discount deadline caught.

Why it's built this way

The model reads. Code does the maths.

01

Model only for reading

Matching, tax and mandatory fields are rules. Rules belong in code: same input, same output, auditable by accounting.

02

E-invoices without a model

Since 2025 German companies must accept e-invoices, and from 2027 or 2028, depending on turnover, issue them. I parse the XML directly: zero cents, zero errors. AI only where there's paper.

03

Source location over speed

DeepSeek V4.1 Flash reads almost as well (186 vs 188 of 189 fields) and is 9.6× faster. But its boxes miss, see below. Without a source location nobody can verify, so Gemini.

Gemini 3.8 Flash
Gemini 3.8 FlashBoxes sit on the value
DeepSeek V4.1 Flash
DeepSeek V4.1 FlashValues right, boxes off
ModelDocsFields correctTime avgCost avgLocations
Gemini 3.8 Flash5101/1025.6 s0.50 US¢precise
Gemini 3.7 Flash361/615.2 s0.54 US¢precise
Gemini 3.6 Flash6127/1285.2 s0.44 US¢precise
DeepSeek V4.1 Flash9186/1890.5 s0.22 US¢imprecise

All 14 Gemini runs combined: 289/291 fields. The 188/189 above counts the 9 readings in the demo. Times measured on the free tier, which is throttled under load. DeepSeek is a Chinese provider: a minus for real customer data.

What went wrong

Three bugs. All mine.

Missed the duplicate at first

On the photo the model reads “Weber & Söhne”, in the PDF the full company name. My matcher keyed on the name and saw two suppliers. Now: invoice number plus amount.

Shipping flagged as “not delivered”

Shipping never appears on a delivery note. The matcher reported €8.21 overbilled. Lines without a delivery-note line are no longer quantity-checked.

My test set was wrong, not the model

The receipt prints no quantity. The model correctly returned none, my test set expected 1. Ten “errors” vanished once I fixed the test set.

Monthly maths1,500 documents
Model cost (measured)
€6.25
By hand (€10–18 per invoice*)
€15k–27k

* Vendor benchmark incl. staff time. A human still reviews flagged cases, so real savings are smaller than the difference. Mid-sized companies typically see 800–5,000 incoming invoices a month.

Deployment options

Cloud-API

Gemini 3.8 Flash

The demo runs on the free tier with made-up documents. In production: paid tier, no training on inputs, DPA with Google.

EU cloud

Vertex AI · europe-west3

Same model, processed in Frankfurt. Switch: endpoint and credentials.

On-premise

PaddleOCR-VL / Qwen3-VL-8B

Should run on a 16 GB graphics card (Qwen3-VL-8B quantised). Benchmark on my RTX 5070 Ti is next, results will land here.