Guide

XRechnung for Shopify: When and How to Issue It

Updated 2026-06-13

If you sell to German government bodies or to German businesses through your Shopify store, sooner or later you will hear the word XRechnung. It sounds like a single file format, but it is really a specific German interpretation of the European e-invoicing standard, with its own rules and its own mandatory data fields. This guide explains what XRechnung actually is, when you need it (and when ZUGFeRD is the better choice), what the Leitweg-ID is for, and how a Shopify store can produce a valid XRechnung from order data. Faktwise is invoicing software, not a tax adviser, so treat this as practical orientation rather than legal advice for your specific situation.

What XRechnung is

XRechnung is a pure XML invoice format: structured data only, with no visual layer. There is no PDF page, no logo, no human layout. The whole invoice is a machine-readable file that accounting and procurement systems read directly. A person can open it, but it looks like code, not like a printed invoice.

Technically, XRechnung is a CIUS (Core Invoice Usage Specification) of the European standard EN 16931. EN 16931 defines the semantic model of an invoice, the data fields and their meaning, and XRechnung narrows that standard for German use by adding national rules. It is maintained by KoSIT, Germany’s coordination office for IT standards. The format can be expressed in two XML syntaxes, UBL 2.1 or UN/CEFACT CII, and both are equally valid.

XRechnung is the established standard for invoicing German public-sector customers (B2G). Federal and most state authorities accept and often require it, and their invoice portals validate every incoming file against the official KoSIT validator, rejecting anything that does not conform.

The Leitweg-ID: routing for public buyers

The detail that trips up most merchants new to B2G invoicing is the Leitweg-ID. A German public authority is rarely a single inbox. It is a network of departments, agencies and budget offices, and the Leitweg-ID is the routing identifier that tells the receiving portal which internal office an invoice belongs to.

A few things to know about it:

Because XRechnung is a German CIUS, it also enforces other national rules that go beyond plain EN 16931: the seller’s contact details must be present, payment instructions are required, the buyer’s electronic address is needed, and the document type is restricted to a defined set of codes. Software that targets XRechnung has to satisfy all of these, not just produce generic EN 16931 XML.

XRechnung vs ZUGFeRD: which one, when

XRechnung is not the only German e-invoice format, and for many Shopify merchants it is not the everyday one. The other format you will meet is ZUGFeRD (whose French twin, sold under the name Factur-X, is the same specification).

The practical difference comes down to whether a human needs to read the invoice as a normal document:

A simple rule of thumb:

Both formats are EN 16931 conformant, so a tool that maps your order data correctly can produce either one from the same underlying invoice. For background on the wider German rules and deadlines, see our Shopify e-invoicing in Germany guide.

When a Shopify merchant actually needs XRechnung

Most Shopify stores do not sell to government departments, so for them XRechnung is occasional rather than routine. You typically need it when:

If you only sell to consumers, you do not need XRechnung at all. If you sell B2B but no buyer has requested XRechnung specifically, ZUGFeRD / Factur-X in the EN 16931 profile generally serves you better. It is worth understanding XRechnung anyway, because the moment a public buyer or a procurement-heavy customer appears, a plain PDF will be turned away.

How to generate XRechnung from Shopify

Shopify does not produce XRechnung. Its order confirmations are not invoices: they have no sequential invoice number, no seller tax identifiers, no exemption wordings, and certainly no EN 16931 XML or Leitweg-ID handling. So generating a valid XRechnung means an external invoicing system or a Shopify app that builds the file from order data.

A workable setup needs to do four things:

  1. Capture the Leitweg-ID. Because it is mandatory for B2G and only the buyer can supply it, the cleanest approach is to capture it at checkout (alongside the B2B VAT ID for business customers) rather than chasing it by email after the order.
  2. Map order data to the EN 16931 model. Line items, net amounts, the correct VAT treatment and any exemption wording, seller contact and payment details all have to land in the right structured fields, with the German CIUS rules satisfied.
  3. Get the VAT and rounding right. XRechnung validators are strict about VAT category handling and per-group rounding, so the underlying VAT logic has to be correct before the XML is even built.
  4. Validate before sending. Every file should pass the official KoSIT validator with the current XRechnung configuration. A file that fails validation will be rejected by the receiving portal, and your payment waits.

You can check an XRechnung file you already have using our free Rechnung validator before you send it, which is a quick way to catch a missing Leitweg-ID or a broken VAT field. If reverse-charge or intra-EU rules also apply to your sales, the wording matters as much as the format; see our note on reverse charge for intra-EU sales on Shopify.

FAQ

Is XRechnung the same as an EN 16931 e-invoice?

XRechnung is a German CIUS of EN 16931, so it is a specific, stricter flavour of the European standard with extra national rules. Every XRechnung is EN 16931 conformant, but not every EN 16931 invoice is a valid XRechnung.

Do I always need a Leitweg-ID for XRechnung?

It is mandatory for German public-sector (B2G) invoices, carried in the buyer reference field (BT-10), and the buyer must provide it. A normal B2B business customer does not have a Leitweg-ID.

XRechnung or ZUGFeRD for a business customer?

For most B2B customers, ZUGFeRD / Factur-X in the EN 16931 profile is the friendlier default because it includes a readable PDF. Use XRechnung when a public authority requires it, or when a B2B customer specifically asks for it.

Can Shopify generate XRechnung on its own?

No. Shopify order confirmations are not invoices and contain none of the required structured data, tax identifiers or Leitweg-ID handling. You need an external system or a Shopify app that builds the file from order data.

How do I know my XRechnung is valid?

Validate it against the official KoSIT validator with the current XRechnung configuration before sending. Public portals run the same check and reject files that do not conform.


If you would rather not assemble this yourself, Faktwise is a Shopify app that generates XRechnung (pure EN 16931 XML) and ZUGFeRD 2.x / Factur-X automatically from your paid Shopify orders, with B2B VAT-ID and Leitweg-ID capture at checkout. Every file is validated against the official KoSIT validator, and invoices are kept in a GoBD-compliant archive. It is EU-hosted in Paris, free for up to 5 invoices a month, then a flat founding price of €19/month. You can see the details on the pricing page. Faktwise handles the format; your tax adviser still owns the tax decisions.