Knowledge · E-invoicing
What is the Leitweg-ID?
Structure of the Leitweg-ID
The structure is defined in the Leitweg-ID format specification 2.0.2 of 28 July 2021.
Coarse addressing: The coarse addressing begins with the two-digit code of the federal state, from 01 for Schleswig-Holstein to 16 for Thuringia, or with 99 for the federal level. For federal states and municipalities, the codes of the administrative region, district and municipality from the official regional key (Amtlicher Regionalschlüssel) may follow. Because the regional key has twelve digits, the coarse addressing can be up to 12 digits long.
For federal authorities, the 99 is followed by another digit that indicates which solution the authority uses to receive e-invoices. The Leitweg-ID then begins with 991, for example.
Fine addressing: The fine addressing follows after a hyphen and comprises up to 30 characters from the letters A to Z and the digits 0 to 9. It is not case-sensitive. In BT-10, your software nevertheless copies the Leitweg-ID exactly as the authority has specified it.
There is no general rule for the fine addressing. The federal and state administrations each use it according to their own system.
The specification recommends starting the fine addressing with a letter. Because the hyphen is not included in the check digit calculation, the check digits do not detect a shifted hyphen between coarse and fine addressing. A letter at the start of the fine addressing makes this error visible.
Check digits: The Leitweg-ID ends with a hyphen and two check digits. They are calculated from the coarse and fine addressing using the modulo 97-10 method of ISO/IEC 7064, the same method used to form the IBAN check digits. If your software already validates IBANs, it can reuse this modulo calculation for the Leitweg-ID.
Whoever assigns the Leitweg-ID calculates the check digits by concatenating the coarse and fine addressing without hyphens and with letters converted to numbers, appending two zeros and dividing the number by 97. The remainder is subtracted from 98. A single-digit result is given a leading zero.
How your software checks the Leitweg-ID
Using the check digits, your software can detect typing errors at the point of entry, before the invoice receipt portal rejects the invoice.
1. Remove spaces and check the structure: Your software should remove spaces before or after the Leitweg-ID as soon as it is entered. It then checks the length and characters of the three parts as described above.
According to the federal government’s FAQ on e-invoicing, spaces and misplaced hyphens are reasons why the federal government’s OZG-compliant invoice receipt platform (OZG-RE) reports the Leitweg-ID as invalid.
2. Convert letters to numbers: The modulo 97-10 check only works with numbers. Your software therefore omits the hyphens and replaces each letter of the fine addressing with a number, A with 10, B with 11 and so on up to Z with 35. Counting starts at 10 so that no letter gets the same value as a digit.
3. Verify the check digits: Your software divides the resulting number by 97. If the remainder is 1, the Leitweg-ID is structured correctly.
Example from the specification: For the Leitweg-ID 04011000-1234512345-06, 04011000123451234506 divided by 97 leaves a remainder of 1.
Example with letters: For the Leitweg-ID 991-A12B3-18, A becomes 10 and B becomes 11. 991A12B318 thus becomes 991101211318, which divided by 97 also leaves a remainder of 1.
The number can have far more digits than a 64-bit integer type can hold. Your software should therefore calculate the remainder in blocks or with a data type for large integers, as in IBAN validation.
Valid check digits only show that the Leitweg-ID is structured correctly. Whether it has actually been assigned is only checked by the invoice receipt portal.
The Leitweg-ID in field BT-10
The Leitweg-ID is entered in field BT-10 (Buyer reference) of EN 16931 and therefore in every format based on the standard. In an XRechnung, BT-10 must always be filled in, as required by rule BR-DE-15. Peppol BIS Billing 3.0 also requires BT-10 with rule DE-R-015 if the seller and buyer are both based in Germany. Both rules only require a value in the field and do not check whether the Leitweg-ID is valid.
For invoices to public authorities, BT-10 contains the Leitweg-ID. For invoices to companies, your software enters the identifier that the buyer specifies for its internal processing, such as a supplier number. If the buyer does not specify an identifier, a placeholder such as “-” is sufficient for VAT purposes according to the German Federal Ministry of Finance’s FAQ on e-invoicing.
Which message a validator outputs when BT-10 is missing is shown in our article Validating e-invoices and reading the validation report correctly.
Leitweg-ID and Peppol ID under scheme 0204
An invoice sent to an authority via Peppol contains two identifiers with different purposes.
Peppol ID in BT-49: The Peppol ID is entered as the buyer’s electronic address in BT-49 and as the receiver identifier in the Peppol envelope (SBDH). The Peppol network uses it to find the authority’s Access Point. For authorities in Germany, the Coordination Office for IT Standards (KoSIT) provides for scheme 0204 in its guideline on the identification schemes in the Peppol network. KoSIT registered the Leitweg-ID under this code in accordance with ISO/IEC 6523 in 2019.
Before sending, your software can query SML and SMP to find out whether an authority is registered under a Peppol ID. The public Peppol Directory can be searched by name. However, it only lists participants who have published their details, so a missing entry does not rule out a registration.
Store both values separately: The Peppol ID in BT-49 addresses the authority in the Peppol network, while the Leitweg-ID in BT-10 addresses the responsible office within the authority.
At federal level, the Peppol ID consists of the prefix 0204 and the Leitweg-ID. 991-33333TEST-33 thus becomes 0204:991-33333TEST-33, as shown in the federal government’s guideline on the Peppol transmission channel. For other authorities, the two values may differ.
Your software should therefore store both values in separate fields and not derive the Leitweg-ID for BT-10 from the Peppol ID.
Requirements for your software regarding the Leitweg-ID
Store the Leitweg-ID per order: The Leitweg-ID from the order is what counts, so a single field in the customer master data is not always enough. Your software should be able to store the Leitweg-ID on the order or contract and transfer it from there to the invoice.
Mandatory information and format for invoices to federal authorities: In addition to the Leitweg-ID, § 5(1) ERechV requires your customers’ bank details, payment terms and an email or De-Mail address. Under § 5(2) ERechV, a supplier number and a purchase order number must be included in the invoice if the authority provided them when placing the order. Your software should therefore treat this information as mandatory fields for invoices to federal authorities. Exempt under § 3(3) ERechV are, among others, invoices for direct awards of up to 1,000 euros.
Under § 4 ERechV, the XRechnung standard must be used as the format. Another standard is permitted if it meets the requirements of EN 16931. OZG-RE gives ZUGFeRD 2.2.0 in the XRECHNUNG profile as an example and accepts it only as a pure XML file without a PDF. For invoices to state and municipal authorities, the regulations of the respective federal state apply.
Deliver XRechnung via Peppol: InvoiceRails generates and validates XRechnung invoices via the API and delivers them via Peppol, including to authorities with a Peppol ID under scheme 0204. You can check individual files in advance with the free e-invoice validator. This way, your customers can continue to issue their invoices to authorities from your software.