Use an allowed country identifier for the buyer address

Error FX-SCH-A-000423 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 CountryID does not match any of the allowed values defined for this field. An empty value is allowed by the test condition.

What the rule means

The country identifier specifies the country of the buyer’s address; its value must match the designated code list or be empty.

Please use an allowed country identifier for the buyer address

The value of CountryID in the buyer’s address is not accepted for this field. Use a value from the designated code list or leave the element empty.

What to do
  1. Locate CountryID in the buyer’s PostalTradeAddress.
  2. Check its value against the designated code list.
  3. Replace it with an allowed value or clear the contents of CountryID.
  4. Generate the invoice again and validate it.
Technical details

The test allows CountryID to be empty or requires its value to be present in code list 7.

Where the rule applies

The rule applies to the value of CountryID in the buyer’s postal address PostalTradeAddress.

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