The end user’s address must contain exactly one country

Error FX-SCH-A-000722 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. The address must contain exactly one country.

What the rule means

ram:CountryID identifies the country of the legal organization’s postal address. Exactly one country designation is required for this address.

Please provide exactly one country in the legal organization’s address

The postal address of the end user’s legal organization is missing a country designation or contains it more than once. The address must contain exactly one ram:CountryID.

What to do
  1. Locate ram:PostalTradeAddress in ram:SpecifiedLegalOrganization under ProductEndUserTradeParty.
  2. Check that the address contains exactly one ram:CountryID.
  3. Regenerate the invoice 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 check counts the ram:CountryID elements in ram:PostalTradeAddress and requires exactly one.

Where the rule applies

The rule applies to the postal address of the end user’s legal organization in ram:SpecifiedLegalOrganization.

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