Invalid country code for the ship-from organization

Error FX-SCH-A-000809 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 country code list used by this rule. An empty value is also accepted by this check.

What the rule means

A valid country code identifies the country of the legal organization’s postal address. A value not listed cannot be recognized as a country using the code list applied by this rule.

Please use a valid country code for the ship-from organization

The value in ram:CountryID for the legal organization is not recognized by the country code list in use. You can adjust it to match that list.

What to do
  1. Locate ram:CountryID in the postal address of ram:SpecifiedLegalOrganization for the ship-from party.
  2. Compare its value with the country code list used by this rule.
  3. Correct the value if it is not included in the list.
  4. Regenerate the invoice and validate it again.
Technical details

The check accepts either an empty value (string-length($codeValue10)=0) or an entry in code list 10 of the Factur-X code database.

Where the rule applies

This rule applies to ram:CountryID in the postal address of the ship-from party’s legal organization (ram:ShipFromTradeParty).

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