S

Knowledge Pack Files

SEPA Direct Debit & DATEV Export Skill Pack Files

Browse the source files that power the SEPA Direct Debit & DATEV Export MCP server knowledge pack.

Available free v1.0.0
$ sidebutton install sepa-datev
Download ZIP
sepa-direct-debit/_skill.md
20.8 KB

SEPA Direct Debit — pain.008 & Mandate Rules

Overview

The format layer of SEPA direct-debit QA: the pain.008 message and its character rules, the mandate lifecycle and sequence types, collection timing, CORE vs B2B, R-transaction reason codes, and IBAN/Creditor-Identifier validation. It exists so a QA report can say which field is wrong and which rule it violates — with the EPC index number — rather than "the button did not error".

The operational layer — failure taxonomy, synthetic fixture matrix, and the run-them-all validation heuristics — lives in this pack's root; the accounting-export half is datev-extf. Version pinning matters here: a rule from the wrong scheme or the wrong year gives money-path QA false confidence, which is worse than no module.

Specification Sources — Pinned

Version pinning matters here: a rule from the wrong scheme or the wrong year gives money-path QA false confidence, which is worse than no module. All retrieved and text-extracted 2026-08-08.

DocumentID / versionEffectiveWhat it governs
SDD Core Scheme RulebookEPC016-06, 2025 v1.105 Oct 2025Timing, mandate rules, refund rights
SDD Core Customer-to-PSP Implementation GuidelinesEPC130-08, 2025 v1.005 Oct 2025The pain.008 file a creditor sends its bank
SDD B2B RulebookEPC222-07, 2025 v1.105 Oct 2025B2B scheme differences
SDD B2B Customer-to-PSP IGEPC131-08, 2023 v1.117 Mar 2024B2B message mapping
Clarification Paper, SDD Core & B2BEPC132-17Edge-case readings

Message version: pain.008.001.08. The Core IG states it implements the 2019 ISO 20022 message version; the B2B IG maps the same Customer Direct Debit Initiation V08. A club still emitting pain.008.001.02 is on the pre-2023-migration version — flag it, do not assume the bank still accepts it.

EPC135-18 "Guidance on Reason Codes" covers SCT (credit transfers), not direct debits. It is easy to find and easy to cite by mistake. Use the SDD IG for direct-debit reason codes.

pain.008 — Direct Debit Initiation

Three nested levels. Getting the level right is most of the job — a field checked at the wrong level is the most common false bug report.

Document
└── CstmrDrctDbtInitn
    ├── GrpHdr                     ← once per file: who sent it, when, how many, total
    └── PmtInf  (1..n)             ← one per (sequence type × due date × creditor account)
        ├── creditor + collection date + sequence type
        └── DrctDbtTxInf  (1..n)   ← one per member being collected from
            └── DrctDbtTx → MndtRltdInf   ← the mandate data

