Include a country code in the organization’s address

Error FX-SCH-A-000686 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 is missing from ram:PostalTradeAddress or occurs more than once. It must occur exactly once.

What the rule means

ram:CountryID identifies the country of the postal address. The rule requires exactly one such country entry in the organization’s address.

Please include the country code in the organization’s address

ram:CountryID is missing or appears more than once in the buyer’s tax representative’s organization postal address. The address needs exactly one such element.

What to do
  1. Locate ram:PostalTradeAddress in the buyer’s tax representative’s ram:SpecifiedLegalOrganization.
  2. Ensure that 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 number of direct ram:CountryID elements in ram:PostalTradeAddress must be exactly one.

Where the rule applies

The rule applies to ram:PostalTradeAddress within ram:SpecifiedLegalOrganization for the buyer’s tax representative.

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