Skip to content

What is a Leitweg-ID and where does it go in an XRechnung?

The Leitweg-ID routes an XRechnung to the right German public authority. Where you get it, what it looks like, the exact XML field in UBL and CII, and how to fix error BR-DE-15.

Updated November 23, 20263 min read

The Leitweg-ID is the address of a German public buyer for electronic invoices. It tells the receiving platform which authority, office or department should get the invoice. In an XRechnung it goes into the buyer reference (BT-10): cbc:BuyerReference in UBL, ram:BuyerReference in CII. When it is missing, the invoice fails rule BR-DE-15.

Where do I get the Leitweg-ID?

From the buyer. The public authority that orders from you gives it to you, usually in the order, the contract or a separate letter. Do not build or guess one: a Leitweg-ID that looks right but belongs to another office sends your invoice to the wrong place, and the check of the platform will not always catch that.

If the order has none, ask the buyer's purchasing or accounts department before you invoice.

What does a Leitweg-ID look like?

It is a string of digits and letters in up to three parts separated by hyphens, for example 04011000-12345-34:

  1. a coarse address, which identifies the authority (digits);
  2. an optional fine address, which identifies an office or department inside it;
  3. two check digits at the end.

Copy it exactly as you received it, including the hyphens.

Where does it go in the XML?

UBL (XRechnung UBL):

<cbc:BuyerReference>04011000-12345-34</cbc:BuyerReference>

CII (XRechnung CII), inside the header trade agreement:

<ram:ApplicableHeaderTradeAgreement>
  <ram:BuyerReference>04011000-12345-34</ram:BuyerReference>
  …
</ram:ApplicableHeaderTradeAgreement>

In most accounting software the field is called "Leitweg-ID", "buyer reference" or "Käuferreferenz" and belongs to the customer record, so every invoice to that customer carries it.

Do I need a Leitweg-ID for invoices to companies?

XRechnung requires a buyer reference on every invoice (rule BR-DE-15), but only public buyers issue Leitweg-IDs. For a company customer, put the reference the customer gave you into the same field — for example a cost centre or an order reference — as agreed with that customer.

ZUGFeRD invoices in the EN 16931 profile do not require the buyer reference. Once you use the XRECHNUNG profile, the German rules apply and BR-DE-15 does too.

How to fix BR-DE-15

  1. Get the Leitweg-ID or reference from the buyer.
  2. Store it in the customer record of the system that creates the invoice, so it is not missing next time.
  3. If the invoice has already been sent and rejected, correct the file: the fix endpoint sets the field and validates the result.
curl -s https://einvoiceengine.com/v1/invoices/fix \
  -H "Authorization: Bearer $EINV_KEY" -H "Content-Type: application/json" \
  -d '{ "document": "<base64 of the invoice>", "encoding": "base64",
        "changes": [{ "field": "buyerReference", "value": "04011000-12345-34" }] }'

The response contains the corrected invoice in its own format, the validation and a change log with the old and new value.

Frequently asked questions

Is the Leitweg-ID the same as the order number?

No. The Leitweg-ID identifies the receiving authority. An order number (BT-13, purchase order reference) identifies one order. An invoice can and often should carry both.

Can I send the invoice without a Leitweg-ID and add it later?

No. An XRechnung without buyer reference fails validation, and the receiving platforms of the federal government and the states reject it.

Does the service check whether a Leitweg-ID exists?

No. It checks that the buyer reference is present, as the XRechnung rules require. Only the buyer can confirm that an ID is the right one.

Which rule checks the Leitweg-ID?

BR-DE-15: "Das Element "Buyer reference" (BT-10) muss übermittelt werden." See the error codes that come up most for the others.

Check your invoice against the official rules

Upload an XML or PDF invoice. You get every failing rule with an explanation, the fix and the line in the file. Free, without sign-up; the check on this page stores nothing.

Drop an invoice hereXRechnung, EN 16931 or Peppol (UBL / CII), a ZUGFeRD / Factur-X PDF, Facturae or KSeF FA(3). Up to 2 MB.
No invoice at hand?

Processed in memory and not stored. No sign-up needed.