Following system theme

By Causa Prima · Last updated 2026-06-01

#What Is XRechnung?

XRechnung is Germany's standard for structured electronic invoices — a national interpretation (CIUS) of the European standard EN 16931, published by KoSIT, that is mandatory for invoices sent to German public-sector buyers (B2G). Unlike a PDF, an XRechnung carries no visual layout: the invoice is a structured XML file that accounting and procurement systems can read automatically.

This page explains the XRechnung standard factually. It is not tax or legal advice — confirm your own obligations with a qualified advisor.

#What XRechnung is, in one paragraph

XRechnung defines exactly how the data elements of an invoice — seller, buyer, line items, tax breakdown, payment details — must be expressed in XML so that any German authority's system can process them automatically. It is maintained by KoSIT (the Coordination Office for IT Standards) and is the format the German public sector standardised on to implement the EU e-invoicing directive. Because it is structured data rather than a picture of an invoice, an XRechnung is machine-readable end to end: no one re-types anything from a PDF.

#Is XRechnung an EN 16931 format?

Yes. XRechnung is a CIUS — a Core Invoice Usage Specification — of EN 16931, the European semantic standard for the core elements of an electronic invoice. In plain terms: EN 16931 defines the shared European data model, and XRechnung is the German "dialect" that pins down national specifics (such as the mandatory buyer reference for public authorities) without breaking European compatibility. The German rules sit on top of the European core; they don't replace it. (See What is EN 16931? for the standard underneath.)

#XRechnung UBL vs XRechnung CII

XRechnung can be expressed in either of the two XML syntaxes that EN 16931 permits. The data is identical; only the encoding differs.

XRechnung UBL XRechnung CII
Syntax OASIS Universal Business Language UN/CEFACT Cross Industry Invoice
Also used by Peppol BIS Billing 3.0 ZUGFeRD (embedded XML)
Ecosystem fit Broadest; aligns with Peppol routing Common in DACH B2B
EN 16931-conformant Yes Yes

Neither is "more compliant" — both validate against the same EN 16931 rules. The practical choice is which ecosystem the invoice travels in: UBL if it will go over Peppol, CII if you want the same syntax that lives inside a ZUGFeRD file.

#When is XRechnung required?

The broader German B2B e-invoicing mandate is a separate, larger topic — see Germany's B2B e-invoicing mandate for the timeline and which formats satisfy it.

#What is the Leitweg-ID and the buyer reference (BT-10)?

When invoicing a German public authority, the invoice must identify which authority it is for. That identifier is the Leitweg-ID, carried in the EN 16931 buyer reference field (BT-10).

The Leitweg-ID has a defined structure (a coarse routing portion, an optional fine-routing portion, and check digits) and is issued to the public buyer — you obtain it from the authority you are invoicing.

#How do you create a valid XRechnung invoice?

There are three common routes: from accounting/ERP software that supports XRechnung export; from a dedicated e-invoicing tool; or programmatically — via an API, CLI, or an AI assistant. Because XRechnung is just structured data, it lends itself to automated generation.

This last route is where Scribo fits. Scribo generates XRechnung in both syntaxes — xrechnung_ubl (the default, for broadest Peppol compatibility) and xrechnung_cii — from a plain description of the invoice, free and with no signup form. You can use it through the web app, the HTTP API, the hosted MCP server (Claude Desktop, Cursor, ChatGPT, Codex), the npm CLI, or the Claude/Codex skill. XRechnung also requires payment details (an IBAN) on the invoice — Scribo enforces this so the output passes validation.

#How is an XRechnung validated?

An XRechnung is checked against the EN 16931 business rules plus the national XRechnung rules, expressed as machine-readable schematron tests. If a required field is missing or values are inconsistent (for example, tax totals that don't add up), validation fails and the file is not compliant.

Scribo runs this check at generate time: every invoice is validated by Invopop's hosted EN 16931 validator before the XML is returned, so output that would fail the rule set never reaches you. See the compliance page for the full posture and the exact standard versions in use.

#XRechnung vs ZUGFeRD

Both are German EN 16931-compliant formats, built for different situations:

XRechnung ZUGFeRD
Type Pure XML Hybrid: XML embedded in a PDF
Human-readable alone No (needs a viewer) Yes (a normal-looking PDF)
Primary use B2G (public sector) B2B
Leitweg-ID / BT-10 Required for B2G Not used

For a full side-by-side and a "which one do I need" guide, see ZUGFeRD vs XRechnung.

#Frequently asked questions

Is XRechnung mandatory for B2B invoices? XRechnung is mandatory for invoices to German federal public authorities (B2G). For business-to-business invoices it is not required, but it is a valid EN 16931 format — most German B2B senders use ZUGFeRD instead because it includes a human-readable PDF.

Can XRechnung be sent over the Peppol network? Yes. XRechnung in the UBL syntax maps to Peppol BIS Billing 3.0, so it can be exchanged over the Peppol network through a certified access point. The CII syntax is also EN 16931-conformant but is less commonly routed over Peppol.

What is the difference between XRechnung UBL and XRechnung CII? Both are XRechnung; they differ only in the underlying XML syntax. UBL is the more widely tooled option and aligns with Peppol; CII is the same syntax used inside ZUGFeRD. Both carry the identical EN 16931 data and are equally valid.

How do I read an XRechnung XML file as a normal invoice? An XRechnung is pure XML with no built-in visual layout. To view it as a readable document you use a visualiser — for example the KoSIT/XRechnung viewer or the visualisation built into accounting software. This is the main practical difference from ZUGFeRD, which embeds a readable PDF.

Is XRechnung the same as ZUGFeRD? No. Both are German EN 16931-compliant formats, but XRechnung is pure structured XML used mainly for public-sector (B2G) invoicing, while ZUGFeRD is a hybrid PDF that carries the XML inside a human-readable document, used mainly for B2B.


Sources: EU Directive 2014/55/EU; KoSIT — XRechnung standard; E-Rechnung-Bund — buyer reference / Leitweg-ID FAQ.