Permitted buyer country code

Error FX-SCH-A-000568 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 designated country code list. The check permits an empty value or a value listed there.

What the rule means

ram:CountryID identifies the country of the buyer’s postal address. A permitted country code allows the country to be identified unambiguously.

Please provide a permitted country code for the buyer’s address

The value of ram:CountryID in the buyer’s address is not included in the designated code list. You can leave the field empty or use a value permitted in that list.

What to do
  1. Check ram:CountryID in the postal address of BuyerTradeParty.
  2. Check the value against the designated country code list; the value may also be empty.
  3. Generate the invoice again and validate it once more.
Technical details

The test passes if the checked value is empty or appears as an @value in the enumeration of code list ID 7.

Where the rule applies

The rule applies to ram:CountryID in the postal address of BuyerTradeParty in the invoice header.

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