Country of the invoicee’s legal organization

Error FX-SCH-A-000878 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 ram:PostalTradeAddress of the invoicee’s legal organization or occurs more than once. It must occur exactly once.

What the rule means

The postal address of the invoicee’s legal organization must contain exactly one country designation.

Please provide the country of the invoicee’s legal organization

ram:CountryID is missing or appears more than once in the postal address of the invoicee’s legal organization. The element must occur exactly once.

What to do
  1. Locate ram:PostalTradeAddress in the invoicee’s ram:SpecifiedLegalOrganization.
  2. Make sure ram:CountryID occurs exactly once within it.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>...</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

The rule counts ram:CountryID within ram:PostalTradeAddress under ram:SpecifiedLegalOrganization and requires exactly one occurrence.

Where the rule applies

The rule applies to the postal address in the invoicee’s ram:SpecifiedLegalOrganization.

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