XRechnung is Germany's binding standard for electronic invoices in public procurement – and since January 1, 2025 is being progressively extended to all domestic B2B transactions. This guide brings together everything businesses, accountants, and developers need to know about XRechnung: from the legal foundations and technical structure to practical submission and GoBD-compliant archiving.
1. What Is XRechnung?
XRechnung is a structured XML data format for electronic invoices developed by the German standards body KoSIT (Koordinierungsstelle für IT-Standards). It implements the European core invoice standard EN 16931 in two XML syntaxes: UBL (OASIS Universal Business Language) and CII (UN/CEFACT Cross Industry Invoice). Unlike a PDF, an XRechnung file contains only machine-readable, structured data – with no visual representation whatsoever.
2. The Legal Foundations
- EU Directive 2014/55/EU: Obliges EU member states to accept structured e-invoices in public procurement.
- E-Rechnungsverordnung (ERechV) 2019: Transposes the EU directive into German federal law; XRechnung becomes mandatory for all federal suppliers from November 27, 2020.
- Wachstumschancengesetz 2024 (§ 14 UStG amended): Extends the obligation to domestic B2B transactions – in phases from 2025 to 2028.
- State regulations (Landesverordnungen): Most German states have enacted their own regulations extending the obligation to state and municipal authorities.
3. The 2025–2028 Timeline in Detail
- January 1, 2025 – Receiving obligation: All businesses established in Germany must be able to receive structured e-invoices. PDF invoices remain permitted by mutual agreement.
- January 1, 2027 – Sending obligation for large businesses: Companies with prior-year turnover exceeding €800,000 must send structured e-invoices for domestic B2B transactions.
- January 1, 2028 – Universal sending obligation: All remaining businesses – regardless of turnover or size – must send structured e-invoices for domestic B2B invoices.
- Exceptions: Invoices below €250 (Kleinbetragsrechnungen under § 33 UStDV), B2C transactions, and certain tax-exempt supplies are excluded.
4. XRechnung vs. PDF: The Decisive Difference
A PDF invoice is an image of a document – readable by humans but only extractable by machines through error-prone OCR. An XRechnung is a pure data document: structured fields that can be imported directly into ERP systems, accounting software, and government platforms – without any manual data entry.
5. UBL vs. CII: Which Syntax to Choose?
Both syntaxes are officially permitted for XRechnung and are legally equivalent. UBL (file extension .xml, root element Invoice) is more widely used in Germany and is preferred by the ZRE federal platform. CII (file extension .xml, root element CrossIndustryInvoice) is the basis of ZUGFeRD. If your software generates CII and you invoice exclusively to government bodies, check beforehand whether the submission portal accepts CII.
6. The Structural Layout of an XRechnung
An XRechnung is hierarchically organized into business groups (BG) and business terms (BT) as defined by EN 16931. The key groups at a glance:
- BG-1 Invoice information: Invoice number (BT-1), issue date (BT-2), invoice type code (BT-3), currency (BT-5).
- BG-4 Seller: Name, address, VAT ID (BT-31) or tax number (BT-32), contact details (BT-41 to BT-43).
- BG-7 Buyer: Name, address, buyer reference / Leitweg-ID (BT-10).
- BG-13 Delivery information: Delivery date (BT-72), delivery address (optional).
- BG-16 Payment instructions: Payment means code (BT-81), IBAN (BT-84), BIC (BT-86), due date (BT-9).
- BG-23 VAT breakdown: Tax category (BT-118), tax rate (BT-119), taxable amount (BT-116), tax amount (BT-117).
- BG-22 Document totals: Sum of line net amounts (BT-106), total tax (BT-110), gross amount (BT-112), payable amount (BT-115).
- BG-25 Invoice lines: Per line: description (BT-153), quantity (BT-129), unit (BT-130), net amount (BT-131), tax category (BT-151).
7. Mandatory Fields – Complete List
The German XRechnung extension rules (CIUS DE) define additional mandatory fields beyond EN 16931. For a valid XRechnung, at minimum the following fields must be populated:
- BT-1 Invoice number (unique, assigned by the seller)
- BT-2 Invoice date (ISO format YYYY-MM-DD)
- BT-3 Invoice type code (380 = Invoice, 384 = Credit note)
- BT-5 Invoice currency (ISO 4217, e.g. EUR)
- BT-9 Payment due date
- BT-10 Buyer reference / Leitweg-ID (mandatory for B2G)
- BT-27 Seller name
- BT-31 Seller VAT ID or BT-32 Seller tax number
- BT-35 to BT-37 Seller address (street, city, postcode)
- BT-40 Seller country code (ISO 3166-1 alpha-2, e.g. DE)
- BT-41 Seller contact name (CIUS DE: mandatory)
- BT-42 Seller contact telephone (CIUS DE: mandatory)
- BT-43 Seller contact email (CIUS DE: mandatory)
- BT-44 Buyer name
- BT-81 Payment means code (58 = SEPA credit transfer)
- BT-84 Payment account IBAN
- BT-106 Sum of line net amounts
- BT-110 Total VAT amount
- BT-112 Invoice total amount inclusive of tax
- BT-115 Amount due for payment
8. The Leitweg-ID – Routing in the Public Sector
The Leitweg-ID (BT-10) is the routing address in the German government invoicing system. Without it, every B2G XRechnung fails with the critical KOSIT error BR-DE-2. The Leitweg-ID has the format [area code]-[institution code]-[check digit], e.g. 04011000-1234512345-06. It is assigned by the contracting authority and should always be taken from the contract or purchase order.
9. VAT in XRechnung: Categories and Codes
XRechnung distinguishes several VAT categories (BT-118), coded according to EN 16931:
- S – Standard rate: In Germany 19% (standard) or 7% (reduced).
- Z – Zero rated: 0% VAT, e.g. intra-community supplies.
- E – Exempt: VAT-exempt supplies (e.g. small businesses § 19 UStG, medical services § 4 No. 14 UStG).
- AE – Reverse charge: Tax liability transferred to the recipient.
- K – Intra-community supply (no VAT shown).
- G – Export outside the EU (export delivery).
Small businesses (§ 19 UStG) set tax category E, tax rate 0, and fill BT-120 (tax exemption reason) with a reference to § 19 UStG. BT-31 can be omitted in this case if BT-32 (Steuernummer) is provided instead.
10. Calculation Rules and Rounding
Rounding errors are the most common cause of KOSIT validation errors BR-CO-10 (sum of lines) and BR-CO-13 (VAT amount). The correct calculation logic:
- Net amount per line = quantity × unit price (do not round).
- BT-106 sum of line net amounts = exact sum of all line net amounts, round to 2 decimal places only after summing.
- BT-116 taxable amount = BT-106 minus document-level allowances plus charges.
- BT-117 tax amount = BT-116 × tax rate / 100, rounded to 2 decimal places.
- BT-112 total inclusive of tax = BT-106 + BT-110 (total tax).
- BT-115 payable amount = BT-112 minus any prepaid amount.
11. KOSIT Validation: What Is Checked
Every XRechnung goes through several validation layers upon submission:
- XML well-formedness: Syntactically correct XML (proper tags, nesting, encoding).
- XML schema validation (XSD): Data types, element order, and mandatory attributes per UBL or CII schema.
- EN 16931 Schematron rules: European business rules (BR-01 to BR-CO-*) for the core invoice model.
- CIUS DE Schematron rules: German extension rules (BR-DE-1 to BR-DE-31), e.g. mandatory contact fields.
12. The 10 Most Common Validation Errors
- BR-DE-1: Missing VAT ID (BT-31) – required even for small businesses (use category E + BT-120).
- BR-DE-2: Missing Leitweg-ID (BT-10) – mandatory for every B2G invoice.
- BR-DE-3: Missing seller contact telephone (BT-42).
- BR-DE-4: Missing seller contact email (BT-43).
- BR-CO-10: Sum of line net amounts does not match BT-106.
- BR-CO-13: Calculated VAT amount differs from declared value.
- BR-DE-17: Invalid invoice type code (BT-3) – only specific UNTDID 1001 codes permitted.
- Date format error: BT-2, BT-9, BT-72 must be in ISO format YYYY-MM-DD.
- IBAN format error: Spaces in BT-84 cause rejection – always provide IBANs without spaces.
- Namespace error: Incorrect or missing xmlns declarations make the document schema-invalid.
13. Submitting XRechnung: ZRE and OZG-RE
Federal invoices are submitted via the Zentrale Rechnungseingangsplattform (ZRE) at xrechnung.bund.de. The ZRE accepts submissions by web upload, email, and De-Mail. State and municipal invoices are submitted via OZG-RE (Online Access Act invoice receipt) or state-specific portals. An overview of state portals can be found on the IT-Planungsrat website.
14. Creating XRechnung with Common Software
- DATEV: DATEV Unternehmen online and DATEV Rechnungswesen support XRechnung export natively.
- SAP: SAP S/4HANA and SAP Business One can generate XRechnung via standard output channels.
- Lexware: Integrated XRechnung creation from Lexware Office 2024 onwards.
- Sevdesk / Fastbill: Cloud accounting tools with XRechnung export in recent versions.
- Our XRechnung Generator: Free browser-based creation of compliant UBL XML files – no installation required.
15. GoBD-Compliant Archiving of XRechnungen
XRechnung files are tax-relevant documents and must be retained for 10 years under § 147 AO. The GoBD requires immutable storage with an audit trail. Concretely: the original XML must not be converted to another format and stored as the sole archival document. A revision-safe document management system (DMS) or certified archive solution must be used, one that generates cryptographic fingerprints (hash values) and maintains complete logs of every access.
16. XRechnung for B2B: What Changes from 2025
The Wachstumschancengesetz has amended § 14 UStG to distinguish three invoice types: the E-Rechnung (structured format per EN 16931), the sonstige Rechnung (PDF, paper – only permitted with recipient's consent until 2027/2028), and the elektronische Rechnung (umbrella term for both). For B2B: from 2025 every recipient must be able to accept e-invoices. From 2027 or 2028 the sender must generate e-invoices.
17. Peppol and XRechnung: How Are They Related?
Peppol (Pan-European Public Procurement On-Line) is a transport network for electronic documents used in many EU countries for transmitting e-invoices. Peppol BIS Billing 3.0 is also based on UBL and is largely compatible with XRechnung, but differs in mandatory fields and business rules. Germany has permitted Peppol as an optional transmission channel for XRechnung; the ZRE federal platform supports Peppol as a submission channel.
18. Frequently Asked Practical Questions
Can I cancel an XRechnung?
XRechnung has no standalone cancellation format. A credit note (invoice type code 384) is issued to correct an erroneous invoice. The credit note references the original invoice number in BT-25 (preceding invoice reference). A new corrected invoice with a new invoice number is then issued if needed.
How do I attach documents to an XRechnung?
XRechnung supports attachments via the AdditionalDocumentReference element (BG-24). Binary files (PDFs, images) must be Base64-encoded and embedded in the EmbeddedDocumentBinaryObject field. Alternatively, a URI can point to an externally stored document. Attachments are optional – for B2G submissions check whether the government portal accepts attachments of your file size.
What is the current XRechnung version?
KoSIT publishes XRechnung at regular intervals. Version 3.0 (released 2023) has been the current mandatory version for federal submissions since February 1, 2024. Check xeinkauf.bund.de regularly for version changes, as older versions may be rejected after a transition period.
Our XRechnung Viewer validates your XRechnung file free of charge, entirely in the browser, against all KOSIT validation rules – including CIUS DE extension rules and EN 16931 business rules. No file ever leaves your computer.