Use an allowed country identifier for the ship-to address

Error FX-SCH-A-000822 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 non-empty value of ram:CountryID is not included in the designated code list for country identifiers.

What the rule means

ram:CountryID identifies the country of the ship-to address. Any provided non-empty value must be included in the corresponding code list.

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

The country identifier for the ship-to address has a value that is not in the designated code list. Use a value listed there or leave the value empty.

What to do
  1. Locate ram:CountryID in ram:PostalTradeAddress for the party at the ship-to address.
  2. Check the value against the designated code list for country identifiers.
  3. Replace a value that is not listed with an allowed value, or leave the element empty.
  4. Generate the invoice again and validate it.
Technical details

The test permits an empty value; otherwise, the value of ram:CountryID must occur as an entry in code list 10.

Where the rule applies

The rule applies to the value of ram:CountryID in the postal address of the party at the ship-to address.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ ram:ShipToTradeParty/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]