# Germany XRechnung B2G e-invoicing with Frihet

Germany requires structured e-invoices for all public sector transactions and is rolling out mandatory B2B e-invoicing under the Wachstumschancengesetz. Frihet generates XRechnung-CII and XRechnung-UBL invoices, validates them against the KoSIT schema, and routes them to government recipients.

## Legal framework

German e-invoicing rules stem from two legislative sources:

**EU Directive 2014/55/EU** — mandated that all EU member states accept structured e-invoices for B2G transactions from national, regional, and local authorities. Germany implemented this through federal law in 2020.

**Wachstumschancengesetz (Growth Opportunities Act)** — enacted March 2024, extends the obligation to B2B transactions:

| Date               | Obligation                                                              |
| ------------------ | ----------------------------------------------------------------------- |
| **1 January 2025** | All businesses must be able to **receive** EN16931-compliant e-invoices |
| **1 January 2027** | Businesses with annual revenue > €800,000 must **issue** e-invoices     |
| **1 January 2028** | All remaining businesses must **issue** e-invoices                      |

The B2B receive obligation started on 1 January 2025. If your German customer sends you a structured e-invoice, you are legally required to process it. Frihet handles incoming structured formats as attachments and flags them for reconciliation.

## XRechnung — the mandatory standard

**XRechnung** is the German national profile of EN16931. It defines strict implementation rules on top of the European semantic standard. Two technical syntaxes are accepted:

| Syntax            | File extension | Notes                                                                  |
| ----------------- | -------------- | ---------------------------------------------------------------------- |
| **XRechnung-CII** | `.xml`         | UN/CEFACT Cross Industry Invoice. Recommended by KoSIT for German B2G. |
| **XRechnung-UBL** | `.xml`         | OASIS UBL 2.1. Also valid; more common in multinational ERP systems.   |

Both syntaxes express the same semantic data model. The current version is **XRechnung 3.0.2**, governed by KoSIT (Koordinierungsstelle für IT-Standards).

**Factur-X / ZUGFeRD 2.3** is also compliant with EN16931 and accepted in B2B contexts. It embeds an EN16931-CII XML inside a PDF/A-3 file, making it human-readable while remaining machine-processable. Frihet generates Factur-X hybrid PDFs for B2B invoices where requested.

## Leitweg-ID — mandatory routing identifier for B2G

Every XRechnung invoice sent to a German public authority must include a **Leitweg-ID** in the `BuyerReference` field (`BT-10`). This identifier routes the invoice to the correct administrative unit within the receiving authority.

The Leitweg-ID follows the format `{section}-{subsection}-{check}`, for example:

```
04011000-1234-06
```

Where:

- `04011000` — administrative unit code (Behördenkennzahl)
- `1234` — sub-unit or cost center
- `06` — check digit

:::caution
A missing or malformed Leitweg-ID causes automatic rejection at OZG-RE or the receiving authority's portal. Confirm the correct Leitweg-ID with your government customer's procurement office before invoicing.
:::

### Setting the Leitweg-ID in Frihet

1. Open the client record in **Clients**.
2. In the **Tax data** section, enable **Public authority (B2G)**.
3. Enter the Leitweg-ID in the **Leitweg-ID** field.
4. Save the client.

Frihet populates `BT-10` with this value in every XRechnung generated for that client.

## Generating XRechnung invoices in Frihet

Once the client is configured:

1. Create the invoice as usual.
2. Open the completed invoice and click **More options** → **Export e-invoice**.
3. In the export dialog (`EInvoiceExportDialog`), select **XRechnung 3.0 (Germany)**.
4. Choose the syntax: **CII (recommended for B2G)** or **UBL**.
5. Download the `.xml` file.

Frihet validates the generated XML against the KoSIT schema rules before making it available for download. If the invoice data is incomplete (missing Leitweg-ID, missing VAT number, unsupported currency), the export dialog shows the specific error before generating the file.

## KoSIT validator — pre-submission check

The KoSIT validator is the official tool for verifying XRechnung conformance. Frihet runs the validation rules internally, but you can also verify the exported XML manually:

