Create SEPA direct debit file (pain.008)
The service task "Create SEPA direct debit file (pain.008)" turns a list of direct debits into an XML file in pain.008.001.08 format that can be uploaded to corporate online banking or transmitted to the bank via EBICS. Direct debits for invoices, membership fees or subscriptions are collected straight from the process, without transferring data into separate banking software.
The file follows the rules of the German Banking Industry Committee (Deutsche Kreditwirtschaft, DK) in Appendix 3 of the DFÜ Agreement and is validated against the official schema pain.008.001.08_GBIC_5 before it is saved. This schema has applied since October 2025 and remains unchanged in the version of Appendix 3 valid from 15 November 2026.
When is this service task used?
- Collecting invoices by direct debit: Open invoices of customers with a SEPA mandate are bundled and handed to the bank as one file.
- Recurring fees: Membership fees, rents or subscription fees are compiled and collected monthly in a process.
- B2B direct debit: Receivables from business customers are collected with the B2B scheme, which does not allow refunds without a reason.
Prerequisites
Before direct debits can be collected, the following must be in place outside Pantarey:
- Creditor identifier: Applied for free of charge at the Deutsche Bundesbank (for German creditors).
- Collection agreement with the bank: The creditor's bank has to enable direct debit collection, usually with a limit.
- SEPA mandate per debtor: With mandate reference and date of signature. For B2B, the debtor additionally has to confirm the mandate with their own bank. A mandate expires if it has not been used for 36 months.
- Pre-notification: The debtor is informed about amount and date before the collection – by default 14 calendar days in advance unless agreed otherwise. The notice can be part of the invoice, for example.
Core or B2B
The scheme is selected via local_instrument. File structure and checks are the same for both schemes.
Core (CORE) |
B2B (B2B) |
|
|---|---|---|
| Debtor | consumers and businesses | businesses only |
| Refund for the debtor | 8 weeks without reason, 13 months if no mandate exists | no refund for authorised debits |
| Mandate | debtor signs with the creditor | additionally confirmed with the debtor's bank |
| Submission | at least 1 business day before the due date | at least 1 business day before the due date |
A file always contains a single scheme – this is required by the German Banking Industry Committee. If both schemes are needed, the service task is called twice.
Input parameters
{
"local_instrument": "CORE",
"collection_date": "2026-10-15",
"creditor": {
"name": "Mustermann GmbH",
"iban": "DE89370400440532013000",
"bic": "COBADEFFXXX",
"creditor_id": "DE98ZZZ09999999999"
},
"transactions": [
{
"end_to_end_id": "RE-2026-001",
"amount": 119.0,
"mandate_id": "MANDAT-0001",
"mandate_signature_date": "2026-01-15",
"debtor": {
"name": "Kunde GmbH",
"iban": "DE02120300000000202051"
},
"remittance_information": "Rechnung RE-2026-001 vom 01.10.2026"
},
{
"end_to_end_id": "RE-2026-002",
"amount": 49.9,
"mandate_id": "MANDAT-0002",
"mandate_signature_date": "2026-09-20",
"sequence_type": "FRST",
"debtor": {
"name": "Müller & Söhne KG",
"iban": "DE02500105170137075030",
"bic": "INGDDEFFXXX"
},
"remittance_information": "Rechnung RE-2026-002 vom 01.10.2026"
}
]
}
General fields:
local_instrument:CORE(default) orB2B.collection_date: Due date inYYYY-MM-DDformat. Applies to all direct debits that do not specify their own date.sequence_type: Sequence type for all direct debits without their own value (optional, defaultRCUR), see Sequence type.message_id: Unique file identifier (optional). If omitted, it is generated automatically. The bank uses it to detect duplicate submissions, so every file needs a new identifier.initiating_party_name: Name of the submitting party (optional, default: creditor name).ultimate_creditor_name: Ultimate creditor, for information only (optional).batch_booking:falseif each direct debit should appear individually on the bank statement – only with a corresponding agreement with the bank (optional, default: batch booking).filename: File name (optional, defaultSEPA-Lastschrift_<scheme>_<message_id>.xml).
Creditor (creditor):
name: Company name (required).iban: IBAN of the account credited with the amounts (required). Spaces are allowed.bic: BIC of the creditor's bank (optional, required only for banks outside the EEA).creditor_id: Creditor identifier (required).address: Address (optional, not recommended by the German Banking Industry Committee), see Addresses.
Per direct debit (transactions):
amount: Amount in euros as a number or text with a decimal point, at most 2 decimal places (required).mandate_id: Mandate reference, up to 35 characters (required).mandate_signature_date: Date the mandate was signed (required).debtor: Debtor withnameandiban(required),bicandaddressoptional.end_to_end_id: Reference passed through to the debtor and returned with R-transactions, e.g. the invoice number (optional, generated otherwise). Must be unique within the file.remittance_information: Remittance information, up to 140 characters (optional, recommended).collection_date,sequence_type: Override the general fields (optional).ultimate_debtor_name: Ultimate debtor named in the mandate, e.g. the account holder's child (optional).purpose_code: Four-letter ISO purpose code, e.g.SUPP(optional).amendment: Details of an amended mandate (optional), see Mandate amendments.
Output
{
"file": {
"referenceId": "...",
"filename": "SEPA-Lastschrift_CORE_SDD202610071843056C9B3B.xml",
"contentType": "application/xml"
},
"message_id": "SDD202610071843056C9B3B",
"local_instrument": "CORE",
"number_of_transactions": 2,
"control_sum": "168.90",
"payment_information": [
{
"id": "SDD202610071843056C9B3B-1",
"collection_date": "2026-10-15",
"sequence_type": "FRST",
"number_of_transactions": 1,
"control_sum": "49.90"
},
{
"id": "SDD202610071843056C9B3B-2",
"collection_date": "2026-10-15",
"sequence_type": "RCUR",
"number_of_transactions": 1,
"control_sum": "119.00"
}
],
"warnings": []
}
Explanation:
file: Reference to the generated XML file. It can be attached to a record, sent by email or offered for download in a user task.message_id: File identifier. It appears in the banking log and serves as a reference for the collection run.number_of_transactions,control_sum: Number and total of all direct debits. The bank shows the same values when the file is uploaded.payment_information: The batches created. One batch is created per due date and sequence type.warnings: Notes that do not prevent the collection, e.g. shortened names or a due date on a holiday.
Checks
All data is checked before the file is created. If errors are found, the task stops and reports all errors at once, each with the affected field:
SEPA-Lastschrift: 4 Fehler in der Eingabe:
- creditor.iban: "DE89370400440532013001" – Prüfziffer stimmt nicht.
- transactions[0].amount: 10.555 hat mehr als 2 Nachkommastellen.
- transactions[0].collection_date: 2026-10-07 ist zu kurzfristig – frühestens 2026-10-08 (Einreichung 1 TARGET-Geschäftstag vor Fälligkeit, Cut-off-Zeit der Bank beachten).
- transactions[0].mandate_id: "/M1" darf nicht mit "/" beginnen oder enden und kein "//" enthalten.
The messages are in German. The following is checked:
- IBAN and creditor identifier including check digits.
- Amounts: between 0.01 and 999,999,999.99 euros, at most 2 decimal places. Count and totals of the file and of each batch are calculated exactly in cents.
- References (mandate reference, end-to-end reference, file identifier): allowed characters only, at most 35 characters, no
/at the start or end and no//. End-to-end references must be unique within the file. - Mandate date: must not be in the future.
- Remittance information: at most 140 characters.
- Due date, see Deadlines.
Finally, the generated file is validated against the official schema of the German Banking Industry Committee. Only a valid file is saved.
Deadlines and due date
For both Core and B2B, direct debits must reach the bank at least one business day before the due date. The TARGET calendar applies: Monday to Friday, except New Year's Day, Good Friday, Easter Monday, 1 May, and 25 and 26 December.
- If the due date is earlier than the next business day, the task stops with an error.
- If the due date falls on a non-TARGET day, a warning is issued – the bank then debits on the following business day.
- If the due date is more than 15 calendar days in the future, a warning is issued – banks are not obliged to accept such orders.
Bank cut-off time
Every bank has a cut-off time. Files uploaded after it count as received on the next business day. The check in the task does not know this time – for tight deadlines, one day of buffer should be planned.
Sequence type
| Value | Meaning |
|---|---|
RCUR |
Recurrent direct debit (default) |
FRST |
First direct debit |
OOFF |
One-off direct debit |
FNAL |
Final direct debit of a mandate |
Since November 2016, a first direct debit no longer has to be marked separately. The German Banking Industry Committee recommends using RCUR for the first direct debit as well. Different sequence types can be mixed in one file; they end up in separate batches.
Mandate amendments
If the mandate has changed since the last collection, this is reported with the next direct debit via amendment:
{
"amount": 119.0,
"mandate_id": "MANDAT-0001",
"mandate_signature_date": "2026-01-15",
"debtor": {
"name": "Kunde GmbH",
"iban": "DE02500105170137075030"
},
"amendment": {
"debtor_account_changed": true
}
}
debtor_account_changed:trueif the debtor has provided new account details. The file then contains the codeSMNDA(same mandate, new debtor account), as recommended by the German Banking Industry Committee for every account change.original_mandate_id: Previous mandate reference if the reference has changed.original_creditor_id,original_creditor_name: Previous creditor identifier or creditor name, e.g. after a change of company name.
Addresses
No address is needed within the EEA. If the creditor's or the debtor's bank is located in a SEPA country outside the EEA (e.g. Switzerland, United Kingdom, Monaco), the debtor's address and BIC are required.
{
"address": {
"street_name": "Bahnhofstrasse",
"building_number": "1",
"post_code": "8001",
"town_name": "Zürich",
"country": "CH",
"address_lines": ["c/o Muster AG"]
}
}
town_nameandcountry(two-letter ISO code) are required as soon as an address is given.street_name,building_number,post_codeandcountry_sub_divisionare optional.address_lines: at most 2 additional free-text lines. An address consisting only of free-text lines is no longer accepted.
Character set
Only certain characters are allowed in SEPA files. Names, remittance information and addresses are adjusted automatically:
- German umlauts,
ß,&,*,$and%are kept. - Accents are removed (
é→e),€becomesEUR,@becomes(at), typographic quotes and dashes become'and-, line breaks become spaces. Other characters that are not allowed are replaced with a full stop. - Names longer than 70 characters are shortened; a warning is issued.
References such as the mandate reference or end-to-end reference are not changed. If they contain characters that are not allowed, the task stops with an error.
JSONata example
Compiling direct debits from a list of open invoices:
{
"local_instrument": "CORE",
"collection_date": $.due_date,
"creditor": {
"name": "Mustermann GmbH",
"iban": "DE89370400440532013000",
"creditor_id": "DE98ZZZ09999999999"
},
"transactions": [$.invoices.{
"end_to_end_id": invoice_number,
"amount": amount,
"mandate_id": customer.mandate_reference,
"mandate_signature_date": customer.mandate_date,
"debtor": {
"name": customer.name,
"iban": customer.iban
},
"remittance_information": "Invoice " & invoice_number
}]
}
The field names (invoices, invoice_number, customer.mandate_reference etc.) are examples and are adapted to the actual data structure.
Notes
- Submission to the bank: The service task creates the file but does not transmit it. It is uploaded to corporate online banking or transmitted via EBICS and authorised there.
- R-transactions: Returns and status reports from the bank are not processed by this service task.
- Electronic mandates (e-mandates) are not supported.
- Format: pain.008.001.08 according to Appendix 3 of the DFÜ Agreement, schema
pain.008.001.08_GBIC_5, UTF-8 without BOM. Older formats (pain.008.001.02, pain.008.003.02) are not generated.