XRechnung in WooCommerce: A Complete Guide to Germany's B2G Format
Selling to German federal or state agencies from WooCommerce? You need XRechnung — pure-XML, EN 16931-aligned, with mandatory Leitweg-ID routing. UBL vs CII, ZRE/OZG-RE/PEPPOL transmission, GoBD retention, and the schematron rules that catch most failures.
If your WooCommerce store sells to German federal agencies, ministries, or other public-sector buyers, plain PDF invoices haven't been accepted since November 2020. You need XRechnung — Germany's pure-XML, EN 16931-aligned format for B2G invoicing. This guide explains what XRechnung is, when you need it, and how to generate compliant invoices from WooCommerce.
What is XRechnung?
XRechnung is the German implementation of the European EN 16931 e-invoicing norm, published and maintained by KoSIT (Coordination Office for IT Standards). Unlike ZUGFeRD, which is a hybrid PDF/A-3 + XML format, XRechnung is pure XML. There is no human-readable PDF wrapper — the invoice is the XML file.
XRechnung supports two equivalent syntaxes:
- UBL (Universal Business Language) — the standard syntax used across PEPPOL and most EU countries.
- CII (Cross Industry Invoice) — the syntax used inside Germany and inside ZUGFeRD.
Both syntaxes are accepted by all German receiving platforms; the choice depends on the recipient's preference and on whether you're routing via PEPPOL. The current version is XRechnung 3.0.x (as of 2026).
When do you need XRechnung?
XRechnung is mandatory for B2G transactions over €1,000 with German federal agencies. The mandate took effect on November 27, 2020 — it's been live for years and is fully enforced.
State-level rules (Bundesländer) layer on top, and several states (Bremen, Hamburg, Berlin) have stricter thresholds — sometimes any B2G invoice regardless of amount. If you sell to public-sector buyers in multiple Bundesländer, check each state's portal for its specific rule.
For B2B transactions, XRechnung is not mandatory — but it is one of the accepted formats under Germany's Wachstumschancengesetz (which mandates structured B2B e-invoices from January 2027). Most B2B sellers use ZUGFeRD or Factur-X instead, since both include a human-readable PDF rendering.
UBL vs. CII: which syntax should you use?
The two syntaxes carry the same data and validate against the same EN 16931 rules. The practical guidance:
- Use CII if you're submitting via German government platforms (ZRE, OZG-RE) and the recipient hasn't specified otherwise. CII is the Germany-native syntax and is shared with ZUGFeRD, simplifying tooling.
- Use UBL if you're routing via PEPPOL or sending to a buyer that asks for it. UBL is also the dominant syntax across other EU countries (Belgium, Netherlands, Italy PEPPOL).
invoice9 supports both syntaxes natively and lets you set a default per-buyer.
How XRechnung gets delivered: receiving platforms
XRechnung is a format, not a transmission channel. The German public sector accepts XRechnung via several routes:
- ZRE (Zentrale Rechnungseingangsplattform des Bundes) — the central federal receiving platform.
- OZG-RE — for other public bodies under the Onlinezugangsgesetz (Online Access Act).
- State (Bundesland) portals — many states run their own platforms.
- PEPPOL — increasingly accepted, especially for cross-border B2G.
- Email with the XML attached, where the recipient allows it.
invoice9 generates the XML; the merchant (or their PEPPOL Access Point provider) handles the actual submission. Keeping these concerns separated is intentional — it lets the same generated file be sent through whichever channel the buyer requires.
Required fields: the Leitweg-ID
The single most important XRechnung-specific field is the
Leitweg-ID — a routing identifier that tells German receiving
platforms where to deliver the invoice. Format example:
04011000-1234512345-06.
Buyers issue you their Leitweg-ID at the time of order. In the
XRechnung XML, it goes into the BT-10 BuyerReference field.
Without it, the invoice will be rejected at the receiving platform.
Other required fields beyond the EN 16931 baseline:
- Seller VAT identifier (BT-31)
- Payment terms (BT-20) — even short text is required
- Invoice number, issue date, due date
- Tax breakdown by VAT rate
How WooCommerce stores generate XRechnung
The pipeline has three stages:
- Map the WooCommerce order data to an EN 16931-shaped invoice object.
- Serialize to either CII or UBL XML, applying the XRechnung CIUS (Core Invoice Usage Specification) rules.
- Validate against the layered schematron (EN 16931 base + XRechnung CIUS) before letting the file leave the system.
Most WooCommerce invoice plugins on the marketplace stop at step 1 (PDF generation) or do step 2 only for CII. invoice9 supports both CII and UBL syntaxes natively, validates against the schematron before returning the file, and exposes per-buyer Leitweg-ID storage in the order's billing meta.
GoBD and 10-year retention
Germany's GoBD rules (Grundsätze zur ordnungsmäßigen Führung und Aufbewahrung von Büchern) require:
- 10-year retention of every invoice issued.
- Immutability after the invoice is sent.
- Sequential numbering (gaps are explicitly permitted under UStAE 14.5 Abs. 10 — "gap-free" is a marketing claim, not a legal rule).
invoice9 stores generated XML and PDF artifacts in WordPress's uploads directory under a directory-listing-protected path, and the stored files are content-hashed for tamper detection. Sequential numbering follows whatever WooCommerce order-numbering rule is configured.
Schematron validation
XRechnung validates against a layered schematron:
- EN 16931 base rules — the European norm.
- XRechnung CIUS — German-specific business rules (Leitweg-ID format, mandatory payment terms, etc.).
A common pre-launch failure: the Leitweg-ID is present but in the wrong field, or the format checksum is wrong. The schematron will flag both. invoice9 runs validation before the file is returned — if anything fails, you get a structured error pointing at the specific BT-/BG- field, not a silent rejection from the platform three days later.
Common pitfalls
- Sending CII to a UBL-only PEPPOL recipient. Some buyers only accept one syntax — confirm before sending.
- Invalid Leitweg-ID format. Wrong checksum or missing dashes will fail validation.
- Empty BT-1 (invoice number). Required even if your WooCommerce order numbering is delayed.
- Date format errors. XRechnung requires ISO 8601 (YYYY-MM-DD); German DD.MM.YYYY only goes in human-readable text fields, not date fields.
- Missing tax breakdown per rate. If your order has mixed VAT rates, each rate must have its own subtotal.
Getting started: a 6-step checklist
- Confirm scope: are you selling to German federal agencies, state agencies, or both? Check the relevant Bundesland's threshold rules.
- Pick a plugin that supports both UBL and CII. Single-syntax plugins force you to ship the wrong format if a buyer asks for the other.
- Configure your seller data: VAT-ID, IBAN, BIC, company address. invoice9 has a dedicated German settings panel.
- Capture the Leitweg-ID per order. Either via a WooCommerce checkout field or via per-customer billing meta.
- Generate a test invoice and validate against the KoSIT XRechnung validator before going live.
- Choose a transmission channel (ZRE, OZG-RE, PEPPOL, or email) and test end-to-end with a known recipient.
Frequently asked questions
Do I also need ZUGFeRD?
If you sell to both B2B (private) and B2G (public sector), yes. B2B customers generally prefer ZUGFeRD or Factur-X (which include a human-readable PDF), while B2G must be XRechnung.
Can I send XRechnung to private B2B customers?
Yes. XRechnung is a fully-valid B2B format — it's simply less comfortable to read because it's pure XML. Many B2B accounting systems (DATEV, lexoffice, sevDesk) parse it directly without issue.
Who actually transmits the invoice?
You — or your PEPPOL Access Point provider. invoice9 generates the file; transmission is a separate concern, intentionally. This lets you reuse the same file across email, ZRE, OZG-RE, and PEPPOL without re-generation.
What does invoice9 cost for German B2G stores?
Plans start at $5/month or $50/year. ZUGFeRD, XRechnung UBL, XRechnung CII, and Factur-X are all included on every paid plan.
I sell on both Shopify and WooCommerce. Do I need different setups?
invoice9 ships on both. The same XRechnung pipeline (CII + UBL + schematron) powers both stores, so a B2G buyer who orders across channels gets format-equivalent invoices.
Try invoice9 for WooCommerce
XRechnung UBL + CII. ZUGFeRD 2.x. Factur-X. PEPPOL. Drag-drop template editor. EU-hosted (Frankfurt). From $5/month.
See plugin →