Fio bank REST API implementation in PHP. It allows you to download and iterate through account balance changes. You can also upload payment orders.
There is a Symfony Bundle for using this library in a Symfony app.
- Install the latest version with
composer require webwingscz/fio-api-php - Create a token in the ebanking (Nastavení / API)
- Use it according to the example bellow and check the docblocks
<?php
require_once 'vendor/autoload.php';
$downloader = new FioApi\Download\Downloader('TOKEN@todo');
$transactionList = $downloader->downloadSince(new \DateTimeImmutable('-1 week'));
foreach ($transactionList->getTransactions() as $transaction) {
var_dump($transaction); //object with getters
}downloadFromTo(DateTimeInterface $from, DateTimeInterface $to): TransactionListdownloadSince(DateTimeInterface $since): TransactionListdownloadLast(): TransactionListsetLastId(string $id)- sets the last downloaded ID through the API
setBaseUrl(string $baseUrl)- override API base URL (sandbox/proxy/testing)setRequestTimeout(float $seconds)- total request timeout (timeoutin Guzzle)setConnectTimeout(float $seconds)- connection timeout (connect_timeoutin Guzzle)configureRetry(int $retryCount, int $initialDelayMs = 30000, float $backoffMultiplier = 2.0, ?int $maxDelayMs = null)- retries only network/connect errors (
ConnectException) - default initial delay is 30 seconds to respect Fio token rate limit
- retries only network/connect errors (
<?php
require_once 'vendor/autoload.php';
$uploader = new FioApi\Upload\Uploader('TOKEN@todo', 'accountFromWithoutBankCode@todo');
$uploader->addPaymentOrder(new FioApi\Upload\Entity\PaymentOrderCzech(...$params));
$response = $uploader->uploadPaymentOrders();
if ($response->hasUploadSucceeded()) {
// ...
}Fio API PHP works with PHP 7.4 or higher.
- Current major line:
6.x - Supported PHP versions:
^7.4 || ^8.0 - Supported Guzzle versions:
~6.1 | ~7.0 - Versioning policy: SemVer (
MAJOR.MINOR.PATCH) - Backward compatibility:
- No BC breaks in
6.xpatch/minor releases. - BC breaks are allowed only in next major version (
7.0).
- No BC breaks in
- Release policy:
masterbranch contains upcoming changes.- Tagged releases (
6.x.y) are considered stable and production-ready. - Security and critical bug fixes should be released as patch versions.
Bugs and feature request are tracked on GitHub
Please report vulnerabilities according to SECURITY.md.
Contribution guidelines are available in CONTRIBUTING.md.
Martin Hujer - https://www.martinhujer.cz Jiří Dorazil - https://www.webwings.cz
- add configurable base URL (
setBaseUrl) for sandbox/proxy/testing scenarios - add configurable request timeout and connect timeout
- add a configurable retry strategy with exponential backoff for connection errors
- improve downloader error handling for connection and invalid JSON responses
- remove invalid bundled CA certificate fallback and use explicit certificate resolution
- modernize coding standards from PSR-2 to PSR-12 and update PHP_CodeSniffer
- enforce release creation only after successful CI build
- make CI dependency installation deterministic via
composer install(lockfile-based) - add security checks to CI (
composer audit) and addroave/security-advisoriesto dev dependencies - add professional repository standards:
SECURITY.md,CONTRIBUTING.md, CODEOWNERS, issue and PR templates
- #31 add
composer/ca-bundleas a required dependency instead of bundled root cert (thx @�feldsam!)
- #28 use new Fio API URL (thx @�feldsam!)
- #19 gracefully handle response with empty column8 (thx @fmasa!)
- #17 added senderName (nazev protiuctu) (thx @jan-stanek!)
- #13 Support /last and /set-last-id endpoints (thx @jiripudil!)
- #12 handle empty transaction list (thx @soukicz!)
- #9 minimal supported version is PHP 7.1
- #9
DateTimereplaced withDateTimeImmutable(orDateTimeInterface) - #9 strict types and primitive typehints are used everywhere
- dropped support for PHP <7
- #7: added official composer CA bundle support (@soukicz)
- #2: added Kdyby/CurlCaBundle as an optional dependency (@mhujer)
- #1: updated default GeoTrust certificate (@soukiii)
- #1: added
specificationfield in transaction (@soukiii)
- upgraded to Guzzle 6
- support for PHP 5.4 dropped (as Guzzle 6 requires PHP 5.5+)
- updated root certificate (Root 3) as the Fio changed it on 2014-05-26
- initial release

