Buyer country code not allowed

Error FX-SCH-A-000495 Factur-X

Value of 'ram:CountryID' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The value of ram:CountryID in the buyer’s address is not included in the applicable code list. An empty code value is also permitted by the test.

What the rule means

ram:CountryID identifies the country of the buyer’s postal address. An allowed country code provides a standardized country designation.

Please use an allowed country code for the buyer’s address

The country code in the buyer’s postal address was not recognized as an allowed value. A valid code identifies the country of the address unambiguously.

What to do
  1. Check ram:CountryID in the buyer’s ram:PostalTradeAddress.
  2. Compare its value with the permitted entries in the country code list.
  3. Recreate the invoice and validate it again.
Technical details

The test accepts an empty code value or a value found in code list ID 13 in FACTUR-X_BASIC_codedb.xml.

Where the rule applies

The rule applies to ram:CountryID in the buyer’s ram:PostalTradeAddress.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID
Test expression (assert/@test)
string-length($codeValue13)=0 or document('FACTUR-X_BASIC_codedb.xml')/codedb/cl[@id=13]/enumeration[@value=$codeValue13]