aanndryyyy / e-financials-php-client
PHP client for the e-Arveldaja / e-Financials REST API
Package info
github.com/aanndryyyy/e-financials-php-client
pkg:composer/aanndryyyy/e-financials-php-client
Requires
- php: ^8.2.0
- php-http/discovery: ^1.20.0
- psr/http-client: ^1.0.3
- psr/http-client-implementation: ^1.0.1
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^2.0.0
Requires (Dev)
- cweagans/composer-patches: ^1.7.3
- guzzlehttp/guzzle: ^8.0.1
- guzzlehttp/psr7: ^3.0.0
- laravel/pint: ^1.30.3
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^8.9.5
- pestphp/pest: ^5.0.2
- pestphp/pest-plugin-arch: ^5.0.0
- pestphp/pest-plugin-mutate: ^5.0.0
- pestphp/pest-plugin-type-coverage: ^5.0.0
- phpstan/phpstan: ^2.2.7
- phpstan/phpstan-deprecation-rules: ^2.0.5
- phpstan/phpstan-strict-rules: ^2.0.12
- symfony/var-dumper: ^8.1.2
Suggests
- guzzlehttp/guzzle: A PSR-18 client and PSR-17 factory implementation, auto-detected by php-http/discovery (^8.0)
- nyholm/psr7: A lightweight PSR-7/PSR-17 implementation; pair with symfony/http-client or another PSR-18 client
This package is auto-updated.
Last update: 2026-08-06 10:15:13 UTC
README
PHP client for the e-Arveldaja / e-Financials REST API.
API docs: OpenAPI HTML · openapi.yaml
Installation
composer require aanndryyyy/e-financials-php-client guzzlehttp/guzzle
This package is PSR-18 based. Provide any PSR-18 HTTP client; Guzzle is the usual choice and is used for discovery when installed.
Related
Using WooCommerce? e-financials-woocommerce-integration builds on this client to sync WooCommerce orders into e-Financials.
Authentication
Generate an API key in e-Arveldaja under Seadistused → Üldised seadistused. Each request is signed with:
X-AUTH-QUERYTIME— UTC timestamp (Y-m-d\TH:i:s)X-AUTH-KEY—{apiKeyPublic}:{BASE64(HMAC-SHA-384("{apiKeyId}:{queryTime}:{path}", apiKeyPassword))}
Example
<?php require 'vendor/autoload.php'; $client = EFinancials::factory() ->withApiKeyId('api_key_id') ->withApiKeyPublic('api_key_public') ->withApiKeyPassword('api_key_password') // ->withBaseUri('https://demo-rmp-api.rik.ee') // default demo ->make(); $currencies = $client->currencies()->all(); $clients = $client->clients()->all(); print_r($currencies->toArray()); print_r($clients->toArray()); print_r($client->salesInvoices()->all()); print_r($client->journals()->all());
Or the shortcut:
$client = EFinancials::client('api_key_id', 'api_key_public', 'api_key_password');
Testing with ClientFake
ClientFake implements ClientContract by composing the real Client with a fake transporter. Queue response DTOs, arrays, JSON strings, or throwables, then assert on exact request paths.
use EFinancialsClient\Responses\Currencies\ListResponse; use EFinancialsClient\Testing\ClientFake; $client = new ClientFake([ ListResponse::fake(), ]); $response = $client->currencies()->all(); $client->assertSent('currencies'); $client->assertSentTimes('currencies', 1);
Development
Requires PHP 8.2+.
composer install composer test # lint + types + type-coverage + unit composer lint # Laravel Pint composer test:types # PHPStan composer test:unit # Pest 5 composer test:mutate # Pest mutation testing (requires PCOV/Xdebug)
Dev tooling targets PHP 8.4+ (Pest 5). The library runtime still supports PHP 8.2+.
Mutation testing currently applies a local Composer patch for pestphp/pest#1790 (php-code-coverage 14 --coverage-php format); remove patches/ once upstream ships the fix.
See CONTRIBUTING.md for guidelines.
Available resources
| Accessor | Endpoints |
|---|---|
clients() |
Clients CRUD, deactivate/reactivate |
products() |
Products CRUD, deactivate/reactivate |
costProfitCentres() |
Cost/profit centres list |
journals() |
Journals CRUD, register/invalidate, files |
invoices() |
Invoice series CRUD, invoice settings |
bank() |
Bank accounts CRUD, VAT info |
accounts() |
Account list |
accountDimensions() |
Account dimension list |
currencies() |
Currency list |
purchaseArticles() |
Purchase article list |
salesArticles() |
Sale article list |
transactions() |
Transactions CRUD, register/invalidate, files |
salesInvoices() |
Sale invoices CRUD, register/invalidate, files, delivery |
purchaseInvoices() |
Purchase invoices CRUD, register/invalidate, files |
templates() |
Sale invoice templates |
Demo API base URL: https://demo-rmp-api.rik.ee (version path /v1).
License
Copyright (c) 2026 Arbictus OÜ.
Dual-licensed. Use it under either:
- GPL-2.0-or-later — free of charge, including for commercial companies, as long as you meet the copyleft obligations. This covers evaluation, development, internal and hosted use, non-profit and educational projects, and distribution within GPL-compatible open source.
- A commercial license — for distributing a closed-source product that incorporates this library, or when you need warranty and indemnification terms. Contact andry.pedak@arbictus.eu.
You only need the commercial branch if the GPL does not work for you. Running this library on your own servers is not distribution and triggers no copyleft obligation.
Disclaimer
Independent, unofficial client for a public REST API. Not affiliated with, endorsed by, or supported by Registrite ja Infosüsteemide Keskus (RIK).