Leitweg-ID
Unique recipient identifier for e-invoices to German public authorities — mandatory in field BT-10 of every B2G XRechnung.
Also known as: Leitweg-Identifikationsnummer, Buyer Reference, BT-10, German routing ID
Short definition
The Leitweg-ID is a unique routing identifier used to address invoices to German public authorities. It is the mandatory field BT-10 (Buyer reference) of every B2G XRechnung. Without a valid Leitweg-ID, the invoice is rejected by the central intake portal ZRE (federal) or OZG-RE (state) — no matter how correct the rest of the invoice is.
It is published by KoSIT (Coordination Office for IT Standards). Every federal, state or public-law entity receives at least one Leitweg-ID.
Structure
A Leitweg-ID always consists of three parts, separated by hyphens:
[coarse address] - [fine address] - [checksum]
Example: 991-33333TEST-33
| Part | Length | Meaning |
|---|---|---|
| Coarse address | 2–12 chars | identifies federal, state or public-law entity |
| Fine address | 0–30 chars | identifies the specific office/department (optional) |
| Checksum | 2 digits | Modulo-97 checksum over the first two parts |
The coarse address follows fixed prefixes: 991 marks test Leitweg-IDs, 992…997 denote different federal tiers, 99001… numbers the German federal states in order.
Where the Leitweg-ID appears
Regardless of XML syntax, the Leitweg-ID always sits in the same BT field:
UBL:
<cbc:BuyerReference>991-33333TEST-33</cbc:BuyerReference>
CII:
<ram:BuyerReference>991-33333TEST-33</ram:BuyerReference>
It is not the recipient’s tax ID, not the VAT ID, not a customer number — it is a standalone routing key the authority provides.
Calculating the checksum
The checksum uses Modulo 97 (similar to IBAN):
- Concatenate coarse and fine address (no hyphens)
- Convert every letter into a number (
A=10,B=11, …,Z=35) - Append the digits
00to the result - Divide by 97, take the remainder
- Checksum =
98 − remainder, two digits with leading zero
The Dokmatiq API computes the checksum automatically when only coarse and fine parts are supplied — or validates a complete Leitweg-ID coming from an ERP system.
Validation via API
curl -X POST https://api.dokmatiq.com/v1/einvoice/leitweg/validate \
-H "Authorization: Bearer $DOKMATIQ_KEY" \
-H "Content-Type: application/json" \
-d '{ "leitwegId": "991-33333TEST-33" }'
Response: { "valid": true, "parsed": { "coarse": "991", "fine": "33333TEST", "checksum": "33" }, "type": "test" }
Test IDs (991-…) are flagged explicitly — preventing a test invoice from accidentally landing in a production intake.
How do you find the right Leitweg-ID?
- Federal authorities: published via the Federal Office of Justice / KoSIT portal; most agencies state it actively on invoices or in tender documents
- States and municipalities: handled individually, often via state portals or requested directly from the issuing office
- Private sector: has no Leitweg-ID — field BT-10 stays empty or carries other references
Common pitfalls
- Wrong checksum — the most frequent rejection; compute it automatically rather than retyping it from a Word document
- Leitweg-ID in the wrong BT field — it belongs in
BuyerReference(BT-10), notEndpointID(BT-49) - Production ID in test environment (or vice versa) — test IDs begin with
991 - Outdated Leitweg-IDs — some authorities have migrated their IDs; legacy values are no longer accepted
Ready to use it via API?
Get started for free. No credit card. 100 documents per month included.