Invalid country code for the delivery address

Error FX-SCH-A-000586 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 corresponding code list. The test also accepts an empty value.

What the rule means

ram:CountryID identifies the country of the ship-to party’s postal address. A value that is not listed can prevent the delivery location from being assigned to a country unambiguously.

Please check the country code for the delivery address

The value of ram:CountryID in the ship-to party’s address is not included in the applicable code list. You can update the country code in this field.

What to do
  1. Find ram:CountryID in the ship-to party’s postal address.
  2. Check the country code against the allowed values.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty value or a value present in the code list with ID 7.

Where the rule applies

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

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_EN16931_codedb.xml')/codedb/cl[@id=7]/enumeration[@value=$codeValue7]