AttestwireRule referenceBR-CL-07

BR-CL-07 The invoiced object identifier scheme must be a UNTDID 1153 code

noun · EN 16931 · fatal · BT-18

For a sample invoice, the library reports: The scheme identifier on the invoiced object identifier (BT-18-1) is "NOPE", which is not in the UNTDID 1153 restriction EN 16931 applies — 818 codes, so a plausible-looking abbreviation is very unlikely to be one of them by accident.

Business term
BT-18
Severity
fatal

The fix

Set invoicedObjectIdentifier.schemeId to a UNTDID 1153 reference qualifier: "CT" contract number, "ON" order number, "AAJ" delivery order number, "VN" vendor order number, "MG" meter number, "IV" invoice number. Omit the scheme entirely rather than inventing one — the identifier is then emitted without @schemeID, which this rule does not bind.

A passing value

the shape this field expects
"invoicedObjectIdentifier": { "schemeId": "MG", "value": "1234567890" }

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-CL-07",
  "field": "BT-18",
  "severity": "fatal",
  "message": "The scheme identifier on the invoiced object identifier (BT-18-1) is \"NOPE\", which is not in the UNTDID 1153 restriction EN 16931 applies — 818 codes, so a plausible-looking abbreviation is very unlikely to be one of them by accident. The object identifier says what the invoice is *about* when that is not a purchase order: a contract, a meter, a vehicle, a case file. Without a scheme the receiver has a string; with the wrong scheme it has a string it will confidently misinterpret.",
  "fix": "Set invoicedObjectIdentifier.schemeId to a UNTDID 1153 reference qualifier: \"CT\" contract number, \"ON\" order number, \"AAJ\" delivery order number, \"VN\" vendor order number, \"MG\" meter number, \"IV\" invoice number. Omit the scheme entirely rather than inventing one — the identifier is then emitted without @schemeID, which this rule does not bind.",
  "example": "\"invoicedObjectIdentifier\": { \"schemeId\": \"MG\", \"value\": \"1234567890\" }",
  "xpath": "/ubl:Invoice/cac:AdditionalDocumentReference/cbc:ID/@schemeID",
  "docsUrl": "https://attestwire.com/rules/BR-CL-07"
}

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