Unallowed country code for the buyer agent

Error FX-SCH-A-000660 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

If ram:CountryID contains a value, that value must be included in the country code list. A value not listed there is not allowed.

What the rule means

An allowed country code identifies the country of the buyer agent’s postal address unambiguously.

Please use an allowed country code for the buyer agent

The country code in the buyer agent’s postal address is not included in the specified code list. Using a value from that list will resolve the issue.

What to do
  1. Locate the postal address under ram:BuyerAgentTradeParty.
  2. Check the value of ram:CountryID against the specified code list.
  3. Regenerate the invoice and validate it again.
Technical details

The test allows an empty value. A non-empty value must occur as an enumeration in the code list with cl ID 10.

Where the rule applies

The country code in ram:CountryID in the postal address of ram:BuyerAgentTradeParty is checked.

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