Build SEPA direct debit batch (remesa de recibos)
sepa_direct_debitsBuild pain.008.001.02 remittance XML (Cuaderno 19.14) for Spanish banks, validating every IBAN, creditor ID and mandate first so one bad recibo never rejects the whole file.
Instructions
Remesa de recibos SEPA: the pain.008.001.02 XML (Cuaderno 19.14) Spanish banks accept for direct debits.
For despachos collecting monthly fees (cuotas) and for clients that charge their customers by recibo. Every IBAN, the creditor identifier and each mandate are checked first; one wrong recibo refuses the whole file with the reason (free), so a batch never reaches the bank half-wrong. Same input, same bytes.
Args: creditor: {"name": "Asesoría Pérez SL", "iban": "ES91...", "bic": optional, "creditor_id": "ES12000B..." or "nif": "B12345678" to compute it (business_code optional, default 000)}. collection_date: Requested collection date (YYYY-MM-DD). CORE needs it 1-2 business days ahead. debits: [{"name": "Talleres Ruiz SL", "iban": "ES...", "amount": "60.50", "mandate_id": "CUOTA-0012", "mandate_date": "2024-01-15", "concept": "Cuota marzo 2026", "end_to_end_id": optional, "sequence_type": optional per recibo}]. sequence_type: Default for all recibos: RCUR (recurring, default), FRST (first), OOFF (one-off), FNAL. scheme: CORE (consumers and companies, default) or B2B. created_at: Optional YYYY-MM-DDTHH:MM:SS; defaults to collection_date 09:00 so the file is reproducible.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"creditor": "<creditor>",
"collection_date": "<collection_date>",
"debits": "<debits>"
},
"name": "sepa_direct_debits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| debits | Yes | ||
| scheme | No | CORE | |
| creditor | Yes | ||
| created_at | No | ||
| sequence_type | No | RCUR | |
| collection_date | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||