Provide the country code for the final delivery address

Error FX-SCH-A-000841 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 is missing from the postal address of UltimateShipToTradeParty, or the element occurs more than once. It must occur exactly once there.

What the rule means

The country code identifies the country of the final delivery address.

Please provide the country code for the final delivery address exactly once

ram:CountryID is missing from the final delivery address, or it has been entered more than once. You can correct the entry in the delivery address.

What to do
  1. Open the postal address under UltimateShipToTradeParty.
  2. Make sure that ram:CountryID occurs there exactly once.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

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

Where the rule applies

The rule applies to the postal address in UltimateShipToTradeParty within the delivery details.

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