Skip to main content

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​

ParameterTypeRequiredDescription
environmentstringβœ…test, demo or prod
idstring (uuid)βœ…Offline invoice ID

Query Parameters​

ParameterTypeDefaultDescription
docTypestringxmlDocument format

Allowed docType values​

ValueDescription
xmlSigned XML (or unsigned if not yet signed)
pdfPDF with 2 QR codes: invoice QR (KOD I) and certificate QR (KOD II)
qrInvoice QR code as PNG image (KOD I β€” OFFLINE)
certCertificate 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​

CodeDescription
400Invalid docType or missing QR data
401Unauthorized
404Offline invoice not found
500PDF generation error