# PEPPOL-EN16931-R061

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R061

> Mandate reference MUST be provided for direct debit.

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21, XRechnung 3.0 rules (UBL) 2.6.0
- Context: `cac:PaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(cbc:PaymentMeansCode) = $code]`
- Test: `cac:PaymentMandate/cbc:ID`

> Mandate reference MUST be provided for direct debit.

- Level: error
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `ram:SpecifiedTradeSettlementPaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(ram:TypeCode) = $code]`
- Test: `../ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID`

## Why it fails

- The payment means is a direct debit (code `49` or `59`), but there is no mandate reference in `cac:PaymentMandate/cbc:ID`.

## How to fix it

- Add the reference of the SEPA mandate the buyer signed.

Validate a document against these rules: https://xmlvalid.com/validate
