Allowed country code for the seller’s address

Error FX-SCH-A-000781 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 is not included in the country code list referenced by this rule. This test explicitly allows an empty value.

What the rule means

CountryID assigns the seller’s address to a country. The test accepts only a value from the referenced code list or an empty value.

Please use an allowed country code for the seller’s address

The value in CountryID is not recognized by the code list used for this rule. Change it to a country code included in that list or leave it empty.

What to do
  1. Locate CountryID in the postal address under SellerTradeParty and SpecifiedLegalOrganization.
  2. Compare its value with the country code list used by the rule, or leave the value empty.
  3. Generate the invoice again and validate it.
Technical details

The test passes if $codeValue10 is empty or appears as an enumeration in the code list with ID 10.

Where the rule applies

The rule checks the value of CountryID in the postal address of the seller’s legal organization.

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