Include the country exactly once in the postal address

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

CountryID is missing from PostalTradeAddress or occurs more than once. Exactly one CountryID element must be present.

What the rule means

The country information assigns the postal address to a country. Exactly one element ensures that the country is identified unambiguously.

Please include the postal address country exactly once

The sales agent’s postal address is missing its country information, or includes it more than once. You can resolve this by having a single CountryID element.

What to do
  1. Open the sales agent’s PostalTradeAddress.
  2. Make sure it contains exactly one CountryID element.
  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

In the context of PostalTradeAddress, the rule checks that the number of direct CountryID elements is exactly one.

Where the rule applies

The rule applies to the sales agent’s postal address under SalesAgentTradeParty and checks PostalTradeAddress.

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