AttestwireRule referenceBR-65

BR-65 An item classification code needs a scheme identifier

noun · EN 16931 · fatal · BT-158

For a sample invoice, the library reports: Classification 1 on line 1 carries an item classification identifier (BT-158) of "72154000" with no scheme identifier (BT-158-1).

Business term
BT-158
Severity
fatal

The fix

Set line.itemClassifications[].schemeId to the UNTDID 7143 code of the classification system — "HS" harmonised system, "MP" product/service identification number, "SRV" GS1 product classification, "ZZZ" mutually defined. Add schemeVersion (BT-158-2) when the system is versioned.

A passing value

the shape this field expects
"itemClassifications": [{ "code": "43211508", "schemeId": "MP" }]

What the library returns

The full error returned by @attestwire/en16931. It includes the rule ID, affected field and suggested correction. Developers can use this object in their application:

TeachingError
{
  "rule": "BR-65",
  "field": "BT-158",
  "severity": "fatal",
  "message": "Classification 1 on line 1 carries an item classification identifier (BT-158) of \"72154000\" with no scheme identifier (BT-158-1). Classification codes are not self-describing and they collide freely across systems — a bare \"43211508\" is a UNSPSC commodity to one reader and a customs heading to another. The scheme is what makes the code resolvable, and it is what a buyer's spend-analysis or a customs declaration reads before the code itself.",
  "fix": "Set line.itemClassifications[].schemeId to the UNTDID 7143 code of the classification system — \"HS\" harmonised system, \"MP\" product/service identification number, \"SRV\" GS1 product classification, \"ZZZ\" mutually defined. Add schemeVersion (BT-158-2) when the system is versioned.",
  "example": "\"itemClassifications\": [{ \"code\": \"43211508\", \"schemeId\": \"MP\" }]",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:Item/cac:CommodityClassification[1]/cbc:ItemClassificationCode/@listID",
  "docsUrl": "https://attestwire.com/rules/BR-65"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.