Address country code required

Error FX-SCH-A-000662 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 postal address does not contain exactly one ram:CountryID element. The element must occur once in this context.

What the rule means

The country code is a required part of this postal address and must be stated exactly once.

Please include the country code exactly once in the buyer agent’s legal-organization address

The buyer agent’s legal-organization postal address is missing ram:CountryID, or the element occurs more than once. You can adjust the address so that it contains exactly one such element.

What to do
  1. Find ram:PostalTradeAddress in ram:SpecifiedLegalOrganization under ram:BuyerAgentTradeParty.
  2. Ensure that it contains exactly one ram:CountryID element.
  3. Generate the invoice again and validate it.
Technical details

The check verifies that ram:PostalTradeAddress contains exactly one direct ram:CountryID element.

Where the rule applies

Applies to ram:PostalTradeAddress in the buyer agent’s ram:SpecifiedLegalOrganization.

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