Reliable E-Invoicing: Germany’s XRechnung & ZUGFeRD

The Road to Digital Invoicing – EU Directives and German Mandates

Starting January 1, 2025, a significant change has impacted German businesses: the mandatory capability to receive B2B electronic invoices (e-invoices) comes into effect under the Growth Opportunities Act (Wachstumschancengesetz). This marks a crucial step towards fully digitized invoicing, with mandatory issuance requirements set to follow in subsequent phases (2026-2028). This transition builds upon EU Directive 2014/55/EU, which aimed to standardize electronic invoicing for public authorities to improve cross-border interoperability.

German legislation defines an „e-invoice“ specifically as one issued, transmitted, and received in a structured electronic format that enables automated processing. This definition is key: standard PDFs or image files do not meet this requirement. The format must comply with the European standard EN 16931 (defining the semantic data model) and its list of allowed syntaxes. In Germany, this primarily means using formats like XRechnung or ZUGFeRD (version 2.0.1 or later), although other EN 16931-compliant formats like France’s Factur-X are also acceptable. This post aims to clarify these requirements, introduce the key formats, and explore why the reliability of e-invoice processing software is critical for compliance with the German e-invoicing mandate.

A timeline graphic illustrating key dates in the evolution of e-invoicing (XRechnung & ZUGFeRD) in Germany, including the 2014 EU Directive, the 2020 B2G mandate, the 2025 B2B receiving mandate, and the phased issuing obligations from 2026 to 2028.
Timeline of E-Invoicing Milestones in Germany (2014-2028)

Understanding the Stakes: Why Compliance Matters Immediately

E-invoicing mandates modernize business processes and help prevent VAT fraud, but they also present significant business risks if not adhered to:

  • Potential Sanctions: Starting 2025, failure to meet requirements could eventually lead to penalties or, in the public sector context, exclusion from tenders—although the mandate is phased in.
  • Invalidity for VAT Deduction: A more immediate concern is that invoices failing to meet the strict e-invoice definition might be deemed invalid for the recipient’s input tax deduction. If a supplier issues an incorrect format (e.g., a simple PDF instead of a required structured e-invoice), the customer may lose the right to reclaim VAT on that transaction until a compliant e-invoice is correctly issued and received.
  • Operational Friction: Non-compliant invoices are likely to be rejected by automated receiving systems, causing payment delays, increasing administrative burden, and potentially straining supplier-customer relationships.

These factors highlight the importance of adopting robust and compliant e-invoicing solutions fast.

Key Players in the E‑Invoicing Software Landscape

The transition to e-invoicing has fueled the development of a diverse software ecosystem. Large ERP providers (SAP, Oracle, etc.) are incorporating compliance features, while numerous specialized vendors and SaaS platforms offer dedicated solutions. On the public side, Germany provides platforms like the ZRE (Zentraler Rechnungseingangsplattform) for federal invoices, using a routing ID system (Leitweg-ID) to direct invoices to the correct public entity, with many states operating similar portals.

Equally important are open-source tools, which help businesses (especially SMEs) and developers implement e-invoicing. A prominent example is the Mustang Project, a Java library for reading, writing, and validating ZUGFeRD (and by extension, the French Factur-X) and XRechnung formats. While invaluable for accelerating adoption by providing transparent implementations, these community-driven projects implement complex standards (EN 16931, specific XRechnung/ZUGFeRD rules and profiles). Ensuring their implementations are fully correct and robust against all valid inputs is a significant technical challenge—a point we will revisit.

Other open-source initiatives like Konik or OpenXRechnungToolbox, alongside various government-provided validation tools, also contribute to the landscape. All tools, commercial or open-source, must be rigorously maintained and tested against evolving standards (like new XRechnung schema versions or ZUGFeRD profiles) to prevent errors that could lead to invoice rejection or downstream processing failures. The stakes are indeed high: an error in an e-invoicing module could mean thousands of invoices failing validation or transmission.

XRechnung vs. ZUGFeRD: Comparing E-Invoicing Formats in Germany

Germany essentially recognizes two main e-invoice formats with equal legal standing: XRechnung and ZUGFeRD. Both fulfill EN 16931 semantic requirements, but they differ in structure and usage.

  • XRechnung: This is a pure XML format defined by KoSIT (Coordination Office for IT Standards) specifically for Germany’s needs. It’s an implementation of the European core invoice model with some national extensions (31 business rule extensions as of version 3.0) to cover country-specific details. XRechnung is mandatory for B2G (business-to-government) invoicing in Germany: since late 2020, all federal authorities must accept XRechnung, and vendors must use it when billing the federal administration. In fact, many states (Länder) and municipalities also require XRechnung for their invoices. XRechnung is XML-only. It is designed for full automation: a file that can be parsed and validated by machines with no manual steps. This ensures efficiency and reduces errors, but it means that a human-friendly rendering is not part of the format. Companies using XRechnung often rely on software to display or convert the XML into a readable form for human inspection.
  • ZUGFeRD (“Zentraler User Guide des Forums elektronische Rechnung Deutschland”): Developed by the Forum elektronische Rechnung Deutschland (FeRD) with government support, ZUGFeRD takes a different approach. It is a hybrid format, embedding structured XML data inside a PDF/A-3 file. In practical terms, a ZUGFeRD invoice is a PDF document (which humans can open and read easily) that carries machine-readable XML in its attachments. This allows a single file to serve both manual and automated workflows. ZUGFeRD is popular in the B2B sector because it provides continuity – businesses can switch to e-invoicing without abandoning the familiar PDF invoice. A small supplier, for instance, might still print or visually review the PDF, while a larger buyer can directly process the XML. ZUGFeRD is not strictly mandated by law, but version 2.x (which aligns with EN 16931) is fully accepted for B2G invoicing as well, provided it uses the “XRechnung profile” (meaning the XML conforms to the same core standards as XRechnung). In fact, an invoice in ZUGFeRD 2.2 “XRechnung profile” is equivalent to an XRechnung in the eyes of German authorities. The key difference is the presence of the PDF wrapper.

