1. Go to this page and download the library: Download nozugroup/ksef-client-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Nozu\KsefClient\Http\KsefRequest;
$response = $client->send(KsefRequest::get('/rate-limits'));
use Nozu\KsefClient\Qr\InvoiceHash;
use Nozu\KsefClient\Qr\IssueDate;
use Nozu\KsefClient\Qr\QrCodeService;
use Nozu\KsefClient\Qr\QrLabel;
use Nozu\KsefClient\Qr\SellerNip;
$qr = QrCodeService::test();
$link = $qr->invoiceLink(
new SellerNip('1111111111'),
IssueDate::fromKsefFormat('01-02-2026'),
InvoiceHash::fromBase64Url('UtQp9Gpc51y-u3xApZjIjgkpZ01js-J8KflSPW8WzIE')
);
$png = $qr->invoiceQr(
new SellerNip('1111111111'),
IssueDate::fromKsefFormat('01-02-2026'),
InvoiceHash::fromInvoiceXml($invoiceXml),
QrLabel::offline()
);
use Nozu\KsefClient\Qr\CertificateSerialNumber;
use Nozu\KsefClient\Qr\ContextIdentifier;
use Nozu\KsefClient\Qr\OfflineCertificatePrivateKey;
$certificateQr = $qr->certificateQr(
ContextIdentifier::nip('1111111111'),
new SellerNip('1111111111'),
new CertificateSerialNumber('01F20A5D352AE590'),
InvoiceHash::fromInvoiceXml($invoiceXml),
OfflineCertificatePrivateKey::fromPem($offlineCertificatePrivateKeyPem)
);
$bytes = $certificateQr->bytes();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.