Rule reference

BR-11 The buyer postal address must contain a buyer country code (BT-55) as an ISO 3166-1 alpha-2 code, but none was provided

The buyer postal address must contain a buyer country code (BT-55) as an ISO 3166-1 alpha-2 code, but none was provided. This code drives the place-of-supply and reverse-charge logic downstream.

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-55
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-11",
  "field": "BT-55",
  "severity": "fatal",
  "message": "The buyer postal address must contain a buyer country code (BT-55) as an ISO 3166-1 alpha-2 code, but none was provided. This code drives the place-of-supply and reverse-charge logic downstream.",
  "fix": "Set buyer.address.countryCode to the two-letter code, e.g. \"DE\" for Germany and \"GR\" for Greece — \"GR\" is the ISO 3166-1 code EN 16931 requires here, while \"EL\" is only the prefix Greek VAT identifiers (BT-31/BT-48) carry and is not a valid country code for BT-40 or BT-55, where BR-CL-14 rejects it.",
  "example": "\"countryCode\": \"DE\"",
  "xpath": "/ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode",
  "docsUrl": "https://attestwire.com/rules/BR-11"
}

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
"countryCode": "DE"

The fix

Set buyer.address.countryCode to the two-letter code, e.g. "DE" for Germany and "GR" for Greece — "GR" is the ISO 3166-1 code EN 16931 requires here, while "EL" is only the prefix Greek VAT identifiers (BT-31/BT-48) carry and is not a valid country code for BT-40 or BT-55, where BR-CL-14 rejects it.

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