Provide the buyer’s country in the 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 the buyer’s PostalTradeAddress or occurs more than once. Exactly one CountryID element must be present.

What the rule means

The buyer’s postal address must contain exactly one country identifier element.

Please provide exactly one country identifier in the buyer’s address

The buyer’s postal address is missing CountryID or contains it more than once. You can adjust the structure so that it contains exactly one such element.

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

Within PostalTradeAddress, the rule checks that exactly one direct CountryID element is present.

Where the rule applies

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

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