Payee may be specified only once

Error FX-SCH-A-000331 Factur-X

Element 'ram:PayeeTradeParty' may occur at maximum 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The ram:PayeeTradeParty element occurs more than once within the same ram:SpecifiedTradePaymentTerms.

What the rule means

The payment terms may contain no more than one payee entry.

Please enter the payee only once

The payment terms contain ram:PayeeTradeParty more than once. The payee may be entered there no more than once.

What to do
  1. Find all occurrences of ram:PayeeTradeParty in ram:SpecifiedTradePaymentTerms.
  2. Remove the extra occurrences so that no more than one remains.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradePaymentTerms>
  <ram:PayeeTradeParty/>
  <ram:PayeeTradeParty/>
</ram:SpecifiedTradePaymentTerms>
✓ Correct
<ram:SpecifiedTradePaymentTerms>
  <ram:PayeeTradeParty/>
</ram:SpecifiedTradePaymentTerms>
Technical details

The XPath counts direct ram:PayeeTradeParty elements within ram:SpecifiedTradePaymentTerms and requires the count to be at most one.

Where the rule applies

The rule applies to the ram:PayeeTradeParty element within ram:SpecifiedTradePaymentTerms.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradePaymentTerms
Test expression (assert/@test)
count(ram:PayeeTradeParty)<=1