How to Validate an XRechnung Before Sending It
A syntactically correct XRechnung file can still fail validation. Knowing what to check before you send saves the rejection cycle and the delay in getting paid.
What validation checks
An XRechnung validator runs two categories of checks: schema validation (is the XML well-formed and uses the correct structure?) and schematron validation (do the values satisfy the business rules defined in EN 16931 and the German CIUS?). Passing both means the invoice is technically compliant with the standard. It does not guarantee the recipient will accept it if their system adds additional requirements.
The official validator: KoSIT
The Koordinierungsstelle fur IT-Standards (KoSIT) publishes the reference validator used by German public administrations. It is available as a command-line tool and a web interface at its official repository. Upload or paste the XML and the tool lists every failed rule with the relevant field path. This is the same validator public sector recipients use, so passing it gives strong confidence the invoice will not be rejected on technical grounds.
Common validation errors and how to fix them
- Missing BT-29 (seller identifier) or BT-46 (buyer identifier): add the required party identifier field.
- Invalid Leitweg-ID format in BT-10: the format must be XX-YYYYYY-Z with correct check digit. See the Leitweg-ID specification.
- Wrong VAT category code: BT-151 must use the UN/CEFACT code list. S for standard rate, Z for zero, E for exempt, AE for reverse charge.
- Missing or malformed payment means: BT-81 (payment means code) and BT-84 (IBAN) must both be present when payment by credit transfer is specified.
- Invalid date format: all dates in XRechnung must use ISO 8601 format (YYYYMMDD or YYYY-MM-DD depending on the profile version).
Validating ZUGFeRD files
ZUGFeRD embeds the XML invoice inside a PDF. Validators for ZUGFeRD check the embedded XML against the same EN 16931 rules. The Mustang Project (mustangproject.org) provides an open-source validator for ZUGFeRD in addition to the KoSIT tool. Both are freely available.
What validation cannot catch
Validation confirms technical compliance, not commercial accuracy. A valid invoice with the wrong amount, the wrong line items or the wrong Leitweg-ID for this specific recipient passes validation but is rejected or disputed by the buyer. Double-check commercial details manually before sending. For background on the mandate and required fields, see e-invoice required fields and the German e-invoicing mandate. E-Rechnung helps you create compliant invoices. This is general information, not tax or legal advice.
Common questions
- How do I validate an XRechnung?
- Use the KoSIT validator (available at the KoSIT GitHub repository). Upload or paste your XML and it checks compliance against EN 16931 and the German CIUS. It is the same validator used by public sector recipients in Germany. This is general information, not tax or legal advice.
- What are the most common XRechnung errors?
- Missing party identifiers, incorrect Leitweg-ID format, wrong VAT category codes, missing payment means fields, and incorrectly formatted dates. The KoSIT validator lists each failed rule with the field path so you can locate and fix the issue.
- Does a valid XRechnung guarantee payment processing?
- Technical validity means the file conforms to the standard. The recipient's system may add further requirements beyond the standard. Always test with the specific buyer or public authority first, especially for new trading relationships. This is general information, not tax or legal advice.