beziworld / laravel-infakt
inFakt API v3 client for Laravel: asynchronous invoice creation, PDF, payments, e-mail delivery and clients.
Requires
- php: ^8.3
- ext-json: *
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
- phpstan/phpstan-strict-rules: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-04 16:36:32 UTC
README
inFakt API v3 client for Laravel: invoices (created through the asynchronous task API, optionally sent to KSeF), PDF, payments, e-mail delivery and clients.
Installation
composer require beziworld/laravel-infakt
php artisan vendor:publish --tag=infakt-config # optional
INFAKT_API_KEY=your-api-key INFAKT_SANDBOX=false # sandbox accounts: https://konto.sandbox-infakt.pl/rejestracja
Issue an invoice
inFakt creates invoices asynchronously. createInvoice() starts the task and polls it until the invoice exists:
use Beziworld\Infakt\Data\InvoiceRequest; use Beziworld\Infakt\Data\Service; use Beziworld\Infakt\Facades\Infakt; $invoice = Infakt::createInvoice(new InvoiceRequest( services: [ new Service('Website development', unitNetPrice: 500000, quantity: 1), // amounts in grosze new Service('Hosting 12 months', grossPrice: 61500, taxSymbol: '23', unit: 'usł.'), ], clientCompanyName: 'ACME Sp. z o.o.', clientTaxCode: '5261040828', clientStreet: 'Prosta', clientStreetNumber: '1', clientPostCode: '00-001', clientCity: 'Warszawa', paymentDate: now()->addDays(14), ), sendToKsef: true); $invoice->number; // "1/11/2026" $invoice->grossPrice; // 676500 (grosze) Infakt::sendByEmail($invoice->uuid);
In a queued job you can avoid blocking:
$task = Infakt::createInvoiceAsync($request); // returns immediately // later $task = Infakt::task($task->reference); if ($task->isDone()) { $invoice = Infakt::invoice($task->invoiceUuid); }
Other operations
Infakt::invoices(['q[invoice_date_gteq]' => '2026-11-01'], offset: 0, limit: 100); // ['items' => [...], 'total' => 37] Infakt::pdf($uuid, 'original'); // binary PDF Infakt::markAsPaid($uuid, now()); // asynchronous, waited for Infakt::deleteInvoice($uuid); Infakt::clients(['q[nip_eq]' => '5261040828']); Infakt::createClient(['company_name' => 'ACME', 'nip' => '5261040828', 'country' => 'PL']);
Exceptions
ApiException (errors() with field messages, httpStatus(), isRateLimited() for HTTP 429/503) and
InvalidConfiguration, both extending InfaktException. inFakt allows 300 GET and 150 other requests per minute per
IP address.
Development
composer install
composer ci # pint --test, phpstan (level 8), pest
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: biuro@beziworld.eu
- Issues: GitHub issues
Need an invoicing or KSeF integration? Get in touch through beziworld.eu.
Other packages by the author
laravel-fakturownia · laravel-wfirma · laravel-company-data · laravel-nbp
License
MIT. See LICENSE.md. This package is not affiliated with inFakt.