Create SEPA XML File: Complete Guide 2026

2026-07-10

For most companies, creating their first SEPA XML file feels harder than it actually is. The confusion usually comes from technical terminology, not the concept itself. You have payment data (names, amounts, accounts). You need a file format banks accept. SEPA XML is that format.

The good news: You don’t write XML by hand. You shouldn’t. Instead, you prepare data clearly, use a tool to convert, then validate. Once you understand the basic structure, creating SEPA XML becomes routine.

Understanding SEPA XML Structure

SEPA XML isn’t a flat list like CSV. It’s hierarchical. Understanding why helps you avoid structural mistakes.

Four-level hierarchy explained

Level 1: Document wrapper Outer XML element containing the entire payment batch. Think of it as the package covering everything inside.

Level 2: Payment initiation Basic metadata about the batch. How many payments? Who submitted? What type?

Level 3: Payment information block Groups multiple payments with shared data. One company’s outgoing transfers, one creditor’s direct debits, etc. Shared data lives here—company name, sender account, creditor ID.

Level 4: Individual transactions Each specific payment. Receiver, amount, purpose, mandate reference if applicable.

Why hierarchy? Practical efficiency. Don’t repeat company name 10,000 times. Declare once at block level. Banks parse structure before individual fields, so this matters for speed.

Data Preparation: The Foundation

Before any XML generation, data must be clean. This is where most errors originate.

Required vs optional fields

For pain.008 (direct debits), typical required fields:

Field Required Format Example
Mandate reference Yes Text, max 35 chars “MANDATE-2026-001”
Debtor name Yes Text, max 70 chars “John Smith”
Debtor IBAN Yes 34 chars, alphanumeric “DE89370400440532013000”
Amount Yes Numeric, EUR “99.50”
Due date Yes YYYY-MM-DD “2026-07-15”
Creditor ID Yes Text “DE98ZZZ09999999999”
Purpose No Text, max 140 chars “Invoice 2026-07”

Data quality checklist

Before conversion, verify:

  1. No blank required fields - Every transaction needs mandate, account, amount, date
  2. IBANs correctly formatted - 34 characters, right country code, valid check digits
  3. Amounts without symbols - Just numbers, decimal point, no € or commas
  4. Dates consistent - All YYYY-MM-DD format, all valid dates
  5. Special characters handled - Avoid characters XML parsers reject (ä, €, etc.)
  6. No duplicates - Each transaction unique, no mandate references repeated

Most conversion errors trace back to data quality, not XML structure problems.

Mapping: Connecting Your Data to SEPA Fields

Mapping means assigning your source columns to SEPA XML fields. This translation layer is crucial.

Simple mapping example

Your Column SEPA Field Description
Customer Name Dbtr/Nm Debtor name in SEPA
Customer IBAN DbtrAcct/Id/IBAN Debtor account
Invoice Amount InstdAmt Instruction amount
Invoice Date ReqdColltnDt Requested collection date

Mapping isn’t complex but must be correct. One wrong assignment and SEPA validation fails or amounts go to wrong accounts.

Common mapping mistakes

  • Mixing debtor and creditor - Source says “Payer” but you assign to creditor field
  • Currency assumed - Amount field assumes EUR, but source includes currency code
  • Text truncation - Long names cut to 70 characters without warning
  • Date conversion lost - Excel date serial number not converted to YYYY-MM-DD

Document your mapping and keep it for future reference. When processes repeat, reference documentation saves relearning.

Tools for SEPA XML Creation

Three approaches exist:

1. Manual XML (Don’t do this)

Writing XML tags by hand is error-prone and slow. Even once is too much. Only consider for learning, not production.

2. Converter tools

Upload Excel/CSV, assign columns, download XML. Typical flow: - Select data file - Verify columns recognized - Set mapping (Name column → Debtor field, etc.) - Validate - Download XML

This works well for occasional creation, smaller files, teams preferring UI.

3. API or SDK

Integrate payment system directly. Data flows without human steps.

from sepa import create_direct_debit

