Download Offline Invoice
GET /invoices/{environment}/offline/{id}β
Downloads an offline invoice document in the selected format. Unlike online invoices, offline invoices support an additional cert document type for the certificate QR code.
Path Parametersβ
| Parameter | Type | Required | Description |
|---|---|---|---|
environment | string | β | test, demo or prod |
id | string (uuid) | β | Offline invoice ID |
Query Parametersβ
| Parameter | Type | Default | Description |
|---|---|---|---|
docType | string | xml | Document format |
Allowed docType valuesβ
| Value | Description |
|---|---|
xml | Signed XML (or unsigned if not yet signed) |
pdf | PDF with 2 QR codes: invoice QR (KOD I) and certificate QR (KOD II) |
qr | Invoice QR code as PNG image (KOD I β OFFLINE) |
cert | Certificate QR code as PNG image (KOD II β CERTYFIKAT) |
Response 200 β XMLβ
{
"id": "uuid",
"invoiceNumber": "FV/2026/01/001",
"docType": "xml",
"contentType": "application/xml",
"content": "PD94bWwg...base64...",
"fileName": "FV-2026-01-001.xml"
}
Response 200 β PDFβ
{
"id": "uuid",
"invoiceNumber": "FV/2026/01/001",
"docType": "pdf",
"contentType": "application/pdf",
"content": "JVBERi0...base64...",
"fileName": "FV-2026-01-001.pdf",
"qrLinkInvoice": "https://qr-test.ksef.mf.gov.pl/invoice/...",
"qrLinkCertificate": "https://qr-test.ksef.mf.gov.pl/certificate/..."
}
PDF with 2 QR codes
The offline invoice PDF contains two QR codes when available:
- KOD I (invoice QR) β verifies the invoice content hash
- KOD II (certificate QR) β verifies the signing certificate
The PDF also includes an "OFFLINE" watermark to distinguish it from online invoices.
Response 200 β QR / Certβ
{
"id": "uuid",
"invoiceNumber": "FV/2026/01/001",
"docType": "qr",
"contentType": "image/png",
"content": "iVBORw0...base64...",
"fileName": "FV-2026-01-001-qr.png",
"qrVerificationUrl": "https://qr-test.ksef.mf.gov.pl/invoice/..."
}
For docType=cert, the response has the same structure but with "docType": "cert", file suffix -cert-qr.png, and qrVerificationUrl pointing to the certificate verification URL.
Error Codesβ
| Code | Description |
|---|---|
| 400 | Invalid docType or missing QR data |
| 401 | Unauthorized |
| 404 | Offline invoice not found |
| 500 | PDF generation error |