HomeError code lexicon › BR-21
BR-21 Field BT-126 EN 16931 core rules (BR)

Fix BR-21: Invoice line identifier (BT-126) missing

[BR-21]-Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

BR-21 in your own invoice? Upload the file and find every error in seconds.

What does BR-21 mean?

Every line needs a unique identifier, usually a running number. That way each line can be referenced.

Common causes of BR-21

How to fix BR-21

  1. Find the faulty spot in the XML. Open the XML of the invoice and go to field BT-126 along this XPath://ram:IncludedSupplyChainTradeLineItem/ram:AssociatedDocumentLineDocument/ram:LineID
  2. Apply the fix. Give every Invoice line (BG-25) a unique Invoice line identifier (BT-126) in the element 'ram:AssociatedDocumentLineDocument/ram:LineID'. Number the lines consecutively, for example '1', '2', '3'.
  3. Validate again. Save the file and validate it again to check that BR-21 is no longer reported.
Concrete fix

Give every Invoice line (BG-25) a unique Invoice line identifier (BT-126) in the element 'ram:AssociatedDocumentLineDocument/ram:LineID'. Number the lines consecutively, for example '1', '2', '3'.

XPath//ram:IncludedSupplyChainTradeLineItem/ram:AssociatedDocumentLineDocument/ram:LineID

Before / after: the XML example

This is the spot in question before and after the fix (Cross Industry Invoice, ZUGFeRD/Factur-X).

Wrong
<ram:IncludedSupplyChainTradeLineItem>
  <ram:SpecifiedTradeProduct>
    <ram:Name>Beratung</ram:Name>
  </ram:SpecifiedTradeProduct>
</ram:IncludedSupplyChainTradeLineItem>
Correct
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>1</ram:LineID>
  </ram:AssociatedDocumentLineDocument>
  <ram:SpecifiedTradeProduct>
    <ram:Name>Beratung</ram:Name>
  </ram:SpecifiedTradeProduct>
</ram:IncludedSupplyChainTradeLineItem>

Frequent questions about BR-21

Must the line identifier be a number?
No, it is a character string. Common practice is a running number such as '1', '2', '3', but it only has to be unique within the invoice.
May line numbers repeat?
No. Every Invoice line identifier must be unique within the invoice so the line stays clearly referenceable.

Related error codes

Check BR-21 automatically

Instead of digging through the XML by hand you can validate your ZUGFeRD or XRechnung file online – upload the PDF or the XML and you get every error with rule ID, affected field, fix and XPath, as a readable report or as JSON through the API.

Find every error automatically instead of searching by hand

Upload your ZUGFeRD, Factur-X or XRechnung file – you get every violation back with rule ID, field, fix and XPath.

Validate online for free
Check invoice