A country code must be present

Error FX-SCH-A-001117 Factur-X

Element 'ram:CountryID' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

CountryID is missing from PostalTradeAddress or occurs more than once. Exactly one CountryID element is required.

What the rule means

CountryID identifies the country in the ultimate ship-to party’s postal address. A single occurrence associates the address with one country.

Please provide the country code for the ultimate delivery address

The ultimate ship-to party’s postal address is missing the country code or contains it more than once. Having exactly one CountryID resolves this issue.

What to do
  1. Open the ultimate ship-to party’s PostalTradeAddress.
  2. Make sure it contains exactly one CountryID element.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID/>
</ram:PostalTradeAddress>
Technical details

The test counts the direct ram:CountryID elements in ram:PostalTradeAddress and requires a count of 1.

Where the rule applies

The rule applies to the postal address of the ultimate ship-to party for an invoice line, under UltimateShipToTradeParty.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeDelivery/ram:UltimateShipToTradeParty/ram:PostalTradeAddress
Test expression (assert/@test)
count(ram:CountryID)=1