Country entry in the legal organization’s postal address

Error FX-SCH-A-000662 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 must occur exactly once in ram:PostalTradeAddress. The element is either missing or appears more than once.

What the rule means

ram:CountryID identifies the country of the postal address and is required to assign that address unambiguously.

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

The legal organization’s postal address has no ram:CountryID or has more than one. This element must appear exactly once.

What to do
  1. Locate the postal address under ram:SpecifiedLegalOrganization.
  2. Ensure that ram:PostalTradeAddress 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>XX</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

The test counts the direct child elements ram:CountryID of ram:PostalTradeAddress and requires exactly one.

Where the rule applies

The rule applies to ram:PostalTradeAddress within ram:SpecifiedLegalOrganization of the buyer agent.

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