The XRechnung is the mandatory electronic invoice format for the public sector in Germany. For car dealers who supply vehicles to government agencies, municipalities, or public institutions, creating XRechnung invoices is no longer optional – it is a legal obligation. But the format is also gaining importance in the B2B sector. In this comprehensive guide, you will learn everything you need to know as an automotive dealer about the XRechnung: from the technical structure to mandatory fields to industry-specific considerations such as margin taxation.
What is the XRechnung? Definition and background
The XRechnung is the German standard for electronic invoices to public sector clients. Unlike a PDF invoice, which is ultimately just a digital representation of a paper format, the XRechnung is a purely machine-readable XML file. Humans cannot directly read an XRechnung without specialized software – but IT systems can process it automatically.
The European foundation: EN 16931
The XRechnung is based on the European standard EN 16931, which defines a uniform semantic data model for electronic invoices. This standard was created under EU Directive 2014/55/EU to harmonize cross-border electronic invoice exchange.
Good to know: The XRechnung is the German implementation (CIUS – Core Invoice Usage Specification) of the EN 16931. This means: it fulfills all European requirements and supplements them with specifically German rules – such as the obligation to include a Leitweg-ID (routing ID).
Pure XML – no PDF, no hybrid
A key difference from other e-invoice formats: the XRechnung is exclusively XML. There is no visual representation, no embedded PDF. The file contains only structured data in a defined schema. For a human-readable view, a so-called XRechnung viewer or an XSLT stylesheet is needed that transforms the XML data into a readable HTML display.
When is the XRechnung mandatory?
The XRechnung is currently mandatory primarily in business dealings with the public sector. Since November 27, 2020, all invoices to federal agencies must be submitted in XRechnung format. The obligations vary by recipient:
Federal level (B2G)
- Mandatory since November 2020 for all suppliers to the federal government
- Submission via the Central Invoice Receipt Platform (ZRE) of the federal government
- Or via the OZG-compliant Invoice Receipt Platform (OZG-RE)
- Invoices under 1,000 EUR net may be partially exempt
State and municipal level
The German federal states have implemented the EU directive differently. In many states, there is already an obligation to accept and in some cases also to send e-invoices:
| Federal state | Mandatory since | Notable details |
|---|---|---|
| Bremen | 2020 | Pioneer, comprehensive mandate |
| Baden-Wuerttemberg | 2022 | Mandatory for suppliers above threshold |
| Bavaria | 2024 | Receipt obligation, sending obligation phased in |
| North Rhine-Westphalia | 2024 | Comprehensive e-invoicing mandate |
| Hamburg | 2024 | XRechnung for all suppliers |
| Lower Saxony | 2025 | Phased introduction |
The future: XRechnung in the B2B sector
From January 1, 2025, all companies in Germany must be able to receive e-invoices. From 2027 or 2028, sending structured e-invoices in the B2B sector will also become mandatory in stages – depending on annual revenue. The XRechnung will be one of the accepted formats alongside ZUGFeRD. More details in our article on the e-invoicing mandate.
XRechnung vs. ZUGFeRD: When to use which format?
The two most important e-invoice formats in Germany are XRechnung and ZUGFeRD. Both meet the requirements of EN 16931 but differ fundamentally in their implementation:
| Feature | XRechnung | ZUGFeRD |
|---|---|---|
| Format | Pure XML | PDF/A-3 with embedded XML |
| Human-readable | No (only with viewer) | Yes (PDF view) |
| Machine-readable | Yes (fully) | Yes (XML portion) |
| B2G mandate | Yes (standard format) | Only in the XRECHNUNG profile |
| B2B use | Possible, but uncommon | Widely used |
| Transmission | Peppol, ZRE, OZG-RE | Email, portal, Peppol |
| Syntax | UBL or CII | CII (UN/CEFACT) |
Recommendation for car dealers
- For government agencies and public clients: XRechnung is mandatory – use this format
- For business customers (B2B): ZUGFeRD is often the better choice, as it is readable for the recipient without specialized software
- For future-proofing: Use an invoicing software that supports both formats
Detailed information on the comparison of both formats can be found in our article ZUGFeRD vs. XRechnung.
Technical structure of the XRechnung
Understanding the technical fundamentals helps you avoid errors in creation and resolve validation issues faster.
UBL vs. CII: Two syntax options
The XRechnung supports two different XML syntaxes, both of which meet the requirements of EN 16931:
| Property | UBL (Universal Business Language) | CII (Cross Industry Invoice) |
|---|---|---|
| Standard | OASIS UBL 2.1 | UN/CEFACT CII D16B |
| Prevalence (DE) | Common with federal agencies | Compatible with ZUGFeRD |
| Root element | <Invoice> | <CrossIndustryInvoice> |
| Peppol support | Yes (standard) | Yes |
| Recommendation | For B2G via Peppol | When ZUGFeRD compatibility is desired |
Practical tip: For most car dealers, the choice of syntax is secondary – your invoicing software makes this decision for you. What matters is that the generated file passes XRechnung validation.
Basic structure of an XRechnung (UBL)
An XRechnung in UBL format is divided into the following main sections:
Header
Invoice number, invoice date, currency, document type code, Leitweg-ID, and the CustomizationID for XRechnung.
Invoice issuer (Supplier)
Name, address, tax number or VAT ID, contact details, and bank details of the car dealership.
Invoice recipient (Customer)
Name, address, and Leitweg-ID of the public client (agency, municipality, etc.).
Payment information
Payment terms, due date, bank details (IBAN, BIC), early payment discount rules.
Invoice line items
Individual items with article description, quantity, unit price, tax information, and line amount.
Totals section
Net amount, tax amount per category, total amount, and amount due.
Mandatory fields of the XRechnung: Complete overview
One of the most common sources of errors when creating an XRechnung is missing or incorrectly formatted mandatory fields. The following list shows the most important fields that must be present in every XRechnung:
General invoice information
- Invoice number (BT-1): Unique, sequential number
- Invoice date (BT-2): In YYYY-MM-DD format
- Invoice type code (BT-3): e.g., 380 for invoice, 381 for credit note
- Currency code (BT-5): Typically EUR
- Buyer reference / Leitweg-ID (BT-10): Mandatory for XRechnung
- CustomizationID: Identification as XRechnung with version number
Invoice issuer details
- Name (BT-27): Company name of the car dealership
- Address (BG-5): Street, postal code, city, country code (DE)
- Tax number or VAT ID (BT-31/BT-32): At least one is required
- Contact person (BG-6): Name, phone, email
Invoice recipient details
- Name (BT-44): Name of the agency/institution
- Address (BG-8): Full address
- Leitweg-ID (BT-10): The central routing information
Line item level
- Line number (BT-126): Unique identifier per line
- Quantity (BT-129) and unit of measure (BT-130)
- Net amount of the line (BT-131)
- Item description (BT-153): e.g., “VW Golf 8 Life 1.5 TSI”
- VAT category (BT-151) and VAT rate (BT-152)
- Unit price (BT-146)
The Leitweg-ID: Key to correct delivery
The Leitweg-ID is a central element of every XRechnung and unique to the German e-invoicing system. It serves as routing information and ensures that the invoice reaches the correct recipient within the public administration.
Structure of the Leitweg-ID
The Leitweg-ID follows a standardized schema and consists of several parts:
Coarse addressing
Identifies the superior organizational unit (e.g., federal government, state, municipality). Example: 04011 for a federal agency.
Fine addressing
Specifies the exact department or office within the organization. Can be alphanumeric.
Check digit
Two-digit check digit to validate the correctness of the entire Leitweg-ID.
A typical format looks like this: 04011-12345-67 (coarse addressing-fine addressing-check digit).
Validation with the KoSIT verification tool
Before submitting an XRechnung, you should always validate it. The KoSIT (Coordination Office for IT Standards) provides an official verification tool for this purpose.
What does the KoSIT verification tool check?
- Schema validation: Does the XML structure conform to the UBL or CII schema?
- Schematron rules: Are all XRechnung-specific business rules observed?
- EN 16931 conformity: Does the invoice meet the European requirements?
- German CIUS rules: Are all XRechnung-specific mandatory fields present?
Validation in practice
You have several options for validation:
- Online validation: Via the XRechnung validator of the KoSIT (portalkosit.de)
- Local validation: With the open-source verification tool from KoSIT (Java-based)
- Integrated validation: Professional e-invoicing software validates automatically before sending
Tip: The most common validation errors in the car trade involve missing contact details of the invoice issuer, incorrect VAT category codes for margin taxation, and a missing or incorrectly formatted Leitweg-ID.
XRechnung in the car trade: Industry-specific considerations
The automotive trade has some specifics that must be particularly observed when creating XRechnung invoices. The correct representation of these specifics is crucial for successful validation and processing.
Margin taxation under Section 25a UStG in the XRechnung
Margin taxation is widespread in the used car trade and presents a particular challenge for the XRechnung. Under margin taxation, the VAT is calculated only on the margin (difference between purchase and selling price) but must not be disclosed on the invoice.
Mapping margin taxation in the XRechnung
The representation in the XRechnung uses specific codes and fields:
| Field | Value for margin taxation | Explanation |
|---|---|---|
| VAT category (BT-151) | O | Code “O” stands for “Not subject to VAT” – since no VAT is disclosed |
| VAT rate (BT-152) | 0 | Tax rate is stated as 0 |
| VAT exemption reason (BT-120) | Note text Section 25a UStG | Mandatory text: “Margin taxation under Section 25a UStG. VAT is not disclosed.” |
| Tax amount (BT-117) | 0.00 | No tax disclosure on the invoice |
Further considerations in the car trade
- Vehicle identification: VIN should be stated in the item description (BT-153) or as an additional item attribute
- Registration data: For new vehicles, intra-community supplies with special tax regulations may apply
- Warranty: Separate line items for warranty extensions with correct VAT treatment
- Trade-in: The value of the traded-in vehicle is represented as a prepayment or deduction
- Workshop services: Combination of labor time and spare parts with different units of measure (hours vs. pieces)
The Peppol network: Transmitting the XRechnung
Peppol (Pan-European Public Procurement Online) is an international network for the secure exchange of electronic business documents, including e-invoices. In Germany, Peppol is increasingly used as a transmission channel for XRechnung invoices.
How does Peppol work?
The Peppol network operates on the four-corner model:
Sender (car dealer)
Creates the XRechnung in their invoicing software and submits it to their Peppol Access Point.
Sender’s Access Point
The sender’s Access Point validates the invoice and forwards it via the secure Peppol network.
Recipient’s Access Point
The recipient’s Access Point receives the invoice and delivers it to the recipient.
Recipient (government agency)
The agency receives the XRechnung and processes it automatically in their ERP system.
Peppol ID for car dealers
To participate in the Peppol network, you need a Peppol Participant ID. This is typically based on your VAT identification number and is set up by your Peppol Access Point provider. Registration usually takes place through your e-invoicing software or service provider.
Note: Not all public clients use Peppol yet. Many federal agencies rely on the ZRE (Central Invoice Receipt Platform), while state agencies sometimes operate their own portals. Check with your client in advance about the preferred transmission channel.
Future of the XRechnung: B2B mandate from 2025–2028
With the Growth Opportunities Act, the German legislature has enacted the phased introduction of the e-invoicing mandate in the B2B sector as well. The XRechnung will play a central role:
Timeline of the B2B e-invoicing mandate
| Date | Obligation | Applies to |
|---|---|---|
| From 01/01/2025 | Receipt obligation | All companies must be able to receive e-invoices |
| From 01/01/2027 | Sending obligation | Companies with > 800,000 EUR annual revenue |
| From 01/01/2028 | Sending obligation | All companies without exception |
What does this mean for the car trade?
For automotive dealers, the B2B mandate means that in the future all invoices to commercial customers – including other car dealerships, leasing companies, fleet operators, and workshop clients – must be sent as structured e-invoices. The XRechnung and ZUGFeRD are the two accepted formats.
Creating an XRechnung: Step-by-step guide
Here is how to proceed as a car dealer to create and submit a correct XRechnung:
Obtain the Leitweg-ID
Request the Leitweg-ID from your public client. This information is mandatory and is often communicated with the purchase order.
Verify master data
Ensure that your company data (name, address, VAT ID, bank details, contact information) is complete and correct in your software.
Create the invoice
Enter all invoice line items with correct item description, quantity, price, and VAT category. For used cars: set margin taxation correctly.
Generate the XRechnung
Export the invoice in XRechnung format (XML). Professional software handles the mapping automatically.
Perform validation
Check the generated XML file with the KoSIT verification tool or your software’s integrated validation function.
Transmission
Send the validated XRechnung via the prescribed channel (ZRE, OZG-RE, Peppol, or state portal) to the recipient.
Archiving
Archive the XRechnung in a GoBD-compliant manner – audit-proof, immutable, and accessible for at least 10 years.
XRechnung with AutoPult: Simple and automated
AutoPult supports you as a car dealer in the fully automated creation and transmission of XRechnung invoices. Our industry-specific e-invoicing software was developed specifically for the requirements of the car trade.
AutoPult XRechnung features at a glance
- Automatic XRechnung creation: Generate compliant XRechnung invoices directly from your invoicing process – without manual XML editing
- Margin taxation integrated: Correct representation of Section 25a UStG rules with automatic VAT category mapping
- Integrated validation: Every XRechnung is automatically checked against the current KoSIT rules before sending
- Peppol connectivity: Direct sending via the Peppol network to public clients
- ZRE/OZG-RE integration: Seamless connection to the federal government’s invoice receipt platforms
- Leitweg-ID management: Central maintenance and assignment of Leitweg-IDs for your public customers
- GoBD-compliant archiving: Automatic audit-proof storage of all e-invoices
- Dual format support: XRechnung and ZUGFeRD from one system – the right format for each recipient
Learn more about our e-invoicing solution or try AutoPult directly with your own invoice data.
Frequently Asked Questions (FAQ)
What is the difference between an XRechnung and a regular PDF invoice?
A PDF invoice is a visual document that can be read by humans but cannot be processed automatically. The XRechnung, on the other hand, is a purely machine-readable XML file that can be processed by IT systems without human intervention. It contains all invoice data in structured form according to the EN 16931 standard.
Do I need the XRechnung as a car dealer if I only sell to private customers?
If you sell exclusively to private customers (B2C), you currently do not need the XRechnung. The B2B e-invoicing mandate from 2025/2027 only applies to transactions between businesses. However, as soon as you supply commercial customers or public institutions, the e-invoice becomes relevant.
How do I obtain the Leitweg-ID of my public client?
The Leitweg-ID is typically communicated to you by the public client – usually as part of the purchase order or contract conclusion. You can also ask the procurement office or the accounting department of the agency directly. Some federal states publish directories of Leitweg-IDs online.
Can I represent margin taxation in an XRechnung?
Yes, margin taxation under Section 25a UStG can be represented in the XRechnung. The VAT category “O” (Not subject to VAT) is used, the tax rate is set to 0, and a corresponding note text is entered in field BT-120. Industry-specific software like AutoPult handles this mapping automatically.
Which format should I use – XRechnung or ZUGFeRD?
For invoices to public clients (federal, state, municipal government), XRechnung is the standard format and mandatory in most cases. For B2B invoices to other companies, ZUGFeRD is often the better choice since it also includes a human-readable PDF representation. Ideally, use software that supports both formats.
How long must XRechnung invoices be archived?
XRechnung invoices are subject to the same retention obligations as conventional invoices: 10 years pursuant to Section 14b UStG and Section 257 HGB. Archiving must be GoBD-compliant – audit-proof, immutable, and readable at any time. The XRechnung must be retained in its original format (XML).