https://github.com/ebics-api/ebics-client-php
PHP library to make requests by EBICS protocol for financial establishments. Support EBICS versions: 2.4, 2.5, 3.0; Encryption versions: E002, X002, A005, A006; Switching EBICS T/TS.
https://github.com/ebics-api/ebics-client-php
api-rest bank cross-platform ebics php
Last synced: 9 months ago
JSON representation
PHP library to make requests by EBICS protocol for financial establishments. Support EBICS versions: 2.4, 2.5, 3.0; Encryption versions: E002, X002, A005, A006; Switching EBICS T/TS.
- Host: GitHub
- URL: https://github.com/ebics-api/ebics-client-php
- Owner: ebics-api
- License: mit
- Created: 2019-07-19T19:24:18.000Z (almost 7 years ago)
- Default Branch: 3.x
- Last Pushed: 2025-07-25T09:07:57.000Z (11 months ago)
- Last Synced: 2025-08-01T10:22:06.205Z (11 months ago)
- Topics: api-rest, bank, cross-platform, ebics, php
- Language: PHP
- Homepage: https://ebics-api.github.io/ebics-client-php/
- Size: 5.15 MB
- Stars: 54
- Watchers: 9
- Forks: 35
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-europe - ebics-client-php - api/ebics-client-php?style=flat-square&label=⭐)](https://github.com/ebics-api/ebics-client-php/stargazers) [](https://github.com/ebics-api/ebics-client-php/commits/3.x) [](https://github.com/ebics-api/ebics-client-php) [](https://github.com/ebics-api/ebics-client-php/blob/3.x/LICENSE) [](https://www.ebics.org/) [](https://eur-lex.europa.eu/eli/dir/2015/2366/oj) - PHP EBICS library supporting versions 2.4, 2.5, and 3.0 for European banking communication. (Payments and Banking)
README
# EBICS-CLIENT-PHP
[](https://github.com/ebics-api/ebics-client-php/actions/workflows/ci.yml)
[](https://packagist.org/packages/ebics-api/ebics-client-php)
[](https://packagist.org/packages/ebics-api/ebics-client-php)
[](https://packagist.org/packages/ebics-api/ebics-client-php)

PHP library to communicate with a bank through EBICS protocol.
PHP EBICS Client - https://ebics-api.github.io/ebics-client-php/
Supported PHP versions - PHP 7.2 and higher
Supported EBICS versions: 2.4, 2.5, 3.0; Encryption versions: E002, X002, A005, A006; Switching EBICS T/TS
# 💥 (Premium) EBICS API Client
Get your EBICS API Client standalone microservice in Docker for the easiest EBICS integration.
Explore the DEMO to see if it meets your needs.
Ideal for fintechs, ERPs, payment processors, and enterprises needing a robust EBICS integration.
## License
ebics-api/ebics-client-php is licensed under the MIT License, see the LICENSE file for details
## Installation
```bash
$ composer require ebics-api/ebics-client-php
```
## Initialize client
You will need to have this information from your Bank: `HostID`, `HostURL`, `PartnerID`, `UserID`
```php
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
executeStandardOrder(new \EbicsApi\Ebics\Orders\INI());
/* @var \EbicsApi\Ebics\Services\FileKeyringManager $keyringManager */
/* @var \EbicsApi\Ebics\Models\Keyring $keyring */
$keyringManager->saveKeyring($keyring, $keyringRealPath);
} 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, $keyringRealPath);
} 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
```php
/* @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.
```php
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, $keyringRealPath);
} 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](https://github.com/ebics-api/cfonb-php)
If you need to parse MT942 use [ebics-api/mt942-php](https://github.com/ebics-api/mt942-php)
