einvoice / EN 16931 / XRechnung rule reference
BR-DEX-06
What this rule means and how to fix it
Any scheme identifier on an item standard identifier (cac:StandardItemIdentification/cbc:ID, BT-157) must be an ISO 6523 ICD (extension) code.
Jede Schema-Kennung einer Artikel-Standardkennung (cac:StandardItemIdentification/cbc:ID, BT-157) muss ein ISO-6523-ICD-Code (Extension) sein.
Deutsche Fassung: Übersetzung der gleichen BT/BG-Semantik (translation — not the official assert).
- Requires
- any scheme identifier on an item standard identifier (cac:StandardItemIdentification/cbc:ID, BT-157) must be an ISO 6523 ICD (extension) code.
- Business terms
BT-157- Syntax
- Binds the UBL-2.1 Invoice / CreditNote syntax and the UN/CEFACT-CII syntax
- Location (UBL-2.1 path)
cac:StandardItemIdentification/cbc:ID[@schemeID and $isExtension]- Fix
- Correct `cac:StandardItemIdentification/cbc:ID[@schemeID and $isExtension]` so that any scheme identifier on an item standard identifier (cac:StandardItemIdentification/cbc:ID, BT-157) must be an ISO 6523 ICD (extension) code.
- Fix (Deutsch)
- Korrigieren Sie `cac:StandardItemIdentification/cbc:ID[@schemeID and $isExtension]`, sodass gilt: Jede Schema-Kennung einer Artikel-Standardkennung (cac:StandardItemIdentification/cbc:ID, BT-157) muss ein ISO-6523-ICD-Code (Extension) sein.
- Severity
- fatal
- Provenance source
xrechnung-ubl- Provenance assert
Any scheme identifier in MUST be coded using one of the ISO 6523 ICD list.
The Location above is a UBL-2.1 path, and no UN/CEFACT-CII path for this rule is published here; Fix and Fix (Deutsch), verbatim from remediation_catalog.json and not reworded here; the UN/CEFACT-CII binding of this rule is differentially proven against the official KoSIT XRechnung 2.5.0 (XRechnung 3.0.2) Schematron.
Where to check the fix: paste the corrected invoice into the browser validator at /einvoice/validate/ — it runs this same engine locally in your browser, with no upload, and stops reporting BR-DEX-06 once the edit lands.
Korrektur prüfen: Laden Sie die geänderte Rechnung in den Browser-Validator unter /einvoice/validate/ — er führt dieselbe Engine lokal im Browser aus, ohne Upload, und meldet BR-DEX-06 nicht mehr, sobald die Korrektur greift.
The same invoice, failing and fixed
No vendored test suite ships a labelled example for this rule, so this pair was found rather than written. The engine was run over the vendored instance corpus/xrechnung-testsuite/src/test/business-cases/extension/04.05a-INVOICE_uncefact.xml under --profile xrechnung, then re-run over the same file with one mechanical edit applied to one element, over and over, until the edit below changed the verdict: the schemeID attribute of GlobalID was changed from XR01 to ZZZ, a token that appears in no code list. The page publishes it because the engine reported BR-DEX-06 for the edited document and did not report it for the untouched one.
CII Invoice (XRechnung extension) — fails
The vendored file around the change, verbatim:
<ram:SpecifiedTradeProduct>
<!-- DiGA-VE-ID: -->
<ram:GlobalID schemeID="ZZZ">12345678</ram:GlobalID>
<!-- Freischaltcode: -->
<ram:BuyerAssignedID>ABCDEFGHIJKLMNOP</ram:BuyerAssignedID>
<!-- DiGA-Name: -->
<ram:Name>Tinnitus Rex</ram:Name>
<ram:Description>Ein Artikel für Testrechnungen.</ram:Description>
<!--
<ram:IndividualTradeProductInstance>
<ram:SellByDateTime>
<!– Tag der Leistungserbringung –>
<udt:DateTimeString format="102">20200102</udt:DateTimeString>
</ram:SellByDateTime>
</ram:IndividualTradeProductInstance>
-->
</ram:SpecifiedTradeProduct>
CII Invoice (XRechnung extension) — passes
The same lines as 04.05a-INVOICE_uncefact.xml actually ships them — this block is the fix for the block above:
<ram:SpecifiedTradeProduct>
<!-- DiGA-VE-ID: -->
<ram:GlobalID schemeID="XR01">12345678</ram:GlobalID>
<!-- Freischaltcode: -->
<ram:BuyerAssignedID>ABCDEFGHIJKLMNOP</ram:BuyerAssignedID>
<!-- DiGA-Name: -->
<ram:Name>Tinnitus Rex</ram:Name>
<ram:Description>Ein Artikel für Testrechnungen.</ram:Description>
<!--
<ram:IndividualTradeProductInstance>
<ram:SellByDateTime>
<!– Tag der Leistungserbringung –>
<udt:DateTimeString format="102">20200102</udt:DateTimeString>
</ram:SellByDateTime>
</ram:IndividualTradeProductInstance>
-->
</ram:SpecifiedTradeProduct>
What the engine reports for the edited invoice
{
"element": "ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID",
"field": "ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID",
"fix_hint": "Correct `BT-157` so that any scheme identifier on an item standard identifier (cac:StandardItemIdentification/cbc:ID, BT-157) must be an ISO 6523 ICD (extension) code.",
"location": "BT-157",
"message": "Any scheme identifier on an 'Item standard identifier' (BT-157) must be coded with an ISO 6523 ICD code.",
"rule": "BR-DEX-06",
"severity": "fatal",
"terms": [
"BT-157"
],
"title": "Any scheme identifier on an item standard identifier (cac:StandardItemIdentification/cbc:ID, BT-157) must be an ISO 6523 ICD (extension) code."
}
Rule ids the engine reports for 04.05a-INVOICE_uncefact.xml untouched: BR-CL-10 BR-CL-21. After the edit, BR-DEX-06 is reported that was not before.
Two honest limits. This is an edit that provokes the rule, not the only one, and it is not a claim about how real exporters break it. And it is the reverse of the fix a reader needs: the passing block is the vendored file's own content, which is what a conformant invoice looks like here.
Reproduce it yourself: take corpus/xrechnung-testsuite/src/test/business-cases/extension/04.05a-INVOICE_uncefact.xml from this repository, apply the one edit named above, and run einvoice validate 04.05a-INVOICE_uncefact.xml --profile xrechnung --format json, or paste the file into the browser validator, which runs this same engine locally with no upload.
Everything here is free and open source — pick up whatever helps, at your own pace:
- Licensing — free and open source under Apache-2.0 for everyone, including closed-source embedding: use, modify and ship it inside a commercial product with no fee and no license key.
- German remediation (
--lang de) — the German fix for this rule is in the section above; the CLI surfaces it in place of the English message with--lang de. - Quickstart / free on-ramp — the README, a copy-paste CI-gate recipe, and a 5-minute worked walkthrough.