validate_einvoice
Reads an existing electronic invoice and reports what is wrong with it. Accepts XRechnung and ZUGFeRD XML in either EN 16931 syntax — CII (used by XRechnung and ZUGFeRD) and UBL — and reports the syntax and profile it found along with the invoice's key fields, so it also answers "what is this file?".
It checks the rules behind most real rejections: BT-10 buyer reference present, and its Leitweg-ID check digit when it looks like one; BT-34 and BT-49 electronic addresses present; tax category S not used at 0 %; BT-120 exemption reason present for categories E and AE; line amounts summing to BT-106; net plus tax equalling the BT-112 gross; BT-115 amount due matching gross less prepaid; and the due date not falling before the issue date.
What this does NOT do:
It is NOT the KoSIT Prüftool and is not a substitute for it. It covers the rules that account for most rejections, not the full EN 16931 Schematron suite. A file that passes here can still be rejected by a Rechnungseingangsportal.
It does not check the XSD schema, so a structurally invalid document may parse here.
It reads XML only. A ZUGFeRD PDF must have its embedded XML extracted first — pass the XML, not the PDF.
Nothing is stored: the document is parsed in memory and discarded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | Yes | The full XML text of the invoice. For ZUGFeRD, the XML extracted from the PDF, not the PDF itself. |