Provide the country for the seller's postal address

Error FX-SCH-A-001048 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 does not occur exactly once in ram:PostalTradeAddress. The element is either missing or appears more than once.

What the rule means

The country is a required part of this postal address. Without exactly one country entry, the address is not fully structured at this point.

Please provide the country for the seller's postal address exactly once

The country entry is missing from the seller's postal address or appears more than once. Exactly one ram:CountryID provides the required country entry here.

What to do
  1. Locate the seller's ram:PostalTradeAddress for the item.
  2. Make sure it contains exactly one ram:CountryID.
  3. 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

The test counts the direct ram:CountryID elements within ram:PostalTradeAddress and requires exactly one.

Where the rule applies

The rule applies to the postal address of the seller of an item in an invoice line.

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