Specify exactly one buyer

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

Within ram:ApplicableHeaderTradeAgreement, ram:BuyerTradeParty does not occur exactly once. The buyer element is missing or appears more than once.

What the rule means

The trade agreement must identify exactly one buyer so that the buyer party is unambiguous.

Please include exactly one buyer

The buyer is missing from the trade agreement, or ram:BuyerTradeParty appears more than once. You can make the information unambiguous by having the element occur there exactly once.

What to do
  1. Find ram:BuyerTradeParty in ram:ApplicableHeaderTradeAgreement.
  2. Add the element if it is missing, or remove duplicates so that it occurs exactly once.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ApplicableHeaderTradeAgreement/>
✓ Correct
<ram:ApplicableHeaderTradeAgreement>
  <ram:BuyerTradeParty/>
</ram:ApplicableHeaderTradeAgreement>
Technical details

The XPath test counts the direct child elements ram:BuyerTradeParty and requires the count to be 1.

Where the rule applies

The rule applies within ram:ApplicableHeaderTradeAgreement of the header trade agreement.

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