What is an XRechnung?
An XRechnung is a structured electronic invoice in XML format that can be machine-read, enabling the automatic processing of billing data such as recipient details, invoice numbers, amounts, tax rates, and payment information.

E-Invoices, XML & Public Authorities
What the XML format according to EN 16931 entails, when public authorities require an XRechnung, and what companies need to consider in the B2B sector.
Photo by Markus Winkler ©
The XRechnung is an electronic invoice in a structured XML format. Unlike a regular PDF, it is primarily intended for machine processing rather than human readability. This allows invoice data such as sender and recipient information, invoice number, amounts, tax rates, payment details, and service descriptions to be automatically extracted and further processed.
For freelancers and small businesses, XRechnung becomes relevant when they need to send invoices to public authorities or prepare their invoicing processes for the e-invoice obligation. It's important to note that an XRechnung is not just a PDF with another name; key invoice details must be included in the structured XML part to enable electronic verification, processing, and archiving. Motorica helps by structuring invoice data, preparing e-invoices, and avoiding common invoicing errors.
The example file was generated directly with the Motorica XRechnung generator and uses XRechnung 3.0 in CII format.
The XRechnung is the German implementation of the European standard EN 16931 for electronic invoices. The version currently discussed in this article is XRechnung 3.0.2. Invoice data are provided in a structured XML format and can be processed automatically. This format is particularly relevant for invoices to public authorities; in the B2B sector, XRechnung represents one possible but not the only EN 16931-compliant variant.
A simple PDF may look like an invoice but does not contain structured invoicing data as required for electronic invoices. An XRechnung consists of XML data and is difficult to read without a viewer. ZUGFeRD combines both worlds: a human-readable PDF presentation and embedded structured data for systems. The XRechnung clearly prioritizes machine processing.
An XRechnung is particularly important when you issue invoices to public authorities, which can include federal agencies, state agencies, municipalities or other public bodies. In regular B2B transactions between companies, the XRechnung is not the only possible format. Other structured formats such as ZUGFeRD or agreed-upon formats may be acceptable if they meet legal requirements. The key is that the invoice must be electronically processable and contain all necessary information in a fully structured form.
An XRechnung must contain the necessary invoice data for tax and professional purposes in a structured format. It is not sufficient to hide important details in attachments or free text sections. The most critical mandatory fields must be included in the machine-readable part of the document so that the invoice can be automatically checked and processed. This includes, among other things, information about the issuer, recipient, invoice number, date, service provided, amounts, VAT, and payment details.
The Leitweg-ID is used to uniquely route an e-invoice within the public administration to the correct invoice recipient. It is particularly relevant in the B2G sector, i.e., when invoicing authorities and public clients. In the normal B2B sector between companies, a Leitweg-ID is generally not required. If you are billing a public entity, you should clarify the Leitweg-ID and the required transmission route before issuing an invoice.
An XRechnung should be validated before sending it out. Validation means checking the invoice against the applicable rules both technically and substantively. This involves more than just ensuring that the XML file is readable from a technical standpoint. It also includes verifying mandatory fields, amounts, tax totals, recipient information, routing ID, electronic addresses, and formal requirements. A valid XRechnung reduces the risk of it being rejected by the recipient or a platform.
An XRechnung usually arrives as an XML file, which is difficult to read without assistance for humans. Therefore, you need a viewer or software that presents the XML data in a comprehensible way. Important: The structured XML file remains the crucial component of the invoice and should not be replaced by a screenshot, printout, or manually created PDF.
For an XRechnung, the structured part must be stored in such a way that it remains accessible, readable, and unaltered throughout the retention period. In principle, incoming and outgoing invoices should be retained for eight years for VAT purposes. A printed PDF or pure image representation is insufficient if this results in the loss of the original XML file. Therefore, storage should be organized so that the invoice, XML file, auditor's report, and other documents can be retrieved later.
Many issues with XRechnung do not stem from the XML format itself but rather from incomplete or contradictory invoice data. If required fields are missing, amounts don't add up, the Leitweg-ID is incorrect, or the recipient is not clearly addressed, the invoice may be rejected. It's particularly critical to mistakenly label a PDF invoice as an E-invoice or fail to properly store the XML file after sending.
Before sending, you should briefly check each XRechnung. The checklist does not need to be complex but should be consistent. Do customer data, recipient information, amounts, tax logic, service period, and payment details match? Is a Leitweg-ID required? Is the invoice technically valid? This verification is especially important for public clients because faulty invoices are often not easily corrected manually but may be rejected by the system.
Motorica captures invoice data in a structured manner and supports the output as well as technical validation of XRechnung. Before sending, additional recipient requirements, professional mandatory information, and the required transmission path should be checked. Motorica creates ZUGFeRD invoices directly from the maintained invoice data.
FAQ
An XRechnung is a structured electronic invoice in XML format that can be machine-read, enabling the automatic processing of billing data such as recipient details, invoice numbers, amounts, tax rates, and payment information.
No. A simple PDF file is not an XRechnung. An XRechnung consists of structured XML data. While a PDF can resemble an invoice, it does not meet the requirements for an electronic invoice without such structured data.
XRechnung is a pure XML invoice format, whereas ZUGFeRD combines a readable PDF document with embedded structured billing data. Both formats can be relevant for electronic invoices if they meet legal requirements.
A Leitweg-ID is primarily required when invoicing public authorities to ensure that the electronic invoice reaches the correct recipient within the administration. In general B2B transactions between companies, a Leitweg-ID is not typically needed.
Since January 1, 2025, domestic companies must generally be capable of receiving E-invoices. According to the Federal Ministry of Finance (BMF), an email inbox may already suffice for receipt. However, proper organization is still advisable for processing and archiving.
No, the XRechnung is not the only permissible E-invoice format. Transitional regulations and exceptions apply. In B2B transactions, other structured formats like ZUGFeRD may also be acceptable if they meet the requirements.
An XRechnung is an XML file and difficult to read without assistance for humans. You need a viewer or software that presents the XML data in a comprehensible format. The original XML file should still be retained.
Validation ensures that the XRechnung meets the required technical and content standards, helping to identify missing mandatory fields, incorrect amounts, invalid recipient information, or formatting errors before sending the invoice.
The structured XML file should be kept in its original form. A pure PDF representation or a printout does not replace the XRechnung. It is important that the invoice remains accessible, readable, and traceable during the retention period.
Yes, Motorica supports structured invoice processing and the output and technical validation of XRechnung. However, recipient-specific requirements, tax-related questions, and the transmission route should still be reviewed before sending. Motorica creates ZUGFeRD invoices directly from maintained invoice data.