Skip to main content

Sepa JS XML

A TypeScript library to generate SEPA XML files for credit transfers and direct debits

Quick start

Get up and running with SEPA XML generation in minutes

1

Install the package

Install sepa-js-xml using your preferred package manager:
npm install sepa-js-xml
2

Import and configure

Import the library and prepare your payment data:
import { createSepaXML } from "sepa-js-xml";
3

Generate your first SEPA XML

Create a SEPA XML file with your payment information:
const xml = createSepaXML({
  id: "MSG-001",
  creationDate: new Date(),
  initiatorName: "Your Company Name",
  positions: [
    {
      id: "PMT-001",
      name: "Debtor Account",
      iban: "DE89370400440532013000",
      bic: "COBADEFFXXX",
      requestedExecutionDate: new Date(),
      payments: [
        {
          id: "TXN-001",
          name: "Creditor Name",
          iban: "DE89370400440532013001",
          bic: "COBADEFFXXX",
          amount: 100.50,
          remittanceInformation: "Invoice #12345"
        }
      ]
    }
  ]
});

console.log(xml);
The library validates IBANs and BICs by default. You can disable validation by passing options.

Key features

Everything you need to generate compliant SEPA XML files

SEPA credit transfers

Generate pain.001 XML files for SEPA credit transfer payments

SEPA direct debits

Generate pain.008 XML files for SEPA direct debit collections

Multiple PAIN formats

Support for pain.001.001.02, pain.001.001.03, pain.008.001.01, pain.008.001.02, and more

Built-in validation

Automatic IBAN and BIC validation with configurable error handling

TypeScript support

Full type definitions for all interfaces and type-safe configuration

Batch payments

Support for batch booking and multiple payment instructions

Explore documentation

Learn how to use the library and understand the API

Payment types

Understand credit transfers vs direct debits

PAIN versions

Learn about different PAIN format versions

Examples

Real-world usage examples and patterns

Core function

createSepaXML() function reference

Data types

Interface and type definitions

Options

Configuration and validation options

Ready to generate SEPA XML files?

Install sepa-js-xml and start creating compliant SEPA payment files in minutes

Get Started

Build docs developers (and LLMs) love