Exactly one buyer address

Error FX-SCH-A-000419 Factur-X

Element 'ram:PostalTradeAddress' 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:BuyerTradeParty does not contain exactly one ram:PostalTradeAddress element: it is missing or occurs more than once.

What the rule means

The buyer record must contain exactly one postal address element.

Please provide exactly one postal address for the buyer

The buyer record is missing ram:PostalTradeAddress, or the element occurs more than once. The record must contain exactly one such element.

What to do
  1. Find ram:BuyerTradeParty.
  2. Ensure that it contains exactly one ram:PostalTradeAddress element.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:BuyerTradeParty/>
✓ Correct
<ram:BuyerTradeParty>
  <ram:PostalTradeAddress/>
</ram:BuyerTradeParty>
Technical details

Within ram:BuyerTradeParty, the rule checks that exactly one direct ram:PostalTradeAddress element is present.

Where the rule applies

The rule applies to ram:PostalTradeAddress within ram:BuyerTradeParty.

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