Skip to main content

Submission Status

Checking the shipping status​

GET /invoices/{environment}/status/{referenceNumber}​

Checks the submission status of a session (online or batch) by reference number. Returns full session details including invoice counts and per-invoice status. Requires an active KSeF session.

Status checking path parameters​

ParameterTypeRequiredDescription
environmentstringβœ…test, demo or prod
referenceNumberstringβœ…KSeF session/batch reference number

Status checking response 200​

{
"referenceNumber": "20260101-AU-XXXXXXXX-XXXX-XX",
"status": {
"code": 200,
"description": "Batch session processed successfully"
},
"dateCreated": "2026-01-15 12:00:00",
"dateUpdated": "2026-01-15 12:05:00",
"totalInvoiceCount": 3,
"successfulInvoiceCount": 3,
"failedInvoiceCount": 0,
"invoices": [
{
"ordinalNumber": 1,
"invoiceNumber": "FV/2026/01/001",
"ksefNumber": "1234567890-20260101-ABCDEF-12",
"acquisitionDate": "2026-01-15 12:01:00",
"status": { "code": 200, "description": "OK" }
}
]
}
FieldTypeDescription
referenceNumberstringKSeF reference number
statusobjectSession processing status (code + description)
dateCreatedstringSession creation date
dateUpdatedstringSession last update date
totalInvoiceCountintegerTotal number of invoices in the session
successfulInvoiceCountintegerNumber of successfully processed invoices
failedInvoiceCountintegerNumber of failed invoices
invoicesarrayList of invoices with their individual status

Invoice object​

FieldTypeDescription
ordinalNumberintegerInvoice position in the session
invoiceNumberstringInvoice number (e.g. FV/2026/01/001)
ksefNumberstringKSeF invoice number
acquisitionDatestringDate when KSeF accepted the invoice
statusobjectPer-invoice status (code + description)
Session Reference Sync

When the status is checked, ksef-proxy automatically updates session_reference_number in:

  • synced_invoices β€” for online invoices matched by ksef_number
  • offline_invoices β€” for batch invoices matched by ksef_reference_number

This ensures that invoices sent before session tracking was implemented can be retroactively linked to their session.

Status checking error Codes​

CodeDescription
401Unauthorized
404No active KSeF session
409KSeF outage or simulation active β€” error message includes details
502KSeF error β€” enriched with outage context if applicable

Download UPO​

GET /invoices/{environment}/status/{referenceNumber}/{ksefNumber}/upo​

Downloads the UPO (Official Receipt Confirmation) for an invoice from KSeF. Requires the session reference number in which the invoice was sent and an active KSeF session.

Why is referenceNumber required?

The KSeF v2 API requires the session reference number to retrieve UPO: /v2/sessions/{referenceNumber}/invoices/ksef/{ksefNumber}/upo

The referenceNumber is the session ID returned when the invoice was sent (from POST /invoices/{environment}/send or GET /invoices/{environment}/status/{referenceNumber}).

Download UPO path parameters​

ParameterTypeRequiredDescription
environmentstringβœ…test, demo or prod
referenceNumberstringβœ…KSeF session reference number (from send response)
ksefNumberstringβœ…KSeF invoice number

Download UPO Query Parameters​

ParameterTypeDefaultDescription
docTypestringxmlxml (UPO XML) or pdf (UPO PDF)

Response 200 β€” XML​

{
"ksefNumber": "1234567890-20260101-ABCDEF-12",
"referenceNumber": "20260101-AU-XXXXXXXX-XXXX-XX",
"docType": "xml",
"contentType": "application/xml",
"content": "PD94bWwgdmVyc2lvbj0i...",
"fileName": "1234567890-20260101-ABCDEF-12-upo.xml"
}

Response 200 β€” PDF​

{
"ksefNumber": "1234567890-20260101-ABCDEF-12",
"referenceNumber": "20260101-AU-XXXXXXXX-XXXX-XX",
"docType": "pdf",
"contentType": "application/pdf",
"content": "JVBERi0xLjQK...",
"fileName": "1234567890-20260101-ABCDEF-12-upo.pdf"
}
Server-side PDF generation

When docType=pdf is requested, the REST API always returns a PDF document. If the KSeF API returns the UPO in XML format (which is the default KSeF behavior), the server automatically converts it to a formatted PDF using pdfmake, including header, document details, and structured layout. This means docType=pdf is always reliable regardless of the native format returned by KSeF.

FieldTypeDescription
ksefNumberstringKSeF invoice number
referenceNumberstringSession reference number
docTypestringxml or pdf
contentTypestringapplication/xml or application/pdf
contentstringBase64-encoded UPO content
fileNamestringSuggested file name

Download UPO error Codes​

CodeDescription
400Invalid docType parameter
401Unauthorized
404UPO not yet available or invoice not found
409KSeF outage or simulation active
502KSeF error