Element index, with cardinality, the Rulebook attribute it carries, and the EPC usage rule. Taken from EPC130-08 (index numbers are the IG's own):

IG §Card.XML tagLevelATRule / note
1.11..1MsgIdGrpHdrSender's unique file id
1.21..1CreDtTmGrpHdrFile creation timestamp
1.41..1NbOfTxsGrpHdrMust equal the actual transaction count
1.51..1CtrlSumGrpHdrMandatory in SEPA (optional in base ISO). Must equal the sum of InstdAmt
2.11..1PmtInfIdPmtInf
2.21..1PmtMtdPmtInfDD
2.30..1BtchBookgPmtInftrue ⇒ the bank books one aggregate entry (German banking UIs: Mengenbuchung)
2.41..1NbOfTxsPmtInfMandatory, and separate from 1.4. Count within this PmtInf block
2.51..1CtrlSumPmtInfMandatory, and separate from 1.5. Sum within this PmtInf block
2.141..1SeqTpPmtInfAT-M006Mandatory. FRST / RCUR / OOFF / FNAL
2.181..1ReqdColltnDtPmtInfAT-T013Due date (German banking UIs: Einzugsdatum)
2.680..1ChrgBrPmtInfOnly SLEV is allowed
2.710..1CdtrSchmeIdPmtInfCreditor Identifier (Gläubiger-ID). IG recommends all transactions within one PmtInf block share it, and requires it at either PmtInf or DrctDbtTxInf level (2.133) — so absence here is not a defect if it is present per transaction
2.841..1EndToEndIdDrctDbtTxInfAT-T015Reference returned unchanged on an R-transaction — the join key for reconciliation
2.981..1InstdAmtDrctDbtTxInfAT-T002Only EUR; SEPA inclusive range 0.01 .. 999999999.99 — a 0.00 or negative amount is invalid
2.1021..1MndtIdMndtRltdInfAT-M001Mandatory. Length 1..35
2.1031..1DtOfSgntrMndtRltdInfAT-M008Mandatory. Mandate signature date
2.1040..1AmdmntIndMndtRltdInftrueAmdmntInfDtls becomes mandatory
2.2060..1RmtInfDrctDbtTxInfAT-T012Remittance information. Either Strd or Ustrd may be present
2.2070..1UstrdRmtInfUnstructured remittance info shown to the debtor; only one occurrence allowed. (AT-E001 is the Creditor's name, not this element — 2.207 only references it when a trade name differs from the legal name)

The character set — the rule most often broken

The XML is UTF-8, but SEPA only guarantees support for this Latin subset:

a–z  A–Z  0–9  /  -  ?  :  (  )  .  ,  '  +  and space

And references, identifications and identifiers (MsgId, PmtInfId, EndToEndId, MndtId) carry three extra constraints: restricted to that set, must not begin or end with /, and must not contain //.

German member names contain ä ö ü ß, and ß's capital plus imported names carry more. This is not theoretical: membership-software changelogs are full of fixes sanitising and ą after an XML-Fehler beim Bank-Upload. Transliteration (ä→ae, ß→ss) in names is acceptable and normal; an un-transliterated character in a reference field is a defect.

Mandate Lifecycle

A mandate (SEPA-Lastschriftmandat) is the debtor's standing authorisation. Its identity is the pair MndtId + CdtrSchmeId — the creditor's own reference plus the Gläubiger-ID.

Sequence types (SeqTp, AT-M006):

CodeMeaningWhen
FRSTFirstFirst collection of a recurring series
RCURRecurrentEvery subsequent collection
OOFFOne-offA single collection; the mandate is spent afterwards and must not be reused
FNALFinalLast collection of a series

FRST is no longer mandatory. Rulebook v9.0 (approved 11 Dec 2014, effective November 2016) allows a first collection to be sent as RCUR. So:

  • RCUR on a first-ever collection is correct, not a bug.
  • FRSTRCUR is correct.
  • RCURFRST on the same mandate is a defect only on an unamended mandate. IG 2.14 carves out the amendment case explicitly: if AmdmntInd is true and OrgnlDbtrAcct is set to SMNDA, the element "indicates either FRST, RCUR, FNAL or OOFF (all four codes allowed, no restrictions)". Check AmdmntInd before reporting a sequence-type regression — this is amendment territory (fixture 7 in the pack root's matrix), and reporting it blind is a false positive.
  • OOFF used twice on one mandate is a defect.
  • After FNAL, further collections on that mandate are a defect.

Amendments. Set AmdmntInd = true and supply AmdmntInfDtls, using the element that matches what changed — the IG makes each conditional on that specific change:

ChangedIG §ElementIG rule
Mandate reference2.106OrgnlMndtIdMandatory if MndtId changed, otherwise must not be used
Creditor identity / Gläubiger-ID2.107OrgnlCdtrSchmeIdMandatory if CdtrSchmeId and/or Name changed, otherwise not to be used
Debtor's account, same PSP2.120OrgnlDbtrAcctThe old IBAN is allowed in this case
Debtor's account at a new PSP2.120OrgnlDbtrAcct = SMNDAOthr/Id = SMNDA (Same Mandate with a New Debtor Account)

OrgnlDbtrAgt is a trap in pain.008.001.08. IG 2.121 states it is "not to be used if element 'Original Debtor Account' is populated with SMNDA" — so a change of debtor bank is signalled through OrgnlDbtrAcct/SMNDA (2.120), not by populating OrgnlDbtrAgt. Putting the new bank in OrgnlDbtrAgt is the older pain.008.001.02 habit and is now prohibited in the SMNDA case. Score a "new bank" amendment against 2.120, never against 2.121.

A creditor that silently issues a new mandate instead of amending an existing one loses the mandate's history — a real defect that no syntax validator catches.

36-month dormancy. If no collection is presented under a mandate for 36 months (counted from the last collection), the mandate expires and the creditor must cancel it. Collecting under a dormant mandate invites reason code MD01 (NoMandate). Seasonal clubs — a sports Verein whose members pause — are exactly the population this rule bites.

Gläubiger-ID (Creditor Identifier). 18 characters for Germany:

DE 98 ZZZ 09999999999
│  │  │   └── 11-char national identifier (issued by the Bundesbank)
│  │  └────── 3-char business code (Geschäftsbereichskennung), freely chosen by the creditor
│  └───────── 2 check digits
└──────────── country code

Check digits validate with the same MOD-97-10 as an IBAN over *(national identifier + country code

  • check digits)*. The 3-char business code is excluded from the calculation — verified empirically: swapping ZZZABC001 leaves the identifier valid. Consequence for QA: a club can run several business codes off one Gläubiger-ID, and a mutated business code will not be caught by a check-digit validator.

Collection Timing & Pre-Notification

From the Core Rulebook (EPC016-06 2025 v1.1):

RuleValue
Pre-notification to the debtorAt the latest 14 calendar days before the due date, unless the creditor and debtor agreed another timeline
Presentation to the creditor's bankUp to D-1 inter-bank business day before the due date — for all sequence types since the November 2016 rulebook
Unconditional refund ("no questions asked")8 weeks from the debit date
Claim for an unauthorised collectionUp to 13 months after the debit date

A pre-notification is any advance notice naming the amount and the due date — an invoice e-mail qualifies. The 14-day rule is a compliance obligation with no technical enforcement: nothing in the XML encodes it, no bank rejects a file for breaching it, and debtors complain instead. If the product under test lets the invoice-send date and the collection date be set less than 14 days apart without a warning, that is a legitimate finding even though every file validates.

The D-5 lead time for FRST that older material still describes was abolished in November 2016. Do not report a FRST sent at D-1 as a defect.

CORE vs B2B

CORE (pain.008, SDD Core)B2B (SDD B2B)
DebtorAnyone, including consumersMust not be a consumer — the debtor's bank is obliged to ensure this
Refund for an authorised collection8 weeks, no questions askedNone. The rulebook states the debtor has no right to obtain a refund for an authorised transaction
Debtor bank checks the mandateNoYes — obliged to check mandate status before paying

A Verein billing private members is a CORE scheme user. B2B is relevant only for corporate sponsors or facility renters. Applying a B2B assumption (no refund) to a consumer collection is a serious error — the 8-week right stands.

Bank Statement Reconciliation

Many German membership and club products reconcile payments from a plain CSV exported from the organisation's own online banking, matching an invoice number found in the Verwendungszweck (remittance text). If the product under test works this way, the CSV path is cheaper to break than the XML path, and it deserves its own fixtures:

  • The CSV has no schema. Column naming (Betrag, Umsatz, …), ordering, encoding, decimal comma, and date format all vary between German banks — build fixtures from several banks' export dialects, not one.
  • Free-text Verwendungszweck matching fails when a bank truncates the field, when a payer edits a transfer reference, or when two invoice numbers appear in one line.
  • A returned debit (Rücklastschrift) in the statement must reopen or hold the invoice and carry the return fee — verify the product's documented behaviour rather than assuming either.

Background — camt, if the product ever adopts it. camt.053 is the end-of-day statement; camt.054 is a debit/credit notification. Both nest Stmt/Ntry (booked entry) → NtryDtlsTxDtls (individual transaction), where a return carries the original EndToEndId plus a reason code — which is why EndToEndId is the reconciliation join key. MT940 is the older flat-file equivalent.

R-Transactions

An R-transaction is any collection that does not complete normally. Ordered by when they surface:

TypeWho raises itWhenEffect
RejectCreditor bank, CSM, or debtor bankBefore settlementNever settles
RefusalDebtorBefore settlementDebtor bank rejects the collection
ReturnDebtor bankAfter settlement, within 5 inter-bank business daysFunds reversed
RefundDebtorWithin 8 weeks (13 months if unauthorised)Funds returned to debtor
ReversalCreditorAfter settlementCreditor voluntarily repays a collection it should not have made
Revocation / Request for cancellationCreditorBefore settlementCreditor withdraws the collection

Reason codes, verified against the SDD Core IG (EPC130-08). This is the SDD list — not the SCT list:

CodeISO nameReading
AC01IncorrectAccountNumberAccount identifier wrong
AC04ClosedAccountNumberAccount closed
AC06BlockedAccountAccount blocked
AG01TransactionForbiddenDirect debit not permitted on this account
AG02InvalidBankOperationCodeOperation/transaction code invalid
AM04InsufficientFundsThe ordinary one. Not a software defect
AM05DuplicationDuplicate entry — a real billing-run bug: the same collection went out twice
BE01InconsistentWithEndCustomerDebtor's name does not match the account holder's name. The classic membership-billing cases: a minor billed through a guardian, or a family/group account where the payer owns the account but a managed member's name was sent
BE05UnrecognisedInitiatingPartyCreditor identifier wrong — check CdtrSchmeId
CNOR / DNORCreditorBankIsNotRegistered / DebtorBankIsNotRegisteredThe creditor's or debtor's PSP is not registered under this scheme
FF01InvalidFileFormatFormat defect
MD01NoMandateNo valid mandate — dormancy, wrong MndtId, or a revoked mandate
MD02MissingMandatoryInfomationInMandateMandate data missing or wrong
MD07EndCustomerDeceasedDebtor deceased
MS02NotSpecifiedReasonCustomerGeneratedRefusal by the Debtor — the member actively refused the collection. Not "no reason given"; this is an actionable member event, not noise
MS03NotSpecifiedReasonAgentGeneratedReason not specified (agent-generated)
RC01BankIdentifierIncorrectBank identifier invalid
RR01RR03MissingDebtorAccountOrIdentification / MissingDebtorNameOrAddress / MissingCreditorNameOrAddressThe specific missing-data regulatory reasons
RR04RegulatoryReasonGeneric regulatory reason — not a missing-field code
SL01SpecificServiceOfferedByDebtorAgentDebtor's bank service, e.g. a debit block or a whitelist

MD02's ISO name really is spelled MissingMandatoryInfomationInMandate — missing the r. A validator matching on the name string must use the spec's spelling.

MD06 (refund requested by the end customer) is not in the customer-to-PSP list; it belongs to the inter-bank refund space. Its absence from a pain.008 file is correct.

Triage rule: AM04, MD07 and MS02 are the member's world — insufficient funds, a death, and a deliberate refusal respectively. AM05, BE01, BE05, MD01, MD02 and FF01 point at the billing run and deserve a ticket.

Scope note: the EPC130-08 table this list is drawn from enumerates the reasons for a Reject by the Creditor PSP, the Debtor PSP or the CSM. Returns, refunds and refusals reuse the same code values but are governed by the Rulebook and the inter-PSP guidance — for the SDD R-transaction guidance proper, the document is EPC173-14, not the SCT paper named in gotcha 12.

IBAN & BIC Validation

MOD-97-10 (ISO 7064) — verified locally against published example IBANs:

  1. Move the first four characters to the end.
  2. Replace each letter with two digits, A=10 … Z=35.
  3. Interpret as an integer. Valid iff the remainder mod 97 equals 1.

German IBANs are 22 characters: DE + 2 check digits + 8-digit BLZ + 10-digit account number, left-padded with zeros.

Verified locally: this catches a changed digit, a transposition of two different digits, and any length error. It does not catch a transposition of two identical digits, and it does not tell you the account exists.

BIC is not required for SEPA payments within the EEA — the "IBAN-only" rule, which comes from the SEPA Regulation (EU) 260/2012, not from the EPC scheme documents (national payments from February 2014, cross-border from February 2016). A missing CdtrAgt/DbtrAgt BIC is therefore not automatically a defect; check the bank's own requirement before reporting one. Where a BIC is present, the IG accepts either the 8- or the 11-character form.

One detail worth knowing when comparing creditor identifiers: the IG declares the Creditor Identifier data element case- and space-insensitive, so DE98ZZZ09999999999 and de98 zzz 099 999 999 99 are the same identifier. A validator that compares them as raw strings will report false mismatches.

Gotchas

  1. FRST is not required. The commonest false positive in SEPA QA. RCUR on a first collection has been valid since November 2016.
  2. CtrlSum is mandatory in SEPA though optional in base ISO 20022 — generic XML tooling will not flag its absence.
  3. Umlauts are fine in names, fatal in references. Different rules for different fields — and Belegfeld 1 on the DATEV side (datev-extf) is stricter still: no spaces, no dots.
  4. The Creditor-Identifier business code is not check-digit protected. Corruption there passes every validator.
  5. The 14-day pre-notification has no technical enforcement. It will never fail a file.
  6. Don't cite the SCT reason-code guidance (EPC135-18) for direct debits.
  7. B2B has no refund right; CORE has 8 weeks. Never carry a B2B assumption into a consumer collection.
  8. Most German membership products import bank statements as CSV, not camt. Test the dialect problem before the ISO one — see Bank Statement Reconciliation.

References

Specifications retrieved and text-extracted 2026-08-08. EPC documents are copyrighted — this module describes and cites them; it reproduces no specification text.

SourceReference
SDD Core Scheme RulebookEPC016-06, 2025 v1.1, effective 05 Oct 2025
SDD Core Customer-to-PSP Implementation GuidelinesEPC130-08, 2025 v1.0, effective 05 Oct 2025
SDD B2B Scheme RulebookEPC222-07, 2025 v1.1, effective 05 Oct 2025
SDD B2B Customer-to-PSP Implementation GuidelinesEPC131-08, 2023 v1.1, effective 17 Mar 2024
Clarification Paper on SDD Core and B2B RulebooksEPC132-17
European Payments Councilhttps://www.europeanpaymentscouncil.eu
SEPA Regulation (EU) 260/2012The "IBAN-only" rule — a regulation, not an EPC document
ISO 7064 MOD-97-10Verified locally against published example IBANs