The delivery address requires exactly one country identifier

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

ram:CountryID does not occur exactly once in ram:PostalTradeAddress. The element is either missing or occurs more than once.

What the rule means

The country identifier specifies the country of the postal address. Exactly one element ensures that the country is stated unambiguously.

Please provide one country identifier for the delivery address

ram:CountryID is missing or occurs more than once in the postal address of the ultimate ship-to party. Having exactly one element resolves this issue.

What to do
  1. Locate the ram:PostalTradeAddress of the ultimate ship-to party.
  2. Check that it contains exactly one ram:CountryID.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

The test counts the direct ram:CountryID child elements of ram:PostalTradeAddress and requires the count to be 1.

Where the rule applies

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

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