惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
博客园 - Franky
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
S
SegmentFault 最新的问题
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
B
Blog RSS Feed
Last Week in AI
Last Week in AI
Jina AI
Jina AI
博客园 - 司徒正美
The Cloudflare Blog
博客园_首页
博客园 - 聂微东
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
SEPA pain.001 XML in 5 Minutes: Generate and Validate for...
ismail183 · 2026-04-22 · via DEV Community

ismail183

If you're building a payment system for European banks, at some point you'll need to generate a SEPA credit transfer file in the pain.001 format. The spec is 200+ pages. The XSD validation errors are cryptic. And most tools that handle this cost money.

Here's a practical guide to generating and validating pain.001 files - with a free tool and no backend required.


What is SEPA pain.001?

pain.001 (Payment Initiation) is the ISO 20022 XML message format used to initiate SEPA credit transfers. It's what your ERP or treasury system sends to your bank to trigger batch payments.

Two versions are in active use:

  • pain.001.001.03 - the legacy version, still widely supported
  • pain.001.001.09 - the current version, required by most European banks since 2023

The key structural difference between them: v09 uses <BICFI> instead of <BIC>, and drops <MsgDefIdr>.


A Minimal pain.001.001.09 File

<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09">
  <CstmrCdtTrfInitn>
    <GrpHdr>
      <MsgId>MSG-2026-04-19-001</MsgId>
      <CreDtTm>2026-04-19T10:00:00</CreDtTm>
      <NbOfTxs>1</NbOfTxs>
      <CtrlSum>1500.00</CtrlSum>
      <InitgPty>
        <Nm>Acme Corp</Nm>
      </InitgPty>
    </GrpHdr>
    <PmtInf>
      <PmtInfId>PMT-001</PmtInfId>
      <PmtMtd>TRF</PmtMtd>
      <NbOfTxs>1</NbOfTxs>
      <CtrlSum>1500.00</CtrlSum>
      <PmtTpInf>
        <SvcLvl><Cd>SEPA</Cd></SvcLvl>
      </PmtTpInf>
      <ReqdExctnDt>
        <Dt>2026-04-22</Dt>
      </ReqdExctnDt>
      <Dbtr>
        <Nm>Acme Corp</Nm>
      </Dbtr>
      <DbtrAcct>
        <Id><IBAN>FR7630006000011234567890189</IBAN></Id>
      </DbtrAcct>
      <DbtrAgt>
        <FinInstnId><BICFI>BNPAFRPP</BICFI></FinInstnId>
      </DbtrAgt>
      <CdtTrfTxInf>
        <PmtId>
          <EndToEndId>E2E-001</EndToEndId>
        </PmtId>
        <Amt>
          <InstdAmt Ccy="EUR">1500.00</InstdAmt>
        </Amt>
        <CdtrAgt>
          <FinInstnId><BICFI>DEUTDEDB</BICFI></FinInstnId>
        </CdtrAgt>
        <Cdtr>
          <Nm>Supplier GmbH</Nm>
        </Cdtr>
        <CdtrAcct>
          <Id><IBAN>DE89370400440532013000</IBAN></Id>
        </CdtrAcct>
        <RmtInf>
          <Ustrd>Invoice INV-2026-001</Ustrd>
        </RmtInf>
      </CdtTrfTxInf>
    </PmtInf>
  </CstmrCdtTrfInitn>
</Document>

Enter fullscreen mode Exit fullscreen mode


Most Common Validation Errors

After processing thousands of pain.001 files, these are the errors that come up most often:

1. Wrong namespace
v03: urn:iso:std:iso:20022:tech:xsd:pain.001.001.03
v09: urn:iso:std:iso:20022:tech:xsd:pain.001.001.09
Mixing them causes immediate rejection.

2. <BIC> vs <BICFI>
In v03, the BIC element is <BIC>. In v09, it's <BICFI>. Banks that have migrated to v09 will reject files with <BIC>.

3. <MsgDefIdr> in v09
This element existed in v03 but was removed in v09. If your template still includes it, v09 XSD validation will fail.

4. <CtrlSum> mismatch
The control sum must exactly match the sum of all <InstdAmt> values. Off by one cent = rejection.

5. Execution date in the past
<ReqdExctnDt> must be today or a future business day. Banks won't process past dates.


Validate Against the Official XSD

You can validate your file directly in the browser at xmlbridge.com/sepa - paste or upload your XML, select the version (v03 or v09), and click Validate XSD. The validator runs the official ISO 20022 XSD client-side using a WASM XML parser.

For CI/CD pipelines, validate with Python:

from lxml import etree
import requests

def validate_pain001(xml_path, version="09"):
    xsd_url = f"https://xmlbridge.com/schemas/pain/pain.001.001.{version}.xsd"
    xsd_content = requests.get(xsd_url).content
    schema = etree.XMLSchema(etree.fromstring(xsd_content))

    with open(xml_path, "rb") as f:
        doc = etree.fromstring(f.read())

    if schema.validate(doc):
        print("Valid pain.001 file")
    else:
        for error in schema.error_log:
            print(f"Line {error.line}: {error.message}")

validate_pain001("payment.xml", version="09")

Enter fullscreen mode Exit fullscreen mode


Generate pain.001 Files Without Coding

If you need to generate a one-off payment file or test a bank integration, xmlbridge.com/sepa lets you fill in a form and download a valid pain.001 XML in seconds - no backend, no signup.

It supports:

  • Both v03 and v09
  • Single and multi-transaction files
  • SEPA EPC QR code generation
  • XSD validation in-browser

Key Differences: v03 vs v09

Element v03 v09
BIC field <BIC> <BICFI>
Message definition <MsgDefIdr> present removed
Namespace pain.001.001.03 pain.001.001.09
Bank support Legacy, still common Required by most EU banks

Conclusion

SEPA pain.001 is well-standardized but the version migration from v03 to v09 catches a lot of teams off guard. The three elements to watch: namespace, <BIC> vs <BICFI>, and <MsgDefIdr> removal.

Validate early, validate often - most banks only tell you a file was rejected, not why.

Try the free generator and validator at xmlbridge.com/sepa.


Building a payment integration? Drop your questions in the comments.