Provide the legal organization’s country identifier exactly once

Error FX-SCH-A-000824 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 legal organization’s postal address or occurs more than once. Exactly one ram:CountryID is required.

What the rule means

ram:CountryID identifies the country of the postal address of the recipient’s legal organization.

Please provide the legal organization’s country exactly once

The country identifier is missing from the legal organization’s postal address at the ship-to location or has been entered more than once. Make sure exactly one ram:CountryID is present.

What to do
  1. Locate the postal address in ram:SpecifiedLegalOrganization for the party at the ship-to address.
  2. Make sure the postal address 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 child elements ram:CountryID in the postal address of ram:SpecifiedLegalOrganization and requires exactly one occurrence.

Where the rule applies

The rule applies to the postal address in ram:SpecifiedLegalOrganization of the party at the ship-to address.

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