laravel-infakt maintained by beziworld
Laravel inFakt
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.