Search by

beziworld / laravel-infakt

kamcw

inFakt API v3 client for Laravel: asynchronous invoice creation, PDF, payments, e-mail delivery and clients.

Package info

github.com/Beziworld/laravel-infakt

Homepage

Issues

pkg:composer/beziworld/laravel-infakt

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.0 2026-11-04 14:42 UTC

This package is auto-updated.

Last update: 2026-11-04 16:36:32 UTC


README

tests Latest Version License

inFakt API v3 client for Laravel: invoices (created through the asynchronous task API, optionally sent to KSeF), PDF, payments, e-mail delivery and clients.

Polska wersja dokumentacji

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.

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.