Country identifier in the buyer organization’s address

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

What the rule means

The buyer organization’s address must contain exactly one country identifier.

Please include the buyer organization’s country identifier exactly once

The buyer organization’s address is missing ram:CountryID or contains it more than once. You can adjust the address so the element occurs exactly once.

What to do
  1. Check ram:PostalTradeAddress in the buyer’s ram:SpecifiedLegalOrganization.
  2. Make sure ram:CountryID occurs there exactly once.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:PostalTradeAddress/>
✓ Correct
<ram:PostalTradeAddress>
  <ram:CountryID>XX</ram:CountryID>
</ram:PostalTradeAddress>
Technical details

The XPath counts direct ram:CountryID elements in the current ram:PostalTradeAddress and requires the count to be 1.

Where the rule applies

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

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