- **Online validator**: [https://ecosio.com/en/peppol-and-xml-document-validator/](https://ecosio.com/en/peppol-and-xml-document-validator/) (community tool using KoSIT rules)
- **CLI validator**: [https://github.com/itplr-kosit/validator](https://github.com/itplr-kosit/validator) — run `java -jar validationtool-x.y.z-standalone.jar -r scenarios.xml -t report invoice.xml`

A compliant invoice produces a validation report with `valid: true` and zero `errors`.

## Submitting to OZG-RE (federal authorities)

The **OZG-RE (Onlinezugangsgesetz — Rechnungseingang)** is the federal government's central e-invoice receiving platform. It connects to the **PEPPOL network** for automated routing.

### Via PEPPOL (recommended for recurring B2G suppliers)

If your government customer uses PEPPOL routing:

1. Your company needs a **PEPPOL ID** (e.g., `0088:DE123456789` or issued by a certified Access Point Provider).
2. The receiving authority's PEPPOL ID appears in their procurement documents.
3. Frihet routes the invoice via the PEPPOL network to OZG-RE.

PEPPOL AS4 transport for DE B2G is available in Frihet on Premium+ plans. Contact support to activate your PEPPOL endpoint.

### Via email transport (current default for ad-hoc B2G)

For authorities not yet on PEPPOL, or for initial submissions:

1. Export the XRechnung XML from Frihet.
2. Email the `.xml` file to the authority's designated invoicing address (usually specified in the contract or purchase order).
3. Some authorities use the **ZRE (Zentrale Rechnungseingangsplattform)** with a dedicated submission address.

:::note PEPPOL AS4 deferred
Full automated PEPPOL AS4 transport for German B2G is in the Frihet Day 4 roadmap. Until activated for your account, email delivery is the supported path. The XRechnung XML generated by Frihet is technically correct for either transport method.
:::

## B2B obligations — what changes from 2025

From **1 January 2025**, every German VAT-registered business must be able to **receive** EN16931-compliant structured e-invoices. This means:

- You cannot refuse a structured XML invoice from a German supplier.
- Your accounting software must be able to parse XRechnung or Factur-X.
- Frihet automatically handles incoming structured formats when connected via integration or API.

The **emit** obligation follows in 2027 (large companies) and 2028 (all others). Until those dates, you may continue issuing PDF invoices to German B2B customers, but you must be ready to transition.

**Practical impact for Frihet users:**

- German customers will increasingly send you XRechnung or Factur-X XML files.
- Use Frihet's expense import to attach and process these files against supplier records.
- From 2027/2028, Frihet generates the mandatory structured format automatically for German B2B invoices.

## Factur-X for B2B — hybrid PDF/A-3

For German B2B invoices where the recipient prefers a human-readable document:

1. In the export dialog, select **Factur-X (Germany/France B2B)**.
2. Frihet generates a PDF/A-3 file with the EN16931-CII XML embedded.
3. The recipient's software can read the embedded XML automatically; humans can read the PDF.

Factur-X complies with both EN16931 and the Wachstumschancengesetz B2B requirements.

## VAT and tax handling

German e-invoices must include:

- Supplier and buyer VAT numbers (`BT-31`, `BT-48`)
- VAT breakdown per rate (`BG-23`)
- Standard rates: **19%** (general), **7%** (reduced)
- Zero-rated and exempt supplies require the applicable reason code

Frihet applies German VAT rates automatically when the invoice recipient has a German address. If your German customer is VAT-exempt (e.g., a public authority not subject to VAT), set the exemption in the tax configuration.

## Frequently asked questions

**Does XRechnung replace the PDF invoice entirely?**
For B2G, yes — the PDF is no longer the primary document. The structured XML is the legally binding invoice. For B2B, PDFs remain acceptable until the emit mandate dates (2027/2028), but Factur-X allows you to send both simultaneously in one file.

**What if my German customer sends a Factur-X file and I can not process it?**
From 1 January 2025, you are legally required to be able to receive it. Frihet's expense and supplier invoice management handles Factur-X ingestion. If you receive a file outside Frihet, you can upload it via the document import function.

**Is my German VAT number sufficient as a PEPPOL identifier?**
No. Your PEPPOL ID is a separate identifier issued by a certified Access Point Provider (e.g., Pagero, Basware, Comarch). Your German VAT number (`DE123456789`) can form part of the ID under scheme `0088`, but you need an Access Point to participate in the network.

**Can I send XRechnung invoices to Austrian or Swiss public authorities?**
Austria uses a similar B2G mandate (ebInterface or PEPPOL UBL). Switzerland is not in the EU mandate scope. For cross-border B2G in other EU countries, Frihet generates the appropriate national profile.

## Official references

- XRechnung specification: [https://xeinkauf.de/xrechnung/](https://xeinkauf.de/xrechnung/)
- KoSIT validator: [https://www.kosit.org](https://www.kosit.org)
- OZG-RE federal portal: [https://www.e-rechnung-bund.de](https://www.e-rechnung-bund.de)
- EN16931 standard: [https://www.en16931.eu](https://www.en16931.eu)
- Wachstumschancengesetz: [https://www.bundesfinanzministerium.de/Content/DE/Standardartikel/Themen/Steuern/2023-07-24-massnahmenpaket-steuerpolitik.html](https://www.bundesfinanzministerium.de/Content/DE/Standardartikel/Themen/Steuern/2023-07-24-massnahmenpaket-steuerpolitik.html)
- PEPPOL DE: [https://www.peppol.eu/resources/peppol-in-germany/](https://www.peppol.eu/resources/peppol-in-germany/)

## Related

- [E-Invoicing in Germany](/compliance/germany)
- [Electronic invoicing formats](/facturacion/factura-electronica)
- [France Factur-X](/compliance/france)
- [REST API](/desarrolladores/api-rest)
