andrew-svirin / ebics-client-php
PHP library to communicate with bank through EBICS protocol.
Requires
- php: ^8.5
- ext-bcmath: *
- ext-curl: *
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-openssl: *
- ext-zip: *
- ext-zlib: *
Requires (Dev)
- ebics-api/cfonb-php: ^1.0
- ebics-api/mt942-php: ^1.0
- phpstan/phpstan: ~2.1.50
- phpunit/phpunit: ~13.1.7
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- setasign/fpdf: ^1.8
- squizlabs/php_codesniffer: ~3.13.5
Suggests
- ebics-api/cfonb-php: If you need to parse format CFONB from FDL requests.
- ebics-api/mt942-php: If you need to parse format MT942 from VMK, STA requests.
- setasign/fpdf: If you need to generate PDF file letter for Bank.
- 3.x-dev
- 3.1.1
- 3.1.0
- 3.0.3
- 3.0.2
- v3.0.1
- v3.0.0
- 2.x-dev
- v2.4.1
- v2.4.0
- v2.3.0
- v2.2.1
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.8.6
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.9
- v1.7.8
- v1.7.7
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-05-16 11:30:44 UTC
README
PHP library to communicate with a bank through EBICS protocol.
PHP EBICS Client - https://ebics-api.github.io/ebics-client-php/
Supported EBICS versions: 2.4, 2.5, 3.0; Encryption versions: E002, X002, A005, A006; Switching EBICS T/TS
๐ฅ (Premium) EBICS API Client
EBICS API Client is a standalone microservice that wraps this library into a ready-to-deploy banking integration solution. Ideal for fintechs, ERPs, payment processors, and enterprises needing a robust EBICS integration without building and maintaining the client layer yourself.
Premium Features
-
๐ Instant deployment โ Docker-based microservice, deploy in minutes.
-
๐ REST API โ Complete EBICS operations via simple HTTP calls. No PHP expertise needed.
-
๐งช Dummy EBICS Server โ Develop and test your integration locally without a real bank.
Key Value URL https://localhost/ebics-server-stubHost ID EBICSSTUBPartner ID P07User ID U07 -
๐ค MCP Server for AI Agents โ Connect AI coding assistants directly to your EBICS server.
{ "mcpServers": { "ebics-server": { "type": "remote", "url": "http://localhost/mcp", "headers": { "Authorization": "Key YOUR_API_KEY_HERE" } } } } -
๐ Admin dashboard โ Monitor transactions, manage keys, view logs.
-
๐ก๏ธ Priority support โ Direct access to the development team.
๐ Try the DEMO ยท Learn more ยท Watch the video
Already using the open-source library and need more? The Premium microservice is the natural next step โ no rewrite, same protocol support, zero configuration debt.
License
ebics-api/ebics-client-php is licensed under the MIT License, see the LICENSE file for details
Installation
$ composer require ebics-api/ebics-client-php
Initialize client
You will need to have this information from your Bank: HostID, HostURL, PartnerID, UserID
<?php use EbicsApi\Ebics\Factories\KeyringFactory; use EbicsApi\Ebics\Services\FileKeyringManager; use EbicsApi\Ebics\Models\Bank; use EbicsApi\Ebics\Models\User; use EbicsApi\Ebics\EbicsClient; use EbicsApi\Ebics\Models\X509\BankX509Generator; // Prepare `workspace` dir in the __PATH_TO_WORKSPACES_DIR__ manually. // "__EBICS_VERSION__" should have value "VERSION_30" for EBICS 3.0 $keyringPath = __PATH_TO_WORKSPACES_DIR__ . '/workspace/keyring.json'; $keyringManager = new FileKeyringManager(); if (is_file($keyringPath)) { $keyring = $keyringManager->loadKeyring($keyringPath, __PASSWORD__, __EBICS_VERSION__); } else { $keyring = $keyringManager->createKeyring(__EBICS_VERSION__); $keyring->setPassword(__PASSWORD__); } $bank = new Bank(__HOST_ID__, __HOST_URL__); // Use __IS_CERTIFIED__ true for EBICS 3.0 and/or French banks, otherwise use false. if(__IS_CERTIFIED__) { $certificateGenerator = (new BankX509Generator()); $certificateGenerator->setCertificateOptionsByBank($bank); $keyring->setCertificateGenerator($certificateGenerator); } $user = new User(__PARTNER_ID__, __USER_ID__); $client = new EbicsClient($bank, $user, $keyring); if (!is_file($keyringPath)) { $client->createUserSignatures(); $keyringManager->saveKeyring($client->getKeyring(), $keyringPath); }
Global process and interaction with Bank Department
1. Create and store your 3 keys and send initialization request.
<?php use EbicsApi\Ebics\Contracts\EbicsResponseExceptionInterface; /* @var \EbicsApi\Ebics\EbicsClient $client */ try { $client->executeStandardOrder(new \EbicsApi\Ebics\Orders\INI()); /* @var \EbicsApi\Ebics\Services\FileKeyringManager $keyringManager */ /* @var \EbicsApi\Ebics\Models\Keyring $keyring */ $keyringManager->saveKeyring($keyring, $keyringPath); } catch (EbicsResponseExceptionInterface $exception) { echo sprintf( "INI request failed. EBICS Error code : %s\nMessage : %s\nMeaning : %s", $exception->getResponseCode(), $exception->getMessage(), $exception->getMeaning() ); } try { $client->executeStandardOrder(new \EbicsApi\Ebics\Orders\HIA()); $keyringManager->saveKeyring($keyring, $keyringPath); } catch (EbicsResponseExceptionInterface $exception) { echo sprintf( "HIA request failed. EBICS Error code : %s\nMessage : %s\nMeaning : %s", $exception->getResponseCode(), $exception->getMessage(), $exception->getMeaning() ); }
2. Generate a EBICS letter
/* @var \EbicsApi\Ebics\EbicsClient $client */ $ebicsBankLetter = new \EbicsApi\Ebics\EbicsBankLetter(); $bankLetter = $ebicsBankLetter->prepareBankLetter( $client->getBank(), $client->getUser(), $client->getKeyring() ); $pdf = $ebicsBankLetter->formatBankLetter($bankLetter, $ebicsBankLetter->createPdfBankLetterFormatter());
3. Wait for the bank validation and access activation.
4. Fetch the bank keys.
try { /* @var \EbicsApi\Ebics\EbicsClient $client */ $client->executeInitializationOrder(new \EbicsApi\Ebics\Orders\HPB()); /* @var \EbicsApi\Ebics\Services\FileKeyringManager $keyringManager */ /* @var \EbicsApi\Ebics\Models\Keyring $keyring */ $keyringManager->saveKeyring($keyring, $keyringPath); } catch (EbicsResponseExceptionInterface $exception) { echo sprintf( "HPB request failed. EBICS Error code : %s\nMessage : %s\nMeaning : %s", $exception->getResponseCode(), $exception->getMessage(), $exception->getMeaning() ); }
5. Play with other transactions!
| Transaction | Description |
|---|---|
| HEV | Download supported protocol versions for the Bank. |
| INI | Send to the bank public signature of signature A005. |
| HIA | Send to the bank public signatures of authentication (X002) and encryption (E002). |
| H3K | Send to the bank public signatures of signature (A005), authentication (X002) and encryption (E002). |
| HCS | Upload for renewing user certificates. |
| HPB | Download the Bank public signatures authentication (X002) and encryption (E002). |
| SPR | Suspend activated keyring. |
| HPD | Download the bank server parameters. |
| HKD | Download customer's customer and subscriber information. |
| HTD | Download subscriber's customer and subscriber information. |
| HAA | Download Bank available order types. |
| PTK | Download transaction status (Plain text). |
| HAC | Download transaction status (XML). |
| FDL | Download the files from the bank. |
| FUL | Upload the files to the bank. |
| BTD | Download request files of any BTF structure. |
| BTU | Upload the files to the bank. |
If you need to parse Cfonb 120, 240, 360 use ebics-api/cfonb-php
If you need to parse MT942 use ebics-api/mt942-php
