Rule reference

BR-CL-15 A line declares an item country of origin (BT-159) of "UK", which is not an ISO 3166-1 code

Line 1 declares an item country of origin (BT-159) of "UK", which is not an ISO 3166-1 code. The United Kingdom is "GB" in ISO 3166-1 — "UK" is a reserved code and is not in the list. Origin is a customs and trade-preference fact, not a shipping detail: it decides duty rates, preferential-origin claims and whether the goods fall under a sanctions or safeguard measure. It is checked under its own rule id, BR-CL-15, because it binds cac:OriginCountry — the same list as BR-CL-14 on a different element, so a report can show one failing while the other passes.

This rule is implemented and its error payload below is real, but the long-form write-up — normative text, worked example, divergence note — is not written yet. Everything the library knows about this rule is on this page. Ask and we will prioritise it.

Business term
BT-159
Severity
fatal

What the library returns

The exact object in result.errors when this rule fires. Generated by running @attestwire/en16931, not transcribed:

TeachingError
{
  "rule": "BR-CL-15",
  "field": "BT-159",
  "severity": "fatal",
  "message": "Line 1 declares an item country of origin (BT-159) of \"UK\", which is not an ISO 3166-1 code. The United Kingdom is \"GB\" in ISO 3166-1 — \"UK\" is a reserved code and is not in the list. Origin is a customs and trade-preference fact, not a shipping detail: it decides duty rates, preferential-origin claims and whether the goods fall under a sanctions or safeguard measure. It is checked under its own rule id, BR-CL-15, because it binds cac:OriginCountry — the same list as BR-CL-14 on a different element, so a report can show one failing while the other passes.",
  "fix": "Set line.originCountryCode to the two-letter ISO 3166-1 code of the country where the item was produced — not where it shipped from, which is a different fact. Omit the field when origin is not relevant to the supply, as it usually is not for services.",
  "example": "\"originCountryCode\": \"CN\"",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:Item/cac:OriginCountry/cbc:IdentificationCode",
  "docsUrl": "https://attestwire.com/rules/BR-CL-15"
}

xpath locates the element in the generated UBL document, which is where a KoSIT or Peppol validator will report the same problem.

A passing value

the shape this field expects
"originCountryCode": "CN"

The fix

Set line.originCountryCode to the two-letter ISO 3166-1 code of the country where the item was produced — not where it shipped from, which is a different fact. Omit the field when origin is not relevant to the supply, as it usually is not for services.

Arrived from a stack trace? The docsUrl on every error links straight here. Something wrong on this page — tell us.