Skip to content
Rechnungskit
Guide · E-invoicing
Explainer

Leitweg-ID: what it is, how it is structured and how it gets onto the invoice

The Leitweg-ID (routing ID) is the recipient address of an e-invoice to a public authority or another public-sector buyer in Germany. In the XRechnung it goes in the buyer reference field (BT-10) and makes sure the receiving portal forwards the invoice to the right office. You get it from the buyer; you do not create it or apply for it yourself.

What is the Leitweg-ID?

The Leitweg-ID is a unique identifier that public-sector buyers in Germany use to route incoming e-invoices to the right office. The federal government, the states and municipalities receive invoices centrally through portals such as the ZRE (federal) or the OZG-RE (federal and connected states). The portal reads the Leitweg-ID from the invoice and delivers it to the responsible office, without anyone sorting documents by hand.

Technically, the Leitweg-ID is the content of the buyer reference field (BT-10) in the XRechnung, the German public-sector e-invoice format. The XRechnung rules of KoSIT, the coordination office that maintains the standard, make this field mandatory (rule BR-DE-15), and for invoices to the federal government the E-Invoicing Ordinance explicitly requires the Leitweg-ID (§ 5(1) no. 1 ERechV, German). If the identifier is missing or formally wrong, the receiving portal rejects the invoice before a human has seen it (§ 4(3) and (4) ERechV, German).

One point to keep straight: the Leitweg-ID belongs to the invoice recipient, not to you. As a business you have no Leitweg-ID of your own and do not need one. You copy the buyer's ID into the invoice you send them.

Structure and example

A Leitweg-ID consists of up to three parts separated by hyphens:

  1. Coarse address (Grobadressierung), 2 to 12 digits. It assigns the invoice to a regional authority and, for states and municipalities, is derived from the official municipality key. Federal authorities can be recognized by the prefixes 991 to 993 (direct and indirect federal administration).
  2. Fine address (Feinadressierung), optional, up to 30 letters or digits. It names a single office, agency or department within the authority.
  3. Check number, always two digits. It is calculated from the preceding parts under ISO 7064 (modulo 97-10) and catches typos.

A complete example: 04011000-1234512-68. Here 04011000 is the coarse address (the municipality key of the city of Bremen), 1234512 a fine address and 68 the check number. Without the fine address, the same address reads 04011000-45; the check number changes because it is derived from the preceding parts. A federal address looks like the OZG-RE test identifier: 99661-WEBSERVICEOZG-28.

When checking a Leitweg-ID, you can verify two things yourself: the pattern (digits, optional middle part, hyphens, two-digit ending) and the length (no more than 46 characters). The receiving portal recalculates whether the check number is right. That is why it pays to always copy the ID from the buyer's written source instead of retyping it.

Where do I find the Leitweg-ID?

The short answer: in the purchase order. Public-sector buyers usually give you their Leitweg-ID with the order, in the contract or in the tender documents. It often comes together with a note on which portal to submit the invoice through.

If it is missing there, try this order:

  • Ask the buyer. The authority's procurement office or invoicing office knows its own Leitweg-ID. This is the safest route, because authorities with many offices can have several IDs.
  • The authority's website. Many municipalities and state bodies publish their Leitweg-ID on a page about e-invoicing.
  • State directories. Some states keep public lists of their Leitweg-IDs; good starting points are the Leitweg-ID portal and the e-invoicing pages of the state administrations.

What you should not do: assemble a Leitweg-ID yourself from the municipality key. Without the correct fine address and check number, the portal rejects the invoice.

Who needs a Leitweg-ID?

Only bodies that receive e-invoices through a public portal have a Leitweg-ID: federal authorities, state authorities, municipalities, universities, social insurance institutions and similar bodies. They receive their ID through the central allocation of their state or of the federal government.

As a supplier or service provider, you need it as soon as you invoice such a buyer. For suppliers to the federal government, electronic invoices have been mandatory since November 27, 2020 (§ 3(1) ERechV, § 11(3) ERechV, both German); the states have their own deadlines and rules. If you only sell to businesses and consumers, you will never deal with the Leitweg-ID.

E-invoices without a Leitweg-ID: is that possible?

Yes, in business between companies. The e-invoicing mandate, which has applied to B2B since 2025, requires a structured format (§ 14(1) sentence 6 UStG, German) but no Leitweg-ID. A ZUGFeRD document without a buyer reference is a full e-invoice there. And there is no e-invoicing mandate for consumers anyway (§ 14(2) sentence 2 no. 1 UStG, German).

No, when invoicing public-sector buyers. An XRechnung without a Leitweg-ID breaks rule BR-DE-15, and for the federal government a required detail under § 5(1) no. 1 ERechV (German) is also missing. ZRE, OZG-RE and the state portals reject it. That is also why the identifier is the first question that comes up when a shop or SaaS provider gets its first public-sector customer.

Leitweg-ID in XRechnung and ZUGFeRD

