At most one referenced document for the advance payment

Error FX-SCH-A-000326 Factur-X

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

ram:InvoiceSpecifiedReferencedDocument occurs more than once under ram:SpecifiedAdvancePayment. In this context, this element is allowed no more than once.

What the rule means

The advance payment can contain at most one referenced document. Multiple references are not provided for in this structure.

Please use no more than one referenced document for the advance payment

The advance payment contains multiple ram:InvoiceSpecifiedReferencedDocument elements. Only one such element is provided for here, and you can adjust the XML accordingly.

What to do
  1. Find the ram:InvoiceSpecifiedReferencedDocument elements under ram:SpecifiedAdvancePayment.
  2. Remove the excess reference elements so that no more than one remains.
  3. Regenerate the invoice and check it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedAdvancePayment>
  <ram:InvoiceSpecifiedReferencedDocument/>
  <ram:InvoiceSpecifiedReferencedDocument/>
</ram:SpecifiedAdvancePayment>
✓ Correct
<ram:SpecifiedAdvancePayment>
  <ram:InvoiceSpecifiedReferencedDocument/>
</ram:SpecifiedAdvancePayment>
Technical details

The check counts the ram:InvoiceSpecifiedReferencedDocument elements under ram:SpecifiedAdvancePayment and requires the count to be no greater than one.

Where the rule applies

The rule applies to ram:SpecifiedAdvancePayment within the invoice settlement.

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