Invalid country code

Error FX-SCH-A-000507 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 neither empty nor included in the country code list allowed for this element.

What the rule means

ram:CountryID identifies the country in the goods recipient’s postal address. An allowed country code supports consistent machine processing of the address.

Please use an allowed country code for the goods recipient

The goods recipient’s postal address contains a value in ram:CountryID that is not allowed. Use an entry from the designated country code list or leave the element empty.

What to do
  1. Locate ram:CountryID in the goods recipient’s postal address.
  2. Check the value against the designated country code list.
  3. Use a value listed there or leave ram:CountryID empty.
  4. Generate the invoice again and validate it.
Technical details

The test accepts an empty code value or a value listed in FACTUR-X_BASIC_codedb.xml under code list ID 13.

Where the rule applies

The rule applies to ram:CountryID in the goods recipient’s postal address in the delivery header.

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