Country in the shipping party address

Error FX-SCH-A-000803 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 ram:PostalTradeAddress or occurs more than once. It must occur exactly once.

What the rule means

ram:CountryID identifies the country of the shipping party’s postal address. Exactly one country element is required so the address specifies one country unambiguously.

Please include the shipping party’s country exactly once

The shipping party’s postal address does not contain exactly one ram:CountryID. Add the missing element or remove a duplicate.

What to do
  1. Check ram:PostalTradeAddress of ram:ShipFromTradeParty.
  2. Make sure ram:CountryID occurs exactly once in it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID/>
</ram:PostalTradeAddress>
Technical details

The check counts direct ram:CountryID elements inside ram:PostalTradeAddress and requires the count to be 1.

Where the rule applies

The rule applies to ram:PostalTradeAddress of ram:ShipFromTradeParty.

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