Format comparison: Both XRechnung and ZUGFeRD aim to ensure all required invoice data (buyer, seller, tax details, line items, totals, etc.) are present and standardized for automation. However, their approaches differ:

FeatureXRechnungZUGFeRD
Data formatXML only (machine-readable only)PDF/A-3 with embedded XML (hybrid)
Primary use caseMandatory for B2G and since January in B2BVoluntary; used in B2B and B2G
Human readabilityRequires software to view (no PDF)PDF component for human readability
Automation focusFull automation (structured data only)Gradual adoption (allows manual steps)
ComplianceStrictly adheres to the EU norm and German e-invoicing regulation (E-RechV)Complies with EU norm; profiles for compliance (e.g., XRechnung profile)
ExtensionsNational extensions for specific needsProfiles (Basic, EN16931, Extended etc.) for different detail levels
Table: Key Differences Between XRechnung and ZUGFeRD E-Invoice Formats in Germany.

In summary, XRechnung is about meeting mandated invoice requirements with a pure XML approach. ZUGFeRD, on the other hand, offers a hybrid format and flexibility for broader use while still maintaining compliance. Germany has ensured that organizations already using ZUGFeRD do not need to switch to XRechnung for public contracts as long as they stick to the appropriate profile. This provides flexibility for businesses. However, this dual-format landscape means e-invoicing software must be capable of reliably handling the specific rules and structures of each format it claims to support.

Hidden Dangers: The Critical Need for Reliable E-Invoicing Software

As organizations implement or update systems for e-invoicing, the reliability and accuracy of the underlying software become absolutely critical. Even seemingly minor flaws can lead to significant issues:

  • Compliance Failures & Rejections: E-invoices must strictly adhere to complex technical specifications (like XML schemas) and business rules (often defined using Schematron). Minor deviations can cause automatic rejection by government portals or customer systems, delaying payments and requiring manual intervention. For example, if a supplier sends an invalid invoice to an actor from the public sector, they won’t be paid until a correct invoice is provided. The public sector actor is not allowed to pay invalid invoices by law!
  • Financial Discrepancies: Bugs affecting calculations, such as tax amounts, totals, or rounding, can introduce errors into financial records, potentially leading to incorrect VAT declarations. In the worst case, such errors could trigger audits or fines if not caught in time.
  • Legal and Tax Implications: As noted, issuing a non-compliant e-invoice can invalidate it for the recipient’s VAT deduction. Relying on software that might silently produce incorrect output introduces considerable compliance risk for both sender and receiver. German tax authorities have indicated that failure to comply with e-invoicing obligations can result in penalties and loss of certain legal protections​.

Ensuring this level of reliability is non-trivial. The inherent complexity of standards like EN 16931 and its national implementations (XRechnung, ZUGFeRD profiles) involves hundreds of data fields, intricate conditional logic, and specific code lists. Thoroughly testing software against this complexity is challenging.

Furthermore, obtaining suitable test data presents a major obstacle. Using copies of real production invoices raises serious privacy concerns (GDPR) and violates business confidentiality. Manual anonymization is time-consuming and often strips out the very edge cases, complex scenarios, and variations (e.g., numerous line items, diverse tax combinations, international characters like ä, ç, ø, boundary values) that are essential for identifying potential weaknesses in software.

Addressing this critical need for comprehensive, realistic, yet privacy-compliant test data is precisely where InputLab’s expertise lies. Originating from years of research at the CISPA Helmholtz Center for Information Security, recognized as a world-leading institution, InputLab provides schema-driven synthetic test data generated specifically for complex structured formats, including the XML basis of XRechnung and ZUGFeRD’s embedded data.

InputLab technology allows for the creation of vast datasets that are structurally valid according to the standards while covering not just common cases, but also the critical edge cases and boundary conditions often missed in testing. Because this data is entirely artificial, it inherently upholds privacy (GDPR compliant) and avoids the risks associated with using sensitive production data. This enables rigorous validation of how software handles the full spectrum of possible, valid inputs.

InputLab CEO Dominic Steinhöfel summarizes the objective:

Do you want to be certain that your system survives unexpected inputs?
That your test data preserves privacy and complies with other regulations?
And that you can control your test data-related costs?
InputLab gives you that certainty.

Dominic Steinhöfel, CEO of InputLab

InputLab’s approach is focused on preventing errors before they impact production systems. In the next part of this series, we will demonstrate this principle in action. We will share specific examples of previously undiscovered bugs we identified within the widely used open-source Mustang Project e-invoicing library, uncovered through rigorous testing with synthetic data. Stay tuned!

1 Kommentar zu „Reliable E-Invoicing: Germany’s XRechnung & ZUGFeRD“

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen