W System / Blog / From a PDF invoice to XRechnung: a draft for review, not a finished e-invoice

From a PDF invoice to XRechnung: a draft for review, not a finished e-invoice

In short: POST /einvoice/extract reads the text layer of a PDF invoice with AI, maps the fields into the JSON used by /einvoice/create, and builds an XRechnung that is checked against CEN EN 16931 and the KoSIT XRechnung rules. Every field has a confidence score, the totals are recomputed against the amounts printed on the PDF, and the result is always marked draft_for_review. It is not a finished e-invoice. OCR is not supported: a scanned image with no text layer is rejected.

What you get back

A successful call returns extracted fields, a confidence score from 0 to 1 for each one, an arithmetic check, and — when the amounts add up — the XRechnung XML plus the validation result. Fields below 0.8 appear in review.low_confidence. That list is a way to prioritise a human check, not a guarantee that the other fields are right.

If the recomputed line totals, net, VAT or gross do not match the totals printed on the invoice, the status is needs_review_amounts and no XML is built. You fix the lines and then send the invoice JSON to /einvoice/create. A file can still pass the KoSIT and EN 16931 rules and carry the wrong amounts, which is why a person should check the draft against the source PDF before it is sent or booked.

AI can misread or invent values. The result is not tax or legal advice, and it is not accepted just because the XML is technically valid.

Which PDFs work

The PDF text is sent to OpenAI for processing (a subprocessor; see the DPA and privacy policy). Use the endpoint only if you may do that with those invoices.

Price

80 units per successful extraction: €0.157 on Pro (€49 for 25,000 units) and €0.304 on Starter (€19 for 5,000 units), euro excluding VAT. Failed extractions are not charged. A free key includes 3 extractions a month to try it; after that a paid plan is needed. The endpoint needs an API key (it is not available without a key or over x402).

A desktop option: druckwandel

druckwandel is an open-source desktop app for Windows and macOS that converts PDF invoices into validated XRechnung and ZUGFeRD/Factur-X files, with optional W System AI extraction. It is a listed integration on /integrations and /de/integrations. The current release is always the latest on GitHub (this page does not pin a version). Optional AI extraction is billed through W System; the desktop converter itself is the third-party project.

Try it

The full walk-through, a sample response and the curl commands are on the landing page, in English and German:

Zur Seite: PDF zu XRechnung

Prices and behaviour checked against the live product pages and PUBLIC_FACTS on 5 December 2026. Not tax or legal advice.

Facts checked 2026-12-05. W System is the maker of this product. Not affiliated with the European Commission. Not legal or tax advice.