Exactly one country identifier for the buyer agent’s postal address

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

The buyer agent’s ram:PostalTradeAddress does not contain exactly one ram:CountryID: the element is missing or occurs more than once.

What the rule means

A postal address requires exactly one country identifier in this context so that its country is specified unambiguously.

Please provide exactly one country identifier for the buyer agent’s postal address

The buyer agent’s postal address is missing ram:CountryID or contains it more than once. Exactly one element meets the requirement for this address.

What to do
  1. Check ram:PostalTradeAddress for the buyer agent.
  2. Make sure it contains exactly one ram:CountryID element.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID/>
</ram:PostalTradeAddress>
Technical details

The XPath counts direct ram:CountryID elements under ram:PostalTradeAddress and requires exactly one.

Where the rule applies

The rule applies to ram:CountryID within the buyer agent’s ram:PostalTradeAddress postal address.

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