Build a SEPA Direct Debit pain.008 XML
Skill: Convert collection instructions into a pain.008 SEPA Direct Debit initiation XML
Region: Global (SEPA / ISO 20022 standard)
Category: Payments — ISO 20022 pain.008 Customer Direct Debit Initiation (SEPA SDD Core / B2B)
Does: Takes a batch of direct-debit collections (CSV / JSON / pasted rows) and produces an ISO 20022 pain.008.001.08 CustomerDirectDebitInitiation XML for the SEPA SDD Core (or B2B) scheme — creditor identifier, mandate data, FRST/RCUR/OOFF/FNAL sequence types, due dates and pre-notification rules.
Schema version: ISO 20022 pain.008.001.08 (SEPA SDD Core & B2B 2023 rulebooks)
The AI assembles the collection file; it does not debit anyone. SEPA SDD requires a valid signed mandate per debtor and lawful pre-notification (default 14 calendar days, can be shortened by agreement). Confirm the schema variant, scheme (Core vs B2B), and your bank's submission deadlines before upload.
When this applies
- SEPA SDD Core — recurring/one-off euro collections from consumer or business debtors (8-week no-questions refund right).
- SEPA SDD B2B — collections from business debtors only; no refund right; debtor bank verifies the mandate.
- Subscription / utility / membership billing uploaded to a corporate banking channel.
Collection procedure
- Read the source — CSV/JSON/pasted rows, one per collection: debtor name, debtor IBAN, amount, mandate ID, mandate signature date, and the sequence type.
- Extract the creditor once — name, IBAN, BIC, the Creditor Identifier (CI), and the requested collection (due) date for the batch.
- Group into Payment Information blocks — one
<PmtInf>per (sequence type + due date + scheme). SEPA requires separate<PmtInf>blocks forFRSTvsRCURvsOOFFvsFNAL. - Normalize — IBANs uppercased/de-spaced; amounts 2 decimals; dates
YYYY-MM-DD; sequence type uppercase enum. - Compute control sums — group and per-
PmtInfNbOfTxs/CtrlSumas for pain.001. - Emit the output — one
<CstmrDrctDbtInitn>document from the worked example. - Validate — work through the checklist.
Source → pain.008 field map
| From the source | → Target element |
|---|---|
| Message ID (you assign) | GrpHdr/MsgId |
| Creation timestamp | GrpHdr/CreDtTm |
| Total count / sum | GrpHdr/NbOfTxs, GrpHdr/CtrlSum |
| Batch reference | PmtInf/PmtInfId |
Payment method (always DD) |
PmtInf/PmtMtd |
Scheme (CORE / B2B) |
PmtInf/PmtTpInf/LclInstrm/Cd |
| Sequence type | PmtInf/PmtTpInf/SeqTp |
| Requested collection date | PmtInf/ReqdColltnDt |
| Creditor name / IBAN / BIC | Cdtr/Nm, CdtrAcct/Id/IBAN, CdtrAgt/FinInstnId/BICFI |
| Creditor Identifier (CI) | CdtrSchmeId/Id/PrvtId/Othr/Id (SchmeNm/Prtry = SEPA) |
| Per-collection reference | DrctDbtTxInf/PmtId/EndToEndId |
| Amount | InstdAmt (Ccy="EUR") |
| Mandate ID | MndtRltdInf/MndtId |
| Mandate signature date | MndtRltdInf/DtOfSgntr |
| Debtor name / IBAN | Dbtr/Nm, DbtrAcct/Id/IBAN |
| Remittance information | RmtInf/Ustrd |
Document structure
Document
└── CstmrDrctDbtInitn
├── GrpHdr (MsgId, CreDtTm, NbOfTxs, CtrlSum, InitgPty)
└── PmtInf ... (one per sequence type + due date)
├── PmtInfId, PmtMtd (DD), NbOfTxs, CtrlSum
├── PmtTpInf/SvcLvl/Cd (SEPA), LclInstrm/Cd (CORE|B2B), SeqTp
├── ReqdColltnDt
├── Cdtr / CdtrAcct / CdtrAgt
├── ChrgBr (SLEV)
├── CdtrSchmeId (Creditor Identifier)
└── DrctDbtTxInf ...
├── PmtId/EndToEndId
├── InstdAmt
├── DrctDbtTx/MndtRltdInf (MndtId, DtOfSgntr)
├── DbtrAgt
├── Dbtr / DbtrAcct
└── RmtInf/Ustrd
Code tables
Sequence type (SeqTp)
| Code | Meaning |
|---|---|
FRST |
First collection of a recurring series |
RCUR |
Subsequent recurring collection |
OOFF |
One-off (single) collection |
FNAL |
Final collection of a series |
Note: under the 2017+ rulebook
FRSTandRCURmay be merged operationally, but generating distinct values remains valid; keep them in separate<PmtInf>blocks.
Local instrument (LclInstrm/Cd)
| Code | Scheme |
|---|---|
CORE |
SEPA Direct Debit Core |
B2B |
SEPA Direct Debit Business-to-Business |
Calculation rules
CtrlSum(group and per-PmtInf) = ΣInstdAmt, 2 decimals;NbOfTxsexact counts.- All amounts in
EUR. ReqdColltnDtmust respect scheme lead times from the submission date (Core D-1 for FRST/OOFF and recurring under the unified timeline; B2B D-1 business day — confirm current rulebook).- Pre-notification to the debtor at least 14 calendar days before
ReqdColltnDtunless a shorter period was agreed.
Worked example (end-to-end)
Input — collection batch (JSON)
[
{"debtor": "Jane Doe", "iban": "DE75512108001245126199", "amount": 29.99, "mandate": "MND-1001", "signed": "2025-01-10", "seq": "RCUR", "ref": "SUB-2026-06-0001"},
{"debtor": "John Roe", "iban": "NL02ABNA0123456789", "amount": 29.99, "mandate": "MND-1002", "signed": "2026-05-02", "seq": "RCUR", "ref": "SUB-2026-06-0002"}
]
Creditor: StreamCo GmbH, IBAN DE21500500009876543210, BIC MARKDEF1100, CI DE98ZZZ09999999999, collect 2026-06-20.
Output — pain.008.001.08 XML
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.08">
<CstmrDrctDbtInitn>
<GrpHdr>
<MsgId>STRM-20260612-0001</MsgId>
<CreDtTm>2026-06-12T10:00:00</CreDtTm>
<NbOfTxs>2</NbOfTxs>
<CtrlSum>59.98</CtrlSum>
<InitgPty>
<Nm>StreamCo GmbH</Nm>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId>STRM-RCUR-20260620</PmtInfId>
<PmtMtd>DD</PmtMtd>
<NbOfTxs>2</NbOfTxs>
<CtrlSum>59.98</CtrlSum>
<PmtTpInf>
<SvcLvl>
<Cd>SEPA</Cd>
</SvcLvl>
<LclInstrm>
<Cd>CORE</Cd>
</LclInstrm>
<SeqTp>RCUR</SeqTp>
</PmtTpInf>
<ReqdColltnDt>2026-06-20</ReqdColltnDt>
<Cdtr>
<Nm>StreamCo GmbH</Nm>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN>DE21500500009876543210</IBAN>
</Id>
</CdtrAcct>
<CdtrAgt>
<FinInstnId>
<BICFI>MARKDEF1100</BICFI>
</FinInstnId>
</CdtrAgt>
<ChrgBr>SLEV</ChrgBr>
<CdtrSchmeId>
<Id>
<PrvtId>
<Othr>
<Id>DE98ZZZ09999999999</Id>
<SchmeNm>
<Prtry>SEPA</Prtry>
</SchmeNm>
</Othr>
</PrvtId>
</Id>
</CdtrSchmeId>
<DrctDbtTxInf>
<PmtId>
<EndToEndId>SUB-2026-06-0001</EndToEndId>
</PmtId>
<InstdAmt Ccy="EUR">29.99</InstdAmt>
<DrctDbtTx>
<MndtRltdInf>
<MndtId>MND-1001</MndtId>
<DtOfSgntr>2025-01-10</DtOfSgntr>
</MndtRltdInf>
</DrctDbtTx>
<DbtrAgt>
<FinInstnId/>
</DbtrAgt>
<Dbtr>
<Nm>Jane Doe</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>DE75512108001245126199</IBAN>
</Id>
</DbtrAcct>
<RmtInf>
<Ustrd>Subscription June 2026</Ustrd>
</RmtInf>
</DrctDbtTxInf>
<DrctDbtTxInf>
<PmtId>
<EndToEndId>SUB-2026-06-0002</EndToEndId>
</PmtId>
<InstdAmt Ccy="EUR">29.99</InstdAmt>
<DrctDbtTx>
<MndtRltdInf>
<MndtId>MND-1002</MndtId>
<DtOfSgntr>2026-05-02</DtOfSgntr>
</MndtRltdInf>
</DrctDbtTx>
<DbtrAgt>
<FinInstnId/>
</DbtrAgt>
<Dbtr>
<Nm>John Roe</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>NL02ABNA0123456789</IBAN>
</Id>
</DbtrAcct>
<RmtInf>
<Ustrd>Subscription June 2026</Ustrd>
</RmtInf>
</DrctDbtTxInf>
</PmtInf>
</CstmrDrctDbtInitn>
</Document>
Normalization notes: amounts 29.99 kept to 2 decimals; CtrlSum 29.99 + 29.99 = 59.98; sequence type forced to a separate RCUR <PmtInf>.
Validation checklist
-
xmlnsmatches the exactpain.008version your bank accepts - One
<PmtInf>per sequence type (FRST/RCUR/OOFF/FNAL) -
LclInstrm/Cdmatches the scheme (COREvsB2B) on every mandate - Creditor Identifier present, well-formed,
SchmeNm/Prtry=SEPA - Each collection carries
MndtId+DtOfSgntrfrom a valid signed mandate -
NbOfTxs/CtrlSumreconcile at group andPmtInflevel -
ReqdColltnDtrespects scheme lead time; debtor pre-notified - Validated against the official ISO 20022 XSD and bank guidelines
Last updated: 2026-06-12 — confirm the active pain.008 version, SEPA SDD Core/B2B rulebook lead times, and your bank's submission cut-offs before use.