Rule at a Glance
| ID | Severity | Context (XPath) |
|---|---|---|
| BR-21 | Fatal (error) | ubl:Invoice/cac:InvoiceLine |
| Series reference: BR-21 | Schematron ID: ibr-021 | ||
Classification
Transaction Data — BR-21 applies at invoice line level (IBG-25). It mandates that every cac:InvoiceLine element carries an cbc:ID element — the invoice line identifier (IBT-126). This is the primary key for an invoice line within the document. It is used by the buyer's ERP to match line-level data during three-way matching and by the FTA's audit tools to reference specific line items in a query.
What the Rule Is Checking
BR-21 tests that each cac:InvoiceLine element contains a cbc:ID child element with a non-empty value. The schematron evaluates this rule once per invoice line — an invoice with ten lines will evaluate BR-21 ten times. A single line missing its ID causes a fatal failure for the entire invoice document.
The rule does not validate uniqueness — BR-21 only tests presence. However, the PINT-AE specification requires that line identifiers be unique within a single invoice. A companion rule (BR-CO-24 in the calculation rules series) enforces this uniqueness constraint. Passing BR-21 on a document with duplicate line IDs does not mean the document is compliant — it means only the presence check passed.
Why This Rule Exists
Invoice line identifiers are the structural backbone of automated invoice processing. In UAE e-invoicing, every line must carry an HS code, a VAT treatment, and a line amount — the FTA's data requirements under MD 243 Article 7 are fundamentally line-level. Without a stable line identifier, any system attempting to reference, query, or dispute a specific line has no anchor. An audit query that says "explain line 7" is only meaningful if line 7 has a consistent, machine-readable ID.
For the buyer's ERP, the line ID drives the goods receipt matching process. Purchase order line numbers are matched against invoice line IDs to confirm that what was ordered corresponds to what was invoiced. A missing line ID breaks this match and forces manual intervention, adding processing cost and delay that UAE e-invoicing is specifically designed to eliminate.
Standard / Code List
No code list applies. The line identifier is a free-format string within the invoice document. Common conventions are sequential integers (1, 2, 3) or the ERP's internal line item number. The value only needs to be unique within the invoice — the same ID value can appear on different invoices without conflict.
UAE Data Example
PASSES ✓ — two lines, each with a unique identifier
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="EA">5</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="AED">500.00</cbc:LineExtensionAmount>
<cac:Item><cbc:Name>Office Desk</cbc:Name></cac:Item>
<cac:Price><cbc:PriceAmount currencyID="AED">100.00</cbc:PriceAmount></cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="EA">10</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="AED">300.00</cbc:LineExtensionAmount>
<cac:Item><cbc:Name>Office Chair</cbc:Name></cac:Item>
<cac:Price><cbc:PriceAmount currencyID="AED">30.00</cbc:PriceAmount></cac:Price>
</cac:InvoiceLine>
FAILS ✗ — InvoiceLine with no ID element
<cac:InvoiceLine>
<!-- cbc:ID missing — BR-21 fires as fatal for this line -->
<cbc:InvoicedQuantity unitCode="EA">5</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="AED">500.00</cbc:LineExtensionAmount>
<cac:Item><cbc:Name>Office Desk</cbc:Name></cac:Item>
</cac:InvoiceLine>
What Your ERP / IT Team Must Ensure
- Configure your UBL builder to output
cbc:IDas the first child element of everycac:InvoiceLineblock — it must appear before InvoicedQuantity and LineExtensionAmount in the element sequence. - Use the ERP's internal line item counter (SD item number in SAP, line number in Oracle AR) as the source for IBT-126 — this gives you a stable, automatically generated identifier that is always unique within the document.
- Ensure your UBL template does not apply a conditional mapping that omits the ID element for lines flagged as free-text, comment, or discount lines — all invoice lines, including subtotal and discount rows, must carry an ID.
- Validate uniqueness of line IDs in your pre-submission pipeline: check that no two
cbc:IDvalues within a single invoice are identical before submitting to the ASP. - For credit notes, the same rule applies to
cac:CreditNoteLine/cbc:ID— the credit note line identifier is equally mandatory and must be unique within the credit note document.
Related Rules
BR-22 (invoiced quantity mandatory), BR-23 (unit of measure code mandatory), BR-24 (line net amount mandatory), BR-25 (item name mandatory). See also MD 243 Article 7 data fields and 51 mandatory fields in PINT-AE.
