Use Motorica for €59 per month for twelve months instead of €100 per month.Offer valid until 31 August 2026Claim this offer
The XRechnung is a structured electronic invoice format based on XML. It makes invoice data machine-readable and is particularly important for invoices sent to public authorities but also for businesses looking to streamline their invoicing processes to comply with e-invoice requirements.

E-Invoices, XML & Public Authorities

XRechnung: Format, Mandatory Information, and Use in B2G and B2B

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.

Sample XRechnung File from Motorica

The example file was generated directly with the Motorica XRechnung generator and uses XRechnung 3.0 in CII format.

What is an XRechnung?

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.

  • XRechnung is a structured electronic invoice format
  • The data are in XML format
  • The standard adheres to EN 16931
  • This article covers XRechnung version 3.0.2
  • XRechnung is particularly relevant for public authorities receiving electronic invoices
  • In the B2B sector, other conformant formats are also possible
  • A regular PDF is not an XRechnung
  • For review, a viewer is usually required

XRechnung, PDF and ZUGFeRD: The Differences

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.

  • PDF: Easily readable by humans, but not an electronic invoice without structured invoicing data
  • XRechnung: XML-based, machine-readable and designed for automated processing
  • ZUGFeRD: PDF with embedded structured invoicing data
  • An XRechnung often requires a viewer for readable display
  • For hybrid electronic invoices, the structured data is crucial
  • Public authorities frequently require an XRechnung or another EN 16931-compliant format

When do I need an XRechnung?

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.

  • Check invoices for public authorities
  • Ask the public authority for the invoice ID if necessary
  • Adhere to the guidelines of the respective invoice receiving platform
  • In B2B transactions, agree on the format with your business partner
  • Do not confuse a PDF invoice with an electronic invoice
  • Check transitional rules and exceptions on a case-by-case basis
  • Consult your tax advisor or client if you are unsure

What information belongs in an XRechnung?

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.

  • Name and address of the issuer
  • Name and address of the recipient
  • Tax number or VAT identification number, if required
  • Invoice number
  • Date of invoice
  • Service date or service period
  • Service Description
  • Net, tax, and gross amounts
  • Tax rate or tax exemption notice
  • Payment terms and bank details
  • For authorities often the Leitweg-ID or additional recipient information

Leitweg-ID: Important for public clients

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.

  • Ask the public client for the Leitweg-ID
  • Enter the Leitweg-ID correctly in the XRechnung
  • Do not confuse the invoice recipient with a contact person
  • Adhere to platform requirements such as OZG-RE
  • Incorrect or missing Leitweg-ID can lead to rejection
  • In the B2B sector, a Leitweg-ID is usually not required
  • Ask the client for clarification if unsure before sending

Create and Validate XRechnung

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.

  • Completely capture invoice data
  • Generate XML file in correct format
  • Check mandatory fields
  • Verify amounts and tax totals
  • Check routing ID and recipient information
  • Validate XRechnung before sending
  • Do not ignore error messages, but correct them professionally
  • Consider the version and requirements of the recipient's platform

Receive and Make XRechnung Readable

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.

  • Do not delete or save the XML file only as a PDF
  • Display XRechnung with viewer or suitable software
  • Check structured invoice data
  • Verify sender, amount, VAT and payment details
  • Store incoming invoices in their original format
  • In case of discrepancies between the display and XML, prioritize structured data
  • Integrate incoming e-invoices into the accounting process

Retention and GoBD: Do not lose the XML file

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.

  • Store the original XML file
  • Maintain invoice data accessible during the retention period
  • Do not confuse viewer display with the original invoice
  • Document changes and corrections traceably
  • Organize incoming and outgoing invoices systematically
  • Store audit protocols or validation results meaningfully
  • Ensure data is retrievable for tax advisory and operational audits

Common Errors with XRechnung

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.

  • Labeling a PDF as an XRechnung
  • Failing to validate the XML file
  • Incomplete entry of required information
  • Forgetting or entering the Leitweg-ID incorrectly
  • Using an incorrect invoice recipient
  • Net, VAT, and gross amounts do not match
  • Service date or service description missing
  • Bank details or payment terms unclear
  • Archiving the XML file only as a PDF afterward
  • Ignoring error messages from the platform

Checklist Before Sending an XRechnung

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.

  • Is the correct invoice recipient registered?
  • Is the lead path ID available at the authorities?
  • Are the invoice number and invoice date correct?
  • Is the performance period specified?
  • Is the service description clear?
  • Do net amount, VAT, and gross total match?
  • Are payment terms and bank details correct?
  • Has the XRechnung been validated?
  • Has the XML file been properly archived?
  • Was the invoice sent via the correct transmission path?

How Motorica Supports XRechnung

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.

  • Capture invoice data in a structured manner
  • Reuse customer and service data
  • Generate XRechnung
  • Technically validate XRechnung
  • Check mandatory information and amounts before sending
  • Clarify recipient requirements and transmission path separately
  • Organize XML files for storage

FAQ

Frequently Asked Questions about XRechnung

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.

Is a PDF invoice an XRechnung?

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.

What is the difference between XRechnung and ZUGFeRD?

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.

When do I need a Leitweg-ID?

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.

Do I need to be able to receive XRechnung as a self-employed individual?

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.

Do all invoices need to be issued as XRechnung starting in 2025?

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.

How can I read an XRechnung?

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.

Why should an XRechnung be validated?

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.

How should an XRechnung be stored?

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.

Does Motorica support XRechnung?

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.