Invoicee country

Error FX-SCH-A-000874 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

The invoicee’s address must contain exactly one country designation.

Please provide the country for the invoicee’s address

ram:CountryID is missing or appears more than once in the invoicee’s postal address. This element must be present exactly once.

What to do
  1. Locate ram:PostalTradeAddress for the invoicee.
  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 and requires exactly one occurrence.

Where the rule applies

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

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