Delivery terms require exactly one delivery type code

Error FX-SCH-A-001026 Factur-X

Element 'ram:DeliveryTypeCode' 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:DeliveryTypeCode does not occur exactly once in ram:ApplicableTradeDeliveryTerms. It is either missing or occurs more than once.

What the rule means

The delivery terms for an invoice line must contain exactly one code specifying the type of delivery.

Please provide exactly one delivery type code in the delivery terms

ram:DeliveryTypeCode is missing or appears more than once in the invoice line delivery terms. You can correct the number of elements in this location.

What to do
  1. Locate the affected ram:ApplicableTradeDeliveryTerms.
  2. Make sure it contains exactly one ram:DeliveryTypeCode.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeDeliveryTerms/>
✓ Correct
<ram:ApplicableTradeDeliveryTerms>
  <ram:DeliveryTypeCode/>
</ram:ApplicableTradeDeliveryTerms>
Technical details

The XPath test counts the direct ram:DeliveryTypeCode elements within ram:ApplicableTradeDeliveryTerms and requires a count of 1.

Where the rule applies

The rule applies within ram:ApplicableTradeDeliveryTerms in an invoice line agreement.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:ApplicableTradeDeliveryTerms
Test expression (assert/@test)
count(ram:DeliveryTypeCode)=1