Provide the country of the sales agent’s legal organization address

Error FX-SCH-A-000747 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

The ram:PostalTradeAddress under the sales agent’s ram:SpecifiedLegalOrganization does not contain exactly one ram:CountryID. The element is either missing or occurs more than once.

What the rule means

ram:CountryID specifies the country of the legal organization’s postal address. The rule requires exactly one country designation.

Please provide the country of the sales agent’s legal organization address

The postal address under the sales agent’s ram:SpecifiedLegalOrganization is missing ram:CountryID, or the element occurs more than once. You can resolve this by providing exactly one such element.

What to do
  1. Locate ram:PostalTradeAddress under the sales agent’s ram:SpecifiedLegalOrganization.
  2. Provide exactly one ram:CountryID element inside it.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

The check counts the ram:CountryID elements directly contained in ram:PostalTradeAddress and requires the count to be one.

Where the rule applies

In the postal address under ram:SpecifiedLegalOrganization for the sales agent.

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