Exactly one country identifier for the buyer address

Error FX-SCH-A-000422 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. It must appear there exactly once.

What the rule means

The rule requires exactly one country identifier in the buyer’s postal address so that the country of that address is specified unambiguously.

Please provide exactly one country identifier for the buyer address

CountryID is missing from the buyer’s postal address or appears more than once. The rule requires exactly one such element.

What to do
  1. Locate PostalTradeAddress in the BuyerTradeParty section.
  2. Check how many times CountryID occurs inside it.
  3. Ensure that CountryID appears exactly once.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

Within PostalTradeAddress, the number of direct CountryID elements is checked; the required count is one.

Where the rule applies

The rule applies to the buyer’s postal address PostalTradeAddress.

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