payments = [
  {"name": "John", "iban": "DE89...", "amount": 99.50}
]
xml = create_direct_debit(payments)

Best for recurring, high-volume, fully automated.

Validation: Ensuring Correctness Before Upload

Generated XML isn’t automatically correct. Validation prevents bank rejection.

Validation steps

  1. XML syntax check Open file in text editor or XML validator. Valid XML parses without errors.

  2. SEPA schema validation Compare against official SEPA XML schema. Your bank can provide current version.

  3. Plausibility check Amount reasonable? Dates in future? Mandate references present? Counts match?

  4. Sample verification Don’t just validate technically. Spot-check transactions. Does sample amount match source? Counterparty correct?

What banks require

Most banks now accept files via portal or API. Requirements:

  • PAIN version - Check which version your bank accepts. PAIN.008.001.02 deprecated November 2026. Use PAIN.008.003.02.
  • Encoding - UTF-8 is standard.
  • File size - Usually up to 100MB, but ask your bank.
  • Submission timing - Submit before cutoff times (often 3 PM for next-day execution).

Common Creation Errors and Solutions

Error Cause Solution
“Invalid IBAN” Typo or wrong format Validate IBAN check digits before conversion
“Mandate reference invalid” Duplicate or wrong format Ensure unique, max 35 chars
“File rejected by bank” Schema version wrong Verify PAIN version used vs. bank requirement
“Amount doesn’t match” Text format, currency included Ensure numeric, EUR assumed
“Date rejected” Wrong format or past date Use YYYY-MM-DD, verify future date

Most errors are data problems appearing during XML validation. Fix source, regenerate.

Step-by-Step Creation Process

Tested workflow for first-time creation:

  1. Export data to CSV - Clean, simple format from accounting system
  2. Open in Excel - Verify columns, check for blanks, remove test rows
  3. Use online converter - Upload file, map columns clearly
  4. Download XML - Save locally
  5. Validate locally - Open file, check for errors
  6. Send to colleague - Second person spot-checks amounts
  7. Upload to bank - Use portal or API depending on your bank’s method
  8. Confirm execution - Next day verify transactions processed

For first file, don’t rush. Taking time with validation prevents problems.

Automation for Recurring Processes

Once creating files regularly, automation becomes practical.

Typical automation setup:

  • ERP exports payment data daily/weekly
  • Conversion service receives data via API
  • SEPA XML generated automatically
  • File uploaded to bank automatically
  • Confirmation logged in accounting system

No manual steps. No waiting. Payments consistently automated.

Summary

Creating SEPA XML isn’t complex once you understand the hierarchy and data requirements. Most errors come from incomplete or dirty source data, not XML structure problems. Always validate before upload, and for recurring processes, investment in automation pays dividends quickly.


Frequently Asked Questions

How is a SEPA XML file structured?
A SEPA XML file has four main hierarchy levels: Document (outer frame), CstmrCdtTrfInitn (payment initiation), PmtInf (payment block with shared data), and CdtTrfTxInf/DrctDbtTxInf (individual transactions). This structure is not just technically clean but also practical: shared data bundles in payment block, individual details at transaction level.
What are the most common creation errors?
Most common: wrong Excel-to-XML mapping, inconsistent date formats, amounts with currency symbols or text, missing or duplicate mandate references, special characters in text fields, and empty required fields. Often errors exist already in source data. Pre-validation before XML generation catches most problems early.
Should I create XML manually or with a tool?
Manual creation is useful for learning and understanding structure, but for ongoing operations a tool or converter is essential. Tools save time, reduce errors, enable reusable mapping, and identify validation problems automatically. For recurring or larger payment volumes, a tool becomes indispensable.
What must be checked before uploading a SEPA XML file?
Before upload: 1) Open XML locally and check structure plausibility. 2) Verify required fields. 3) Validate IBANs and assignments. 4) Check PAIN version used (PAIN.008.001.02 rejected from November 2026). 5) Technically validate against XML schema. One person prepares, another reviews before bank upload.

Related posts