XRechnung Explained
XRechnung is the German standard for structured electronic invoices. It is mandatory for invoicing German public sector entities (federal, state, and local government).
What is XRechnung?
XRechnung is a pure XML format based on the European EN16931 standard. It contains all invoice data in a machine-readable structure without any human-readable visualization (no PDF).
The standard was developed by the German "Koordinierungsstelle für IT-Standards" (KoSIT) and is officially required for all B2G (business-to-government) invoices in Germany since November 27, 2020.
Technical Details
- Format: XML (based on UBL 2.1 or UN/CEFACT CII D16B)
- Standard: Complies with EN16931
- Current version: XRechnung 3.0.2 (as of 2024)
- File extension: .xml
- Encoding: UTF-8
Who Must Use XRechnung?
XRechnung is mandatory for:
- All suppliers invoicing German federal ministries and agencies
- Suppliers invoicing German state (Länder) and local governments
- Contracts above certain thresholds (typically €1,000 or more)
Note: For B2B (business-to-business) transactions, XRechnung is not mandatory yet, but it can be used. Many businesses prefer ZUGFeRD for B2B because it includes a human-readable PDF.
XRechnung vs. ZUGFeRD
| Feature | XRechnung | ZUGFeRD |
|---|---|---|
| Format | Pure XML | PDF with embedded XML |
| Human-readable | No (XML only) | Yes (includes PDF) |
| Use case | B2G (public sector) | B2B (businesses) |
| EN16931 compliant | Yes | Yes (in profile EN16931) |
| File size | Small (XML only) | Larger (includes PDF) |
How to Create XRechnung Files
Most modern accounting and invoicing software can generate XRechnung files:
- DATEV: Integrated XRechnung support
- Lexware: XRechnung export
- SAP: XRechnung module
- Open-source tools: mustangproject (Java library)
Make sure your software is updated to support the latest XRechnung version (currently 3.0.2).
Validating XRechnung Files
Before sending an XRechnung invoice, you should validate it to ensure it meets all technical requirements. Invalid invoices will be rejected by public sector systems.
eDocuPortal uses the official KoSIT validator to check your XRechnung files against:
- XML schema validation (structural correctness)
- EN16931 business rules (semantic requirements)
- XRechnung-specific rules (German extensions)
Our validator runs the same checks used by German government systems, so passing our validation significantly reduces the risk of rejection.
Common XRechnung Errors
Typical validation errors include:
- Missing CustomizationID: Required field identifying the XRechnung version
- Invalid VAT numbers: Format must comply with EU standards
- Missing required fields: Certain fields are mandatory for EN16931
- Incorrect date formats: Must use ISO 8601 (YYYY-MM-DD)
- Invalid currency codes: Must use ISO 4217 codes (e.g., EUR, USD)