The Leitweg-ID is the most common reason an otherwise correct XRechnung is turned away by a German invoicing portal. It is not a customer number and not a purchase order number: it is an address inside the public administration.
What it is for
Public authorities receive invoices centrally and process them departmentally. The portal therefore has to know where inside the organisation an incoming invoice should be handed on to. That routing is what the Leitweg-ID encodes — the German name means, roughly, "routing ID".
It travels in the field the standard calls BT-10, the buyer reference. On an invoice to a public body that field is effectively mandatory, and a wrong value there fails before anybody looks at what you charged.
How it is built
A Leitweg-ID has up to three parts, separated by hyphens: a coarse address, an optional fine address, and two check digits at the end.
| Part | What it holds |
|---|---|
| Coarse address | Identifies the authority. Between 2 and 12 characters, and the part your client always knows. |
| Fine address | Optional. Identifies a department or a specific process within it, up to 30 characters. |
| Check digits | Two digits, computed from everything before them. |
The check digits use ISO 7064 MOD 97-10 — the same scheme as an IBAN. One detail decides whether your implementation agrees with the portal’s: the hyphen separating the coarse and fine address is **not** part of the input to the calculation. Getting that wrong produces a value that looks plausible and is always rejected.
You can check one here. It runs in your browser and nothing is sent anywhere:
Check a Leitweg-ID
Structure and check digit are worked out in your browser. What you type never leaves your device.
Where to get yours
From your client, and only from your client. There is no public register you can look it up in, and it is not derivable from the authority’s name or address — which is why guessing is not an option.
- Ask the person who commissioned the work, and say the word "Leitweg-ID" — it is the term their finance team will recognise.
- If they do not know it, the accounts payable or invoice-receipt department will.
- It is frequently printed on the purchase order or in the award letter, so it is worth re-reading what you were sent.
A value with correct check digits is not thereby the right value. The check digits only prove that nothing was mistyped; they say nothing about whether that address exists or belongs to your client. An invoice with a well-formed but wrong Leitweg-ID is routed nowhere and simply goes unpaid.
Common questions
No. The Leitweg-ID exists for the public sector. For ordinary B2B invoices the buyer reference field carries whatever your client asks for, often a purchase order number, or nothing at all.
Check the Leitweg-ID first — it is the most frequent cause. After that, the electronic addresses for both parties and the tax category on each line. The free viewer points out all three.
No. Many authorities use only a coarse address plus check digits. Use exactly what you were given and do not add parts of your own.
The free XRechnung generator takes the Leitweg-ID along with the rest of the invoice and gives you the XML file — no account, and nothing you type is stored.
Open the free generator