Buyer organization country identifier must occur once

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 ram:PostalTradeAddress or occurs more than once. It must be present exactly once.

What the rule means

The country identifier specifies the country of the postal address. Exactly one element ensures that this address detail is present unambiguously.

Please provide the buyer organization’s country identifier exactly once

The country identifier is missing from the buyer legal organization’s postal address or is included more than once. Including exactly one ram:CountryID makes the information unambiguous.

What to do
  1. Locate ram:PostalTradeAddress for the buyer’s legal organization.
  2. Check whether ram:CountryID is missing or occurs more than once.
  3. Ensure that ram:CountryID is included exactly once.
  4. 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 XPath test checks that the number of direct ram:CountryID elements in ram:PostalTradeAddress is exactly one.

Where the rule applies

The rule applies to the postal address of the legal organization within the buyer party.

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