Exactly one country identifier in the manufacturer address

Error FX-SCH-A-001162 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 the element occurs more than once.

What the rule means

The manufacturer’s postal address must contain exactly one country identifier. Without exactly one country entry, the address does not follow the defined XML structure.

Please provide the manufacturer address’s country identifier exactly once

The country identifier is missing from the manufacturer’s postal address, or it appears more than once. Exactly one ram:CountryID meets this structural requirement.

What to do
  1. Locate the manufacturer’s ram:PostalTradeAddress.
  2. Make sure it contains exactly one ram:CountryID.
  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

Within ram:PostalTradeAddress, the check requires exactly one direct ram:CountryID element.

Where the rule applies

The rule applies to ram:CountryID in the postal address of the manufacturer of a product on an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedTradeProduct/ram:ManufacturerTradeParty/ram:PostalTradeAddress
Test expression (assert/@test)
count(ram:CountryID)=1