FinchContext
Run with

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


Collection procedure

  1. Read the source — CSV/JSON/pasted rows, one per collection: debtor name, debtor IBAN, amount, mandate ID, mandate signature date, and the sequence type.
  2. Extract the creditor once — name, IBAN, BIC, the Creditor Identifier (CI), and the requested collection (due) date for the batch.
  3. Group into Payment Information blocks — one <PmtInf> per (sequence type + due date + scheme). SEPA requires separate <PmtInf> blocks for FRST vs RCUR vs OOFF vs FNAL.
  4. Normalize — IBANs uppercased/de-spaced; amounts 2 decimals; dates YYYY-MM-DD; sequence type uppercase enum.
  5. Compute control sums — group and per-PmtInf NbOfTxs/CtrlSum as for pain.001.
  6. Emit the output — one <CstmrDrctDbtInitn> document from the worked example.
  7. 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 FRST and RCUR may 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


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


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.