Provide the buyer exactly once

Error FX-SCH-A-000028 Factur-X

Element 'ram:BuyerTradeParty' 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

BuyerTradeParty is missing from ApplicableHeaderTradeAgreement or occurs there more than once. The element must occur exactly once.

What the rule means

The invoice must contain exactly one buyer so that the party being invoiced is clearly identified.

Please include the buyer exactly once in the invoice

The buyer information is missing or appears more than once. You can adjust the invoice so that BuyerTradeParty occurs exactly once.

What to do
  1. Check ApplicableHeaderTradeAgreement for BuyerTradeParty.
  2. Make sure the element is present exactly once.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:ApplicableHeaderTradeAgreement>
  <ram:BuyerTradeParty/>
  <ram:BuyerTradeParty/>
</ram:ApplicableHeaderTradeAgreement>
✓ Correct
<ram:ApplicableHeaderTradeAgreement>
  <ram:BuyerTradeParty/>
</ram:ApplicableHeaderTradeAgreement>
Technical details

The test counts BuyerTradeParty elements in the context and requires the count to equal 1.

Where the rule applies

The rule applies to the buyer information in ApplicableHeaderTradeAgreement.

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