fakturnaut / sdk
Fakturnaut API client: issue, validate, deliver and check EN 16931 e-invoices (XRechnung, ZUGFeRD, RO e-Factura).
v1.0.0
2026-10-24 11:30 UTC
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.4.5
- guzzlehttp/psr7: ^1.9.1 || ^2.4.5
Requires (Dev)
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
PHP client for the Fakturnaut API: issue, validate, deliver and check EN 16931 e-invoices (XRechnung, ZUGFeRD, RO e-Factura). PHP 8.1 or newer, Guzzle 7.
composer require fakturnaut/sdk
use Fakturnaut\Sdk\Api\InvoicesApi; use Fakturnaut\Sdk\Configuration; use Fakturnaut\Sdk\Helpers\Idempotency; use Fakturnaut\Sdk\Model\InvoiceRequest; $config = Configuration::getDefaultConfiguration()->setAccessToken(getenv('FAKTURNAUT_KEY')); // fkn_test_… = sandbox $invoices = new InvoicesApi(null, $config); $issued = $invoices->issueInvoice(new InvoiceRequest([/* sellerId, number, buyer, lines … */]), Idempotency::newKey());
Errors throw Fakturnaut\Sdk\ApiException; getResponseBody() is an RFC 9457 problem with a stable code.
Webhooks
use Fakturnaut\Sdk\Helpers\Webhooks; $ok = Webhooks::verify( file_get_contents('php://input'), $_SERVER['HTTP_EINVOICE_TIMESTAMP'] ?? null, $_SERVER['HTTP_EINVOICE_SIGNATURE'] ?? null, getenv('FAKTURNAUT_WEBHOOK_SECRET') );
Generated from api/openapi.json; do not edit lib/Api or lib/Model by hand. Tests: vendor/bin/phpunit.