Disallowed ship-to country identifier

Error FX-SCH-A-000457 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 is not included in the designated code list. An empty value is allowed by the test condition.

What the rule means

ram:CountryID assigns the ship-to address to a country and, if a value is supplied, must contain an allowed country code.

Please use an allowed country identifier for the ship-to address

The value of ram:CountryID in the ship-to address does not match the designated code list. You can check the country code or leave the value empty.

What to do
  1. Check the value of ram:CountryID against the designated code list.
  2. Leave the value empty if no country identifier is to be supplied.
  3. Generate the invoice again and validate it.
Technical details

The test checks whether the text value of ram:CountryID is empty or occurs in the code list with ID 7.

Where the rule applies

The rule applies to ram:CountryID in the ship-to party’s ram:PostalTradeAddress.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ ram:ShipToTradeParty/ram:PostalTradeAddress/ram:CountryID
Test expression (assert/@test)
string-length($codeValue7)=0 or document('FACTUR-X_BASIC-WL_codedb.xml')/codedb/cl[@id=7]/enumeration[@value=$codeValue7]