Provide the country code for the legal delivery organization

Error FX-SCH-A-000845 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 the postal address of ram:SpecifiedLegalOrganization, or the element occurs more than once. It must occur exactly once there.

What the rule means

The country code identifies the country of the legal delivery organization’s postal address.

Please provide the country code for the legal delivery organization exactly once

ram:CountryID is missing from the legal delivery organization’s postal address, or it has been entered more than once. You can correct the entry in that postal address.

What to do
  1. Open ram:PostalTradeAddress within ram:SpecifiedLegalOrganization of the final delivery party.
  2. Make sure that ram:CountryID occurs there exactly once.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

The test counts direct ram:CountryID elements within the relevant ram:PostalTradeAddress and requires the count to be 1.

Where the rule applies

The rule applies to the postal address within ram:SpecifiedLegalOrganization of the final delivery party.

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