XRechnung and ZUGFeRD are based on the same standard, so both have the buyer reference field (BT-10). The difference lies in the format and how strict the rules are:

  • In the XRechnung, the Leitweg-ID in BT-10 is mandatory. In the XML it appears as ram:BuyerReference (UN/CEFACT CII) or cbc:BuyerReference (UBL), depending on the syntax chosen.
  • In ZUGFeRD the same element exists, but it is optional in normal B2B use. The federal government generally requires XRechnung but allows other standards under EN 16931 (§ 4(1) ERechV, German). Whether a portal accepts a hybrid ZUGFeRD document depends on the portal and the state; if in doubt, ask the buyer.

In practice that means: a customer with a Leitweg-ID gets an XRechnung, everyone else gets ZUGFeRD. The field is the same, the packaging is not.

How Rechnungskit puts it on the invoice

Rechnungskit decides the invoice format per customer, not per account. There is no project setting for it. Instead, the Leitweg-ID reaches the document in one of three ways:

  • Stored on the customer. Under Customers you expand the recipient and enter their Leitweg-ID in the Invoice format box. From the moment you save, all future invoices to this customer are created as XRechnung 3.0; documents already created stay unchanged, as GoBD requires.
  • In the Rechnungskit checkout. Business customers with Germany as their country see the link "Public-sector buyer? Add your Leitweg-ID" below the billing address in the checkout, which opens an optional field. If a public-sector buyer fills it in, their invoice is created as an XRechnung without any rework.
  • Via the API. If you submit orders through the push API, set leitweg_id in the billing address. The API answers a formally invalid Leitweg-ID with status 422, so no defective invoice is created.

The Leitweg-ID is checked against its pattern on entry (coarse address, optional fine address, two-digit check number). The XRechnung is validated against the KoSIT rules, archived in line with GoBD and sent by email, together with a readable PDF version for the person on the other end. Cancellation invoices (Storno) take on the format of the original invoice.

Two things to know before your first invoice to an authority: the XRechnung requires a phone number for the seller (rule BR-DE-6). If it is missing from the invoice contact details, Rechnungskit holds the invoice back as a task until you add it in Settings. And you deliver it to the portal yourself: Rechnungskit is not connected to PEPPOL, so you upload the XML to the ZRE, the OZG-RE or the state portal. The page creating e-invoices shows the whole automated path from order to document.

FAQ

From the buyer. Authorities state their Leitweg-ID in the purchase order, in the contract or on their website under "E-Rechnung" (e-invoice); many federal states also keep public directories. If it is missing, ask the buyer's procurement office or invoicing office.
Read more
Guide E-invoicing for B2C in Germany: does the mandate apply to online shops? Guide E-invoicing in Germany: the mandate explained for founders Guide Invoicing in a foreign currency in Germany: which exchange rate applies? (ECB, DATEV, OSS) Guide GoBD explained: principles, retention and what they mean for your invoices Guide Small-amount invoices in Germany (§ 33 UStDV): when the buyer's address can be left out Guide E-invoicing for small businesses in Germany (Kleinunternehmer): duties, exemptions, thresholds 2026 Guide The German cancellation button (§ 312k BGB): who needs it and how it works Guide The date of supply on German invoices: shipping date or payment date? Guide The OSS scheme explained: the €10,000 threshold, registration and an example Guide Deferred revenue for SaaS and online courses in Germany: when a pRAP is required Guide Proforma invoices in Germany: what they are for and why they are not invoices Guide Deferred revenue in German accounting (pRAP): definition, bookings and an example Guide Changing the billing address on a German invoice afterward: is it possible? (without a cancellation) Guide Correcting an invoice in Germany: which route for which error? Guide Server-side tracking for Meta: Conversions API with a lean consent bar Guide Shopify gift cards in Germany: gift card, discount code and store credit for VAT Guide Shopify invoices in Germany: what Shopify does, what is missing, what applies from 2027 Guide Shopware invoices: what Shopware 6 does on its own and what is missing Guide Stripe DATEV export: getting Stripe payments into DATEV as a booking batch Guide Booking Stripe fees in Germany: clearing account, reverse charge and Stripe Technology Europe Ltd Guide Stripe Invoicing in Germany: creating invoices, pricing and e-invoicing Guide Stripe invoices with payment terms as e-invoices: bank transfer to the Stripe IBAN Guide Stripe invoices in Germany: what Stripe Invoicing and Billing do, what is missing, and what applies from 2027 Guide Shipping costs and VAT in Germany: 7%, 19% or tax-exempt? Guide The German withdrawal button (§ 356a BGB): mandatory since June 19, 2026 Guide WooCommerce DATEV export: options, file format and account mapping Guide WooCommerce invoices in Germany: plugins, mandatory details, e-invoicing Guide XRechnung vs ZUGFeRD: the XRechnung format explained Guide Payment terms on invoices in Germany: rules, due date calculation and wording Guide ZUGFeRD explained

Rechnungskit is not a tax advisory or law firm. This article explains general principles and does not replace advice from a tax advisor (Steuerberater, § 5 StBerG) or a lawyer (§ 3 RDG). Rechnungskit is built for businesses based in Germany and prepares documents, tax rates and bookings automatically. How your specific case is treated remains your decision, ideally together with your tax advisor or a lawyer.

Every invoice automatically as a valid e-invoice.

Connect your payment provider and we take care of format, validation and archive. Start for free in test mode.

Try it now
de en