PHPackages                             ufozone/php-sepa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ufozone/php-sepa

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

ufozone/php-sepa
================

PHP class to create German SEPA files (XML) for credit transfer and direct debit.

v2.1(6mo ago)75.3k↓40%4[1 issues](https://github.com/ufozone/php-sepa/issues)BSD-2-ClausePHP

Since Jul 17Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/ufozone/php-sepa)[ Packagist](https://packagist.org/packages/ufozone/php-sepa)[ Docs](https://github.com/ufozone/php-sepa/)[ GitHub Sponsors](https://github.com/ufozone)[ RSS](/packages/ufozone-php-sepa/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (3)Used By (0)

php-sepa
========

[](#php-sepa)

PHP class to creating SEPA files (XML) for credit transfers and direct debits in accordance with version 3.9 of the specification for remote data transmission between customer and bank according to the DFÜ agreement for the German banking industry.

The versions of the standard followed are:

- *pain.001.001.09\_GBIC\_5.xsd* for credit transfers
- *pain.008.001.08\_GBIC\_5.xsd* for direct debits

Always verify the generated files at your bank before using them in production!

License: BSD 2-Clause License

Installing
----------

[](#installing)

The recommended way to install php-sepa is through [Composer](https://getcomposer.org/).

```
composer require ufozone/php-sepa
```

Example of using SEPA Credit Transfer
-------------------------------------

[](#example-of-using-sepa-credit-transfer)

```
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();
$executionDate = new \DateTime('+2 day');

$sepa = new \ufozone\phpsepa\Sepa\CreditTransfer($validatorFactory);
$sepa->setInitiator('Max Mustermann');                   // Einreicher
$sepa->setId('MSG-20240224-1');                          // Nachrichtenreferenz

$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
//$payment->setPriority('HIGH');                           // Prioritaet: NORM oder HIGH
$payment->setAccountName('Max Mustermann');              // Auftraggeber (Debitor)
$payment->setAccountIban('DE02370502990000684712');      // Auftraggeber IBAN
$payment->setAccountBic('COKSDE33');                     // Auftraggeber BIC
//$payment->setAccountCurrency('EUR');                     // Kontowaehrung
//$payment->disableBatchBooking();                         // Sammelbuchung deaktivieren
$payment->setDate($executionDate->format('Y-m-d'));      // Gewuenschter Ausfuehrungstermin

$transactionPostalAddress = new \ufozone\phpsepa\Sepa\PostalAddress($validatorFactory);
$transactionPostalAddress->setStreetName('Musterstraße 12a')
    ->setPostBox('12345')
    ->setTownName('Musterstadt')
    ->setPostCode('12345')
    ->setCountry('DE');

$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1')                // Transaktions-ID (eindeutig)
    ->setName('Karl Kümmel')                             // Name des Zahlungsempfaengers (Creditor)
    ->setPostalAddress($transactionPostalAddress)        // Adresse des Zahlungsempfaengers
    ->setIban('DE02300209000106531065')                  // IBAN des Zahlungsempfaengers
    ->setBic('CMCIDEDD')                                 // BIC des Zahlungsempfaengers
    ->setAmount(123.45)                                  // Betrag
    ->setPurpose('SALA')                                 // (optional) Zahlungstyp
    ->setReference('Lohn/Gehalt Januar 2026');           // Verwendungszweck (eine Zeile, max. 140 Zeichen)

$payment->addTransaction($transaction);

$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-2')
    ->setName('Doris Dose')
    ->setIban('DE02500105170137075030')
    ->setBic('INGDDEFFXXX')
    ->setAmount(234.56)
    ->setReference('Kleinanzeigen Kinderfahrrad');

$payment->addTransaction($transaction);

$sepa->addPayment($payment);

$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);
$xml->download('sepa.xml');
```

Example of using SEPA Direct Debit
----------------------------------

[](#example-of-using-sepa-direct-debit)

```
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();
$executionDate = new \DateTime('+5 day');

$sepa = new \ufozone\phpsepa\Sepa\DirectDebit($validatorFactory);
$sepa->setInitiator('Max Mustermann');                   // Einreicher
$sepa->setId('MSG-20240224-1');                          // Nachrichtenreferenz

$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
//$payment->setScope('CORE');                              // Lastschriftart (CORE oder B2B)
$payment->setSequenceType('OOFF');                       // Sequenztyp (FRST, RCUR, OOFF, FNAL)
$payment->setAccountName('Max Mustermann');              // Auftraggeber (Creditor)
$payment->setAccountIban('DE02200505501015871393');      // Auftraggeber IBAN
$payment->setAccountBic('HASPDEHHXXX');                  // Auftraggeber BIC
$payment->setCreditorId('DE98ZZZ09999999999');           // Glaeubigeridentifikationsnummer
//$payment->setAccountCurrency('EUR');                     // Kontowaehrung
//$payment->disableBatchBooking();                         // Sammelbuchung deaktivieren
$payment->setDate($executionDate->format('Y-m-d'));      // Gewuenschter Ausfuehrungstermin

$transactionPostalAddress = new \ufozone\phpsepa\Sepa\PostalAddress($validatorFactory);
$transactionPostalAddress->setStreetName('Musterstraße 12a')
    ->setPostBox('12345')
    ->setTownName('Musterstadt')
    ->setPostCode('12345')
    ->setCountry('DE');

$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1')                // Transaktions-ID (eindeutig)
    ->setName('Karl Kümmel')                             // Name des Zahlungspflichtigen (Debitor)
    ->setPostalAddress($transactionPostalAddress)        // Adresse des Zahlungspflichtigen
    ->setIban('DE02700100800030876808')                  // IBAN des Zahlungspflichtigen
    ->setBic('PBNKDEFFXXX')                              // BIC des Zahlungspflichtigen
    ->setAmount(123.45)                                  // Abzubuchender Betrag
    ->setPurpose('SCVE')                                 // (optional) Zahlungstyp
    ->setMandateId('M20170704-200')                      // Mandatsreferenz
    ->setMandateDate('2017-07-04')                       // Datum Mandatserteilung (YYYY-MM-DD)
    ->setReference('Rechnung R2017742 vom 17.06.2017');  // Verwendungszweck (eine Zeile, max. 140 Zeichen)

$payment->addTransaction($transaction);

$sepa->addPayment($payment);

$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);
$xml->download('sepa.xml');
```

Running tests
-------------

[](#running-tests)

```
vendor/bin/phpunit
```

External Resources
------------------

[](#external-resources)

- [German specification for remote data transfer between customer and bank according to the DFÜ agreement "Specification of Data Formats"](https://www.ebics.de/de/datenformate)
- [ECB SEPA gateway page](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html)
- [ISO20022 Message Catalog](https://www.iso20022.org/full_catalogue.page)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance74

Regular maintenance activity

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~113 days

Total

2

Last Release

192d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38220ce91209a23b47f2672e293d3c12fe720fd2bbe975b03ab10e77217a6950?d=identicon)[ufozone](/maintainers/ufozone)

---

Top Contributors

[![ufozone](https://avatars.githubusercontent.com/u/29913712?v=4)](https://github.com/ufozone "ufozone (62 commits)")[![leobeal](https://avatars.githubusercontent.com/u/12049134?v=4)](https://github.com/leobeal "leobeal (2 commits)")[![mhomeister](https://avatars.githubusercontent.com/u/16844537?v=4)](https://github.com/mhomeister "mhomeister (1 commits)")

---

Tags

sepasepa-credit-transfersepa-credit-transferssepa-debitsepa-direct-debitsepa-direct-debitssepa-xmlxmlsepaBanking

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ufozone-php-sepa/health.svg)

```
[![Health](https://phpackages.com/badges/ufozone-php-sepa/health.svg)](https://phpackages.com/packages/ufozone-php-sepa)
```

###  Alternatives

[digitick/sepa-xml

Creates Single Euro Payments Area (SEPA) XML files for the Direct Debit and Credit Transfer operations.

2836.0M12](/packages/digitick-sepa-xml)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[abcaeffchen/sephpa

Generates SEPA files for credit transfers (pain.001.001.03, pain.001.002.03, pain.001.003.03, pain.001.001.09) and direct debit (pain.008.001.02, pain.008.002.02, pain.008.003.02, pain.008.001.08)

711.7M](/packages/abcaeffchen-sephpa)[dmitrirussu/php-sepa-xml-generator

Creates an XML file for a Single Euro Payments Area (SEPA) Direct Debit Payment.

5644.0k](/packages/dmitrirussu-php-sepa-xml-generator)[perryfaro/sepa

Creates an XML file for a Single Euro Payments Area (SEPA) Credit Transfer.

1148.7k](/packages/perryfaro-sepa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
