{"id":2,"date":"2024-04-19T09:47:36","date_gmt":"2024-04-19T09:47:36","guid":{"rendered":"http:\/\/ksef24.com\/?page_id=2"},"modified":"2026-03-15T23:29:28","modified_gmt":"2026-03-15T23:29:28","slug":"ksef-dokumentacja-integracyjna-rest-api","status":"publish","type":"page","link":"https:\/\/ksef24.com\/en\/","title":{"rendered":"KSeF REST API"},"content":{"rendered":"<div class=\"wp-block-columns\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\u00a0<\/div>\r\n<\/div><!-- \/wp:columns --><!-- wp:post-content --><p style=\"text-align: right;\">Documentation version: 2.1 (<a href=\"\/en\/ksef-changelog\/\">changelog<\/a>)<\/p>\r\n<p style=\"text-align: right;\">Version date: 2026-03-14<\/p>\r\n<h1 style=\"text-align: center;\">REST API Integration Documentation <br \/>for the National e-Invoice System (KSeF 2.0)<\/h1>\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_75 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ksef24.com\/en\/#Komponenty\" >Components<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ksef24.com\/en\/#Procesy_obslugi_faktur_KSeF\" >KSeF invoice handling processes<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ksef24.com\/en\/#Wygenerowanie_faktury_KSeF_ustrukturyzowanej_zgodnej_ze_schema_FA_v3\" >Generating a KSeF (structured) invoice compliant with the FA_v3 schema<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ksef24.com\/en\/#Wyslanie_faktur_w_sesji_interaktywnej_do_KSeF_i_pobranie_UPO\" >Sending invoices in an interactive session to KSeF and downloading UPO<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ksef24.com\/en\/#Wyszukanie_i_pobranie_faktur_z_KSeF_kosztowych_lub_sprzedazowych\" >Searching and downloading invoices from KSeF (cost or sales)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ksef24.com\/en\/#Pobranie_pojedynczej_faktury_z_KSeF_kosztowej_lub_sprzedazowej\" >Downloading a single invoice from KSeF (cost or sales)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ksef24.com\/en\/#Operacje\" >Operations<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ksef24.com\/en\/#GET\" >GET<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ksef24.com\/en\/#ksefPublicKey\" >ksefPublicKey<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ksef24.com\/en\/#ksefSessionStatus\" >ksefSessionStatus<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ksef24.com\/en\/#ksefSessionClose\" >ksefSessionClose<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/ksef24.com\/en\/#ksefSessionUpo\" >ksefSessionUpo<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceStatus\" >ksefInvoiceStatus<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceGet\" >ksefInvoiceGet<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceQueryStatus\" >ksefInvoiceQueryStatus<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceQueryResult\" >ksefInvoiceQueryResult<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/ksef24.com\/en\/#ksefSessionInvoices\" >ksefSessionInvoices<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/ksef24.com\/en\/#POST\" >POST<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/ksef24.com\/en\/#ksefSessionOpenOnline\" >ksefSessionOpenOnline<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/ksef24.com\/en\/#ksefSessionOpenBatch\" >ksefSessionOpenBatch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceGenerate\" >ksefInvoiceGenerate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/ksef24.com\/en\/#Uwaga_Szczegolowy_opis_klas_i_atrybutow_wejsciowych_dla_operacji_zostal_zamieszczony_na_dedykowanej_podstronie_REST_API_%E2%80%93_generowanie_faktur_KSeF_20\" >Note: A detailed description of the classes and input attributes for the operation is available on the dedicated subpage: REST API \u2013 generating KSeF 2.0 invoices.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceValidate\" >ksefInvoiceValidate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceSend\" >ksefInvoiceSend<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceQueryStart\" >ksefInvoiceQueryStart<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceVisualize\" >ksefInvoiceVisualize<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceLinks\" >ksefInvoiceLinks<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/ksef24.com\/en\/#Parametry\" >Parameters<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/ksef24.com\/en\/#Path\" >Path<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/ksef24.com\/en\/#SessionId\" >SessionId<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/ksef24.com\/en\/#InvoiceId\" >InvoiceId<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/ksef24.com\/en\/#InvoiceKsefNumber\" >InvoiceKsefNumber<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/ksef24.com\/en\/#QueryId\" >QueryId<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/ksef24.com\/en\/#QueryPartNumber\" >QueryPartNumber<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/ksef24.com\/en\/#RequestBody\" >RequestBody<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/ksef24.com\/en\/#KsefInvoiceEncrypted\" >KsefInvoiceEncrypted<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/ksef24.com\/en\/#KsefInvoiceQueryStartRange\" >KsefInvoiceQueryStartRange<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/ksef24.com\/en\/#KsefInvoiceQueryStartRequest\" >KsefInvoiceQueryStartRequest<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/ksef24.com\/en\/#KsefInvoiceSendRequest\" >KsefInvoiceSendRequest<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/ksef24.com\/en\/#KsefSessionOpenOnlineRequest\" >KsefSessionOpenOnlineRequest<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/ksef24.com\/en\/#KsefInvoiceVisualizeRequest\" >KsefInvoiceVisualizeRequest<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-42\" href=\"https:\/\/ksef24.com\/en\/#Enumeracje\" >Enumerations<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-43\" href=\"https:\/\/ksef24.com\/en\/#InvoiceStatus\" >InvoiceStatus<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-44\" href=\"https:\/\/ksef24.com\/en\/#Algorithm\" >Algorithm<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-45\" href=\"https:\/\/ksef24.com\/en\/#KsefInvoiceVersion\" >KsefInvoiceVersion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-46\" href=\"https:\/\/ksef24.com\/en\/#OutputFormat\" >OutputFormat<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-47\" href=\"https:\/\/ksef24.com\/en\/#OutputLanguage\" >OutputLanguage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-48\" href=\"https:\/\/ksef24.com\/en\/#SessionStatus\" >SessionStatus<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-49\" href=\"https:\/\/ksef24.com\/en\/#SubjectType\" >SubjectType<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-50\" href=\"https:\/\/ksef24.com\/en\/#Odpowiedzi_typu_content\" >Content replies<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-51\" href=\"https:\/\/ksef24.com\/en\/#Content\" >Content<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-52\" href=\"https:\/\/ksef24.com\/en\/#ApplicationZipContent\" >ApplicationZipContent<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-53\" href=\"https:\/\/ksef24.com\/en\/#ApplicationOctetStreamContent\" >ApplicationOctetStreamContent<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-54\" href=\"https:\/\/ksef24.com\/en\/#TextXmlContent\" >TextXmlContent<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-55\" href=\"https:\/\/ksef24.com\/en\/#ApplicationPdfContent\" >ApplicationPdfContent<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-56\" href=\"https:\/\/ksef24.com\/en\/#TextHtmlContent\" >TextHtmlContent<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-57\" href=\"https:\/\/ksef24.com\/en\/#Komunikaty_bledow\" >Error messages<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-58\" href=\"https:\/\/ksef24.com\/en\/#Error\" >Error<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-59\" href=\"https:\/\/ksef24.com\/en\/#Autoryzacja_i_szyfrowanie\" >Authorization and encryption<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-60\" href=\"https:\/\/ksef24.com\/en\/#Sesja\" >Session<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-61\" href=\"https:\/\/ksef24.com\/en\/#Faktura\" >Invoice<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-62\" href=\"https:\/\/ksef24.com\/en\/#Wyszukiwanie\" >Search<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Komponenty\"><\/span>Components<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>For the purposes of this documentation, three basic components have been adopted that participate in business processes related to invoice handling within KSeF 2.0:<\/p>\r\n<ul>\r\n<li><a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a><\/li>\r\n<li><a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a><\/li>\r\n<li><a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF 2.0 System<\/a><\/li>\r\n<\/ul>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-10.png\" width=\"1128\" height=\"252\" alt=\"REST API KSeF 2.0 - komponenty\" class=\"wp-image-189 size-full aligncenter\" title=\"REST API KSeF 2.0 - components\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-10.png 1128w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-10-300x67.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-10-1024x229.png 1024w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-10-768x172.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-10-18x4.png 18w\" sizes=\"auto, (max-width: 1128px) 100vw, 1128px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: Components\u00a0<\/p>\r\n<h6><a id=\"post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\"><\/a>Calling system<\/h6>\r\n<p>The client&#039;s IT system that communicates with the KSeF System via the KSEF REST API.<\/p>\r\n<h6><a id=\"post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\"><\/a>National e-Invoice System (KSeF 2.0)<\/h6>\r\n<p><a href=\"https:\/\/ksef.mf.gov.pl\/\">National e-Invoice System<\/a> is a central repository of structured electronic invoices that is managed and maintained by the Ministry of Finance.<\/p>\r\n<h6><a id=\"post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\"><\/a>REST API KSeF 2.0<\/h6>\r\n<p>REST interface providing <a href=\"#post-449-BKM_5F662507_70BF_4E7A_A7F0_5FFC1D1B6F95\">operations (methods)<\/a> enabling comprehensive implementation <a href=\"#post-449-BKM_C9933E96_1B60_4648_AF07_E8A62082F94B\">business processes<\/a> related to the processing of KSeF structured invoices<\/p>\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Procesy_obslugi_faktur_KSeF\"><\/span><a id=\"post-449-PROCESY_OBS\u00a3UGI_FAKTUR_KSEF\"><\/a><a id=\"post-449-BKM_C9933E96_1B60_4648_AF07_E8A62082F94B\"><\/a>KSeF invoice handling processes<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The chapter describes in detail the four main processes related to handling KSeF invoices:<\/p>\r\n<ul>\r\n<li>Generating a KSeF invoice (structured) according to the FA_v3 schema<\/li>\r\n<li>Sending invoices in an interactive session to KSeF and downloading UPO<\/li>\r\n<li>Searching and downloading invoices from KSeF (cost or sales)<\/li>\r\n<li>Downloading a single invoice from KSeF (cost or sales)<\/li>\r\n<\/ul>\r\n<p>The individual steps of each process contain links to operations that must be called to complete a given step.<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Wygenerowanie_faktury_KSeF_ustrukturyzowanej_zgodnej_ze_schema_FA_v3\"><\/span>Generating a KSeF (structured) invoice <br \/>compliant with the FA_v3 schema<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p style=\"text-align: left;\">The purpose of the described process is to enable the generation of a KSeF invoice, the format and structure of which will be consistent with the latest, currently applicable scheme. The process describes a positive scenario and the steps that need to be taken to generate a KSeF structured invoice using the interface <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KseF 2.0<\/a>. Any call to an operation exposed on an interface <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a> may cause an error to be generated. Possible errors resulting from the processing of the request by <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a>, are described in detail in the chapter <a href=\"#post-449-BKM_FB59E57F_F3F5_41DF_90B9_4A86EB621297\">Error messages<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-11.png\" width=\"1017\" height=\"496\" alt=\"REST API KSeF 2.0 - generowanie faktury ustrukturyzowanej (XML) w wersji FA_v3\" class=\"aligncenter wp-image-190 size-full\" title=\"REST API KSeF 2.0 - generating a structured invoice (XML) in version FA_v3\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-11.png 1017w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-11-300x146.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-11-768x375.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-11-18x9.png 18w\" sizes=\"auto, (max-width: 1017px) 100vw, 1017px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: Generating a KSeF structured invoice<\/p>\r\n<p>Description of the process:<\/p>\r\n<p>1. <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a> prepares the request accordingly <a href=\"#post-449-BKM_D0838924_3476_452F_AC1F_E736D36F1362\">KsefInvoiceGenerateRequest<\/a> and calls the method <a href=\"#post-449-BKM_50F79695_ADB8_4A0D_8322_D287CC1E262B\">ksefInvoiceGenerate<\/a>.<\/p>\r\n<p>2. Then <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a> based on the data contained in the request, it generates an invoice XML file consistent with the current (current) version of the schema.<\/p>\r\n<p>3. The generated invoice XML file is returned to <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">calling system<\/a>, which saves the invoice XML file on its side.<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Wyslanie_faktur_w_sesji_interaktywnej_do_KSeF_i_pobranie_UPO\"><\/span><a id=\"post-449-WYS\u00a3ANIE_FAKTUR_W_SESJI_INTERAKTYWNEJ_DO\"><\/a><a id=\"post-449-BKM_6D6ED1D4_1729_4DE3_BFC0_4BC80014765B\"><\/a>Sending invoices in an interactive session to KSeF and downloading UPO<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p style=\"text-align: left;\">The purpose of the described process is to send an invoice (or invoices) to KSeF, to <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">National e-Invoice System<\/a> as part of the created interactive session and downloading the Official Confirmation of Receipt from KSeF confirming the acceptance of the sent invoices by <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a>. The process describes a positive scenario and the steps that need to be taken to send a structured invoice to KSeF using the interface <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a>. Any call to an operation exposed on an interface <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a> may cause an error to be generated. Possible errors resulting from the processing of the request by <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a>, but also <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a> are described in detail in the chapter <a href=\"#post-449-BKM_FB59E57F_F3F5_41DF_90B9_4A86EB621297\">Error messages<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-12.png\" width=\"779\" height=\"1227\" alt=\"REST API KSeF 2.0 - wys\u0142anie faktury ustrukturyzowanej do KSeF i pobranie UPO\" class=\"aligncenter wp-image-191 size-full\" title=\"REST API KSeF 2.0 - sending a structured invoice to KSeF and downloading the UPO\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-12.png 779w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-12-190x300.png 190w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-12-650x1024.png 650w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-12-768x1210.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-12-8x12.png 8w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: Sending invoices in an interactive session to KSeF and downloading UPO<\/p>\r\n<p>Description of the process:<\/p>\r\n<p>1. For each generated <span style=\"text-decoration: underline;\">apart from<\/span> <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF<\/a> invoices, we recommend triggering the operation <a href=\"#post-449-BKM_9BFAFDBE_A342_404F_9DC0_5CBED265ABC4\">ksefInvoiceValidate<\/a> in order to check the correctness of the invoice with the schedule. <br \/><strong>Attention<\/strong>! One of the reasons for rejection of an invoice by KSeF may be non-compliance with the applicable XSD scheme.<\/p>\r\n<p>2. After verifying the correctness of the generated invoices, call the operation <a href=\"#ksefSessionOpenOnline\">ksefSessionOpenOnline<\/a> in order to create an interactive session within which the shipment will be carried out. Details describing the methods and types of session creation, as well as the possibilities associated with them, are described in the chapter describing a given method.<\/p>\r\n<p>3. After successfully establishing an interactive session, <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a> returns the session id (<a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>), which should be saved on the page <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a>, because this ID will be used to trigger other operations.<\/p>\r\n<p>4. Then - before we start sending invoices - check whether the session we previously created is still active. This step is especially important when several minutes have passed since the session was created or the quality of the network connection is poor. To verify session activity, an operation must be invoked <a href=\"#post-449-KSEFSESSIONSTATUS\">ksefSessionStatus<\/a>, and as a call parameter provide the interactive session ID (<a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>).<\/p>\r\n<p>5. If in response to a method call <a href=\"#post-449-KSEFSESSIONSTATUS\">ksefSessionStatus<\/a>, we have received information about the active status of the session, we can start iteratively sending all invoices by calling the operation this many times <a href=\"#post-449-BKM_A746644D_69CD_44A9_98E8_6C12405264CE\">ksefInvoiceSend<\/a>, how many invoices we intend to send to <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF<\/a>. In answer <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a> should return in attribute <a href=\"#post-449-BKM_C03DEBBC_C4C2_493E_BB68_84FA80CDBE1C\">id<\/a>, technical identifier of the invoice (<a href=\"#post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\">InvoiceId<\/a>).<\/p>\r\n<p>6. The returned technical identifier of the invoice (<a href=\"#post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\">InvoiceId<\/a>) should be written on the page <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a>, because this identifier will be used to trigger the operation checking the invoice receipt status (<a href=\"#post-449-BKM_4E604362_F662_48C7_B38C_8BE64F4F0738\">ksefInvoiceStatus<\/a>) sent to <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a>.<\/p>\r\n<p>7. After sending all invoices [5] to KSeF and saving their technical identifiers [6], check the receipt status of each of the sent invoices. To do this, you need to trigger an operation for each sent invoice <a href=\"#post-449-BKM_4E604362_F662_48C7_B38C_8BE64F4F0738\">ksefInvoiceStatus<\/a> with parameter <a href=\"#post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\">InvoiceId<\/a>, containing the technical identifier of the invoice.<\/p>\r\n<p>8. If in response (<a href=\"#post-449-BKM_5A623BA4_65E7_40EB_8218_16C9A3739076\">KsefInvoiceStatusResponse<\/a>) status of a given invoice (<a href=\"#StatusInfo\">StatusInfo<\/a>.code) has a value <strong>200<\/strong>, this means that the invoice has been successfully saved in the KSeF system and we can save the invoice number generated by KSeF (<a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">invoiceKsefNumber<\/a>) and the acquisition date (acquisitionDat<a href=\"#post-449-BKM_0F039184_2427_4648_9D61_26C6B2B346CC\"><\/a>), i.e. the exact date and time of saving <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a>.<\/p>\r\n<p>9. After downloading all KSeF numbers of outstanding invoices (<a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">invoiceKsefNumber<\/a>) you must correctly end the interactive session by calling the operation <a href=\"#post-449-BKM_E969B48C_1604_4449_9C3F_C30D467B7614\">ksefSessionClose<\/a> with parameter <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a> (the session ID returned when it was created in step 3).<\/p>\r\n<p>10. Only after closing the interactive session is it possible to trigger the operation <a href=\"#post-449-BKM_1D26730A_5896_4AD6_8096_B488C2140502\">ksefSessionUpo<\/a>, with parameter <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a> (session identifier returned when creating it in step 3) returning the Official Confirmation of Receipt (UPO). UPO is returned as an object <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a>.<\/p>\r\n<p>11. The last step of the process is to save the downloaded UPO (<a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a>) on the side <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system.<\/a><\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Wyszukanie_i_pobranie_faktur_z_KSeF_kosztowych_lub_sprzedazowych\"><\/span><a id=\"post-449-WYSZUKANIE_I_POBRANIE_FAKTUR_Z_KSEF__KOS\"><\/a><a id=\"post-449-BKM_6533E600_B7A5_4C34_9CB4_9F9540613BF8\"><\/a>Searching and downloading invoices from KSeF (cost or sales)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p style=\"text-align: left;\">The purpose of the described process is to asynchronously search and download found invoices (cost or sales) in <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">National e-Invoice System<\/a>. Individual operations are performed within the created interactive session. The process describes a positive scenario and the steps to be taken to search and download found invoices that meet the defined search criteria. In one call you can search for either your cost invoices or your sales invoices. Any call to an operation exposed on an interface <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a> may cause an error to be generated. Possible errors resulting from the processing of the request by <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a>, but also <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a> are described in detail in the chapter <a href=\"#post-449-BKM_FB59E57F_F3F5_41DF_90B9_4A86EB621297\">Error messages<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-13.png\" width=\"883\" height=\"1007\" alt=\"REST API KSeF 2.0 - wyszukiwanie i pobieranie faktur kosztowych i sprzeda\u017cowych\" class=\"aligncenter wp-image-192 size-full\" title=\"REST API KSeF 2.0 - searching and downloading cost and sales invoices\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-13.png 883w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-13-263x300.png 263w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-13-768x876.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-13-11x12.png 11w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: Searching and downloading invoices from KSeF (cost or sales).<\/p>\r\n<p>Description of the process:<\/p>\r\n<p>1. First of all, you need to prepare the search criteria accordingly (<a href=\"#post-449-BKM_380F543B_A59E_417C_B15F_FBC666DFC45B\">KsefInvoiceQueryStartRequest<\/a>) and initiate the asynchronous fact lookup process by calling the operation <a href=\"#post-449-BKM_085D7653_C47C_4DF3_A9A7_AA3865243668\">ksefInvoiceQueryStart<\/a>.<\/p>\r\n<p>2. After successfully sending your query, <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a> returns the search ID (<a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">QueryId<\/a>), which should be saved on the page <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a>, because this identifier will be used to trigger the operation to check the search status (whether invoices were found) and to download the found invoice packages.<\/p>\r\n<p>3. To check whether any invoices meet the defined search criteria and have been found, you need to call the operation <a href=\"#post-449-BKM_A750875A_D53F_4B2E_9B81_17E7D02A9821\">ksefInvoiceQueryStatus<\/a>. In the returned response <a href=\"#post-449-BKM_BEC9F82F_09FF_4D8B_8793_B3A3605DA235\">KsefInvoiceQueryStatusResponse<\/a>, attribute content <a href=\"#post-449-BKM_B78B9B4A_99E1_4988_A234_6F2125F92269\">items[]<\/a> informs about the number of parcels with found invoices. Each package is identified by a package ID (<a href=\"#post-449-BKM_BC3C4915_1195_411B_B2F3_2E6B406EAB11\">QueryPartNumber<\/a>).<\/p>\r\n<p>4. In order to retrieve invoices that meet the defined search criteria, for each returned batch of invoices (<a href=\"#post-449-BKM_BC3C4915_1195_411B_B2F3_2E6B406EAB11\">QueryPartNumber<\/a>) trigger the operation <a href=\"https:\/\/ksef24.com\/en\/#ksefInvoiceQueryResult\">ksefInvoiceQueryResult<\/a>.<\/p>\r\n<p>5. After downloading all found invoices (all packages), you need to decrypt all downloaded packages.<\/p>\r\n<p>6. Then you need to unpack each downloaded package (ZIP archive) and save it on the site <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a>.<\/p>\r\n<p>7. In order to generate a visualization for the downloaded invoice XML file from KSeF, the following operation should be called for each invoice: <a href=\"#post-449-BKM_EEDE0DC9_EFBD_49F6_B250_A748C985221D\">ksefInvoiceVisualize<\/a>.<\/p>\r\n<p>8. The last step of the process is to save the downloaded file (PDF or HTML) containing the KSeF invoice visualization.<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Pobranie_pojedynczej_faktury_z_KSeF_kosztowej_lub_sprzedazowej\"><\/span><a id=\"post-449-POBRANIE_POJEDYNCZEJ_FAKTURY_Z_KSEF__KOS\"><\/a><a id=\"post-449-BKM_5C12AFD1_8613_4E2E_9C1D_1C0C82FEE014\"><\/a>Downloading a single invoice from KSeF (cost or sales)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p style=\"text-align: left;\">The purpose of the described process is to download a specific invoice (cost or sales) in <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">National e-Invoice System<\/a>. Individual operations are performed within the created interactive session. The process describes the positive scenario and the steps needed to collect a single invoice for which it is known <a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">KSeF invoice number<\/a>. Any call to an operation exposed on an interface <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a> may cause an error to be generated. Possible errors resulting from the processing of the request by <a href=\"#post-449-BKM_8B8E7387_2644_4057_9B27_0DDAFD03F5A8\">REST API KSeF 2.0<\/a>, but also <a href=\"#post-449-BKM_A30627E5_CC2C_43B7_B656_95C94A111764\">KSeF system<\/a> are described in detail in the chapter <a href=\"#post-449-BKM_FB59E57F_F3F5_41DF_90B9_4A86EB621297\">Error messages<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-14.png\" width=\"897\" height=\"548\" alt=\"REST API KSeF 2.0 - obranie pojedynczej faktury (kosztowej lub sprzeda\u017cowej)\" class=\"aligncenter wp-image-194 size-full\" title=\"REST API KSeF 2.0 - selecting a single invoice (cost or sales)\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-14.png 897w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-14-300x183.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-14-768x469.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-14-18x12.png 18w\" sizes=\"auto, (max-width: 897px) 100vw, 897px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: Downloading a single invoice from KSeF (cost or sales).<\/p>\r\n<p>Description of the process:<\/p>\r\n<p>1. In the first step, call the operation <a href=\"#post-449-BKM_E16AE26F_B84A_480B_89C6_95DC926FFEB8\">ksefInvoiceGet<\/a>, one of the parameters of which is the invoice number assigned by KSeF (<a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">InvoiceKsefNumber<\/a>) .<\/p>\r\n<p>2. The downloaded invoice in the form of an XML file should be saved on the page <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a>If we still have any KSeF invoice numbers for which we want to download invoices from KSeF, repeat the steps described in points 1-2.<\/p>\r\n<p>3. Optional step. Depending on your business needs, the final step of the process may be to generate a visualization of the invoice in PDF or HTML format. To do this, you must invoke the operation <a href=\"#post-449-BKM_EEDE0DC9_EFBD_49F6_B250_A748C985221D\">ksefInvoiceVisualize<\/a> and select the appropriate visualization parameters in the request.<\/p>\r\n<p>4. Finally, all that remains is to save the returned invoice visualization on the side <a href=\"#post-449-BKM_270E933B_936D_4A01_BFA2_B7B4829EFCF3\">Calling system<\/a>.\u00a0<\/p>\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Operacje\"><\/span><a id=\"post-449-OPERACJE\"><\/a><a id=\"post-449-BKM_5F662507_70BF_4E7A_A7F0_5FFC1D1B6F95\"><\/a>Operations<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>This chapter describes the methods provided by the KSeF 2.0 REST API.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-15.png\" width=\"669\" height=\"469\" alt=\"REST API KSeF 2.0 - operacje\" class=\"aligncenter wp-image-195 size-full\" title=\"REST API KSeF 2.0 - operations\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-15.png 669w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-15-300x210.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-15-18x12.png 18w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\r\n<p style=\"text-align: center;\">Figure: KSeF 2.0 REST API.<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"GET\"><\/span>GET<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>HTTP GET methods.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefPublicKey\"><\/span><a id=\"post-449-BKM_DA691A51_7832_4BB5_83F4_604D2B065754\"><\/a><a id=\"post-449-BKM_17968CD3_B61C_4A13_8029_9926483007D9\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefPublicKey\">ksefPublicKey<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefPublicKey<\/strong>(): KsefPublicKeyResponse<\/code> The method allows you to download the KSeF public key, which is used to encrypt the AES256 symmetric key used to encrypt transmitted XML invoices using the operation <a href=\"#post-449-BKM_A746644D_69CD_44A9_98E8_6C12405264CE\">ksefInvoiceSend<\/a> in session encryption mode - i.e. the set parameters: <a href=\"#encryptedKey\">encryptedKey<\/a> and <a href=\"#initVector\">initVector<\/a> when creating a session (<a href=\"#post-449-BKM_663A19D5_1CA9_45A4_9D58_95D3B0DAFBCD\">KsefSessionOpenOnlineRequest<\/a>). The method does not require any parameter on the input, and on the output it returns a response consistent with <a href=\"#post-449-BKM_12332196_A513_4F5D_8750_6FFC1E360A5F\">KsefPublicKeyResponse<\/a>.\u00a0<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-17.png\" width=\"607\" height=\"172\" alt=\"REST API KSeF 2.0 - pobranie klucza publicznego KSeF\" class=\"aligncenter wp-image-197 size-full\" title=\"KSeF 2.0 REST API - downloading the KSeF public key\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-17.png 607w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-17-300x85.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-17-18x5.png 18w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/>Diagram: ksefPublicKey Operation<\/p>\r\n<h5><em>Algorithm<\/em><\/h5>\r\n<p>Supported cryptographic key algorithms by KSeF. The enumeration is described in the chapter <a href=\"#post-449-BKM_AA76CC42_39D3_4287_B024_34CF08DF017F\">Algorithm<\/a>.\u00a0<\/p>\r\n<h5><em><a id=\"post-449-BKM_12332196_A513_4F5D_8750_6FFC1E360A5F\"><\/a>KsefPublicKeyResponse<\/em><\/h5>\r\n<p>The class contains the public key of the KSeF system and information about the algorithm according to which it was created.<\/p>\r\n<p><code data-no-translation=\"\"><a id=\"post-449-BKM_CAABDC4E_165C_4DB2_882E_B0821FBD8437\"><\/a><strong>algorithm<\/strong><\/code> : <a href=\"#post-449-BKM_AA76CC42_39D3_4287_B024_34CF08DF017F\">Algorithm<\/a> \u2013 The algorithm according to which the public key was generated<\/p>\r\n<p><a id=\"post-449-BKM_8C6AAFD4_2558_434B_AE6A_3E62FD11DC49\"><\/a><code data-no-translation=\"\"><strong>publicKey<\/strong><\/code> : string \u2013 The public key in the form of the DER encoding of the ASN.1 SubjectPublicKeyInfo object in the form of a base64 string. The KSeF public key is used to encrypt a symmetric key (AES256), which should be generated before creating an encryption session, and then XML invoices sent to KSeF should be encrypted with this symmetric key.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefSessionStatus\"><\/span><a id=\"post-449-KSEFSESSIONSTATUS\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefSessionStatus\">ksefSessionStatus<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefSessionStatus<\/strong>(sessionId : SessionId): KsefSessionStatusResponse<\/code> The method retrieves the current session status. It takes a parameter in the call path (URL). <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>. However, it returns in response <a href=\"#post-449-BKM_B469E2A6_26E8_44DA_910A_F89F7C73C44A\">KsefSessionStatusResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-9.png\" width=\"1219\" height=\"409\" alt=\"KSeF REST API - sprawdzanie statusu sesji\" class=\"aligncenter wp-image-188 size-full\" title=\"KSeF REST API - checking session status\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-9.png 1219w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-9-300x101.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-9-1024x344.png 1024w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-9-768x258.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-9-18x6.png 18w\" sizes=\"auto, (max-width: 1219px) 100vw, 1219px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefSessionStatus Operation<\/p>\r\n<h5><em>SessionId<\/em><\/h5>\r\n<p>The parameter is described in the chapter <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>.\u00a0<\/p>\r\n<h5><em><a id=\"post-449-BKM_B469E2A6_26E8_44DA_910A_F89F7C73C44A\"><\/a>KsefSessionStatusResponse<\/em><\/h5>\r\n<p>A response containing the status of a given interactive or batch session<\/p>\r\n<p><code data-no-translation=\"\"><strong>sessionInfo<\/strong> <\/code>: <a href=\"#SessionInfo\">SessionInfo<\/a> \u2013 One of two possible interactive session statuses defined in the SessionInfo class.<\/p>\r\n<h5 id=\"SessionInfo\"><em>SessionInfo<\/em><\/h5>\r\n<p>The class returns information about the current session status.<\/p>\r\n<p><strong><code data-no-translation=\"\">status <\/code><\/strong>: <a href=\"#StatusInfo\">StatusInfo<\/a> \u2013 A complex attribute that returns detailed information about the current session status.<\/p>\r\n<p><code data-no-translation=\"\"><strong>batch <\/strong><\/code>: boolean \u2013 Value <strong>true<\/strong> attribute means that the given session is a batch session, enabling the sending of invoices in batch mode.<\/p>\r\n<p><code data-no-translation=\"\"><strong>invoiceCount<\/strong><\/code> : int \u2013 The attribute specifies the number of invoices received within the session.<\/p>\r\n<p><code data-no-translation=\"\"><strong>successfulInvoiceCount<\/strong><\/code> : int \u2013 The attribute specifies the number of invoices successfully processed within the session.<\/p>\r\n<p><strong><code data-no-translation=\"\">failedInvoiceCount<\/code><\/strong> : int \u2013 The attribute specifies the number of invoices processed within the session with an error.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefSessionClose\"><\/span><a id=\"post-449-KSEFSESSIONCLOSE\"><\/a><a id=\"post-449-BKM_E969B48C_1604_4449_9C3F_C30D467B7614\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefSessionClose\">ksefSessionClose<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefSessionClose<\/strong>(sessionId : SessionId): KsefSessionCloseResponse<\/code> The method allows you to close an interactive (online) or batch session set up with KSeF. <br \/><strong>Attention<\/strong>! Correct closing of the interactive session is necessary to download the UPO, i.e. an object confirming the invoices received by KSeF. It takes a parameter in the call path (URL). <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>. However, it returns in response <a href=\"#post-449-BKM_C2AC3C9D_2ADE_4B03_B1F1_82B742649FEE\">KsefSessionCloseResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-18.png\" width=\"600\" height=\"132\" alt=\"REST API KSeF 2.0 - zamkni\u0119cie sesji (interaktywnej lub wsadowej)\" class=\"aligncenter wp-image-198 size-full\" title=\"KSeF 2.0 REST API - session closure (interactive or batch)\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-18.png 600w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-18-300x66.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-18-18x4.png 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefSessionClose Operation<\/p>\r\n<h5><em>SessionId<\/em><\/h5>\r\n<p>The parameter is described in the chapter <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>.\u00a0<\/p>\r\n<h5><em><a id=\"post-449-BKM_C2AC3C9D_2ADE_4B03_B1F1_82B742649FEE\"><\/a>KsefSessionCloseResponse<\/em><\/h5>\r\n<p>A response containing information about whether the interactive session was successfully completed<\/p>\r\n<p><code data-no-translation=\"\"><a id=\"post-449-BKM_646D6E4B_DD0B_4686_AA82_259D97612460\"><\/a><strong>result<\/strong> <\/code>: boolean \u2013 A value of True (1) means that the session ended successfully, while a value of False (0) indicates that the session failed to end successfully.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefSessionUpo\"><\/span><a id=\"post-449-KSEFSESSIONUPO\"><\/a><a id=\"post-449-BKM_1D26730A_5896_4AD6_8096_B488C2140502\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefSessionUpo\">ksefSessionUpo<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefSessionUpo<\/strong>(sessionId : SessionId): TextXmlContent<\/code> The method allows you to download the Official Confirmation of Receipt (UPO) for all invoices that were sent as part of a given interactive session combined with KSeF. <br \/><strong>Attention<\/strong>! Before calling the ksefSessionUpo operation, you must properly close the interactive session using the operation <a href=\"#post-449-BKM_E969B48C_1604_4449_9C3F_C30D467B7614\">ksefSessionClose<\/a>. UPO can only be downloaded for a session in which at least one invoice was issued correctly. It takes a parameter in the call path (URL). <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>. In response, the operation returns an object <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a> containing the UPO. Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-19.png\" width=\"768\" height=\"118\" alt=\"REST API KSeF 2.0 - pobranie UPO\" class=\"aligncenter wp-image-199 size-full\" title=\"REST API KSeF 2.0 - UPO download\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-19.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-19-300x46.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-19-18x3.png 18w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefSessionUpo Operation<\/p>\r\n<h5><em>SessionId<\/em><\/h5>\r\n<p>The parameter is described in the chapter <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>.\u00a0<\/p>\r\n<h5><em>TextXmlContent<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a>.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceStatus\"><\/span><a id=\"post-449-KSEFINVOICESTATUS\"><\/a><a id=\"post-449-BKM_4E604362_F662_48C7_B38C_8BE64F4F0738\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceStatus\">ksefInvoiceStatus<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceStatus<\/strong>(invoiceId : InvoiceId): KsefInvoiceStatusResponse<\/code> The method allows you to check the processing status of the invoice sent to KSeF. <br \/><strong>Attention<\/strong>! The method checks the processing status of the invoice sent to KSeF using the operation <a href=\"#post-449-BKM_A746644D_69CD_44A9_98E8_6C12405264CE\">ksefInvoiceSend<\/a>. The input method requires sending a parameter in the call path (URL). <a href=\"#post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\">InvoiceId<\/a>, and on the output it returns an answer consistent with <a href=\"#post-449-BKM_5A623BA4_65E7_40EB_8218_16C9A3739076\">KsefInvoiceStatusResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-20.png\" width=\"1014\" height=\"327\" alt=\"REST API KSeF 2.0 - sprawdzenie statusu wys\u0142anej faktury\" class=\"aligncenter wp-image-200 size-full\" title=\"REST API KSeF 2.0 - checking the status of a sent invoice\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-20.png 1014w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-20-300x97.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-20-768x248.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-20-18x6.png 18w\" sizes=\"auto, (max-width: 1014px) 100vw, 1014px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceStatus Operation<\/p>\r\n<h5><em>InvoiceId<\/em><\/h5>\r\n<p>The class represents the technical identifier of the invoice, which is returned as an attribute <a href=\"#post-449-BKM_C03DEBBC_C4C2_493E_BB68_84FA80CDBE1C\">id<\/a> classes <a href=\"#post-449-BKM_1C28A96A_30E8_4D8E_AEDB_02C85E1EF62D\">KsefInvoiceSendResponse<\/a>, and can then be used to check the invoice processing status by triggering an operation <a href=\"#post-449-BKM_4E604362_F662_48C7_B38C_8BE64F4F0738\">ksefInvoiceStatus<\/a>.<\/p>\r\n<p><code data-no-translation=\"\"><strong>invoiceId<\/strong><\/code> : string \u2013 Invoice ID (technical)<\/p>\r\n<h5><em><a id=\"post-449-BKM_5A623BA4_65E7_40EB_8218_16C9A3739076\"><\/a>KsefInvoiceStatusResponse<\/em><\/h5>\r\n<p>The class represents the response of the KSeF system in the context of the processing status of the invoice sent to KSeF.<\/p>\r\n<p><strong><code data-no-translation=\"\">invoices[]<\/code><\/strong> : <a href=\"#InvoiceInfo\">InvoiceInfo<\/a> \u2013 The attribute contains tables with information describing the status of sent invoices.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceGet\"><\/span><a id=\"post-449-KSEFINVOICEGET\"><\/a><a id=\"post-449-BKM_E16AE26F_B84A_480B_89C6_95DC926FFEB8\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceGet\">ksefInvoiceGet<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceGet<\/strong>(invoiceKsefNumber : InvoiceKsefNumber): KsefInvoiceGetContent<\/code> The method allows you to download a single invoice from KSeF, specifying: <a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">KSeF number of the invoice<\/a>. <br \/>The method requires a parameter to be sent in the call path (URL) on the input <a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">InvoiceKsefNumber<\/a>, and on the output it returns an answer consistent with <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a> if the invoice being downloaded is not encrypted or <a href=\"#post-449-BKM_14FB405A_D772_455F_8B44_3252BB80A3DC\">ApplicationOctetStreamContent<\/a> when downloading an invoice in encrypted form. Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-21.png\" width=\"807\" height=\"308\" alt=\"REST API KSeF 2.0 - pobranie faktury z KSeF (kosztowej lub sprzeda\u017cowej)\" class=\"aligncenter wp-image-201 size-full\" title=\"REST API KSeF 2.0 - downloading an invoice from KSeF (cost or sales)\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-21.png 807w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-21-300x114.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-21-768x293.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-21-18x7.png 18w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceGet Operation<\/p>\r\n<h5><em>InvoiceKsefNumber<\/em><\/h5>\r\n<p>The parameter is described in the chapter <a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">InvoiceKsefNumber<\/a>.<\/p>\r\n<h5><em>Content<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#Content\">Content<\/a>.<\/p>\r\n<h5><em>ApplicationOctetStreamContent<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_14FB405A_D772_455F_8B44_3252BB80A3DC\">ApplicationOctetStreamContent<\/a>.<\/p>\r\n<h5><em>TextXmlContent<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a>.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceQueryStatus\"><\/span><a id=\"post-449-KSEFINVOICEQUERYSTATUS\"><\/a><a id=\"post-449-BKM_A750875A_D53F_4B2E_9B81_17E7D02A9821\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceQueryStatus\">ksefInvoiceQueryStatus<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceQueryStatus<\/strong>(queryId : QueryId): KsefInvoiceQueryStatusResponse<\/code> The method allows you to obtain the search status of invoices in KSeF. <br \/>The input method requires sending a parameter in the call path (URL): <a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">QueryId<\/a>, and on the output it returns an answer consistent with <a href=\"#post-449-BKM_BEC9F82F_09FF_4D8B_8793_B3A3605DA235\">KsefInvoiceQueryStatusResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-22.png\" width=\"668\" height=\"142\" alt=\"REST API KSeF 2.0 - sprawdzenie statusu wyszukiwania faktur\" class=\"aligncenter wp-image-202 size-full\" title=\"REST API KSeF 2.0 - checking the status of invoice search\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-22.png 668w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-22-300x64.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-22-18x4.png 18w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceQueryStatus Operation<\/p>\r\n<h5><em>QueryId<\/em><\/h5>\r\n<p>The class contains a search ID that is generated by KSeF <br \/><code data-no-translation=\"\"><strong>queryId<\/strong><\/code> : string \u2013 Search process ID<\/p>\r\n<h5><em><a id=\"post-449-BKM_BEC9F82F_09FF_4D8B_8793_B3A3605DA235\"><\/a>KsefInvoiceQueryStatusResponse<\/em><\/h5>\r\n<p>The object represents the result of searching for invoices in KSeF<\/p>\r\n<p><code data-no-translation=\"\">numberOfInvoices<\/code> : int \u2013 Total number of returned invoices in the batch.<\/p>\r\n<p><code data-no-translation=\"\">packageSize<\/code> : int \u2013 The size of the packet in bytes to check whether the total sum of all parts is correct after receiving them.<\/p>\r\n<p><code data-no-translation=\"\">isTruncated<\/code> : boolean \u2013 Value <strong>true<\/strong> attribute indicates that the maximum allowable range of query results (10,000) has been reached.<\/p>\r\n<p><code data-no-translation=\"\"><strong>partNumbers[]<\/strong><\/code><strong><\/strong>: string \u2013 The attribute contains an array with package IDs (each package is a ZIP file) of found invoices (<a href=\"#post-449-BKM_BC3C4915_1195_411B_B2F3_2E6B406EAB11\">QueryPartNumber<\/a>) that met the search criteria defined in the class <a href=\"#post-449-BKM_380F543B_A59E_417C_B15F_FBC666DFC45B\">KsefInvoiceQueryStartRequest<\/a>.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceQueryResult\"><\/span><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceQueryResult\">ksefInvoiceQueryResult<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceQueryResult<\/strong>(queryId : QueryId, queryPartNumber : QueryPartNumber): KsefInvoiceQueryResultZipContent<\/code> The method allows you to download all invoices found in KSeF. <br \/><strong>Attention<\/strong>! Calling a method requires a prior call to an operation <a href=\"#post-449-BKM_085D7653_C47C_4DF3_A9A7_AA3865243668\">ksefInvoiceQueryStart<\/a>, which returns the search ID (<a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">QueryId<\/a>). <br \/><strong>Attention<\/strong>! Downloaded invoice packages in ZIP format (identified by <a href=\"#post-449-BKM_BC3C4915_1195_411B_B2F3_2E6B406EAB11\">QueryPartNumber<\/a>), must be decrypted before unpacking. Each package must be decrypted using the symmetric AES256 key (<a href=\"#encryptedKey\">encryptedKey<\/a>), which was generated when creating the session (<a href=\"#ksefSessionOpenOnline\">ksefSessionOpenOnline<\/a>). The input method requires two parameters to be sent in the call path (URL): <a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">QueryId<\/a> and <a href=\"#post-449-BKM_BC3C4915_1195_411B_B2F3_2E6B406EAB11\">QueryPartNumber<\/a>, and on the output it returns an answer consistent with <a href=\"#post-449-BKM_0F091857_5CA9_4A1C_9E5F_B65F98CDF963\">ApplicationZipContent<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-23.png\" width=\"778\" height=\"240\" alt=\"REST API KSeF 2.0 - pobranie wynik\u00f3w wyszukiwania\" class=\"aligncenter wp-image-203 size-full\" title=\"REST API KSeF 2.0 - downloading search results\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-23.png 778w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-23-300x93.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-23-768x237.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-23-18x6.png 18w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceQueryResult Operation<\/p>\r\n<h5><em>QueryId<\/em><\/h5>\r\n<p>The class contains a search ID that is generated by KSeF. <br \/><code data-no-translation=\"\"><strong>queryId<\/strong><\/code> : string \u2013 Search process ID<\/p>\r\n<h5><em>QueryPartNumber<\/em><\/h5>\r\n<p>The class represents the search package number.<\/p>\r\n<p><code data-no-translation=\"\"><strong>partNumber<\/strong><\/code> : string \u2013 Identifier of the fragment (package) of the search result<\/p>\r\n<h5><em>ApplicationZipContent<\/em><\/h5>\r\n<p>The class represents a ZIP archive with KSeF invoices in XML form <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>: string \u2013 = ZIP archive with XML invoices<\/p>\r\n<h4 id=\"ksefSessionInvoices\" style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefSessionInvoices\"><\/span><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefSessionInvoices\">ksefSessionInvoices<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefSessionInvoices<\/strong>(sessionId : SessionId): KsefSessionInvoicesResponse<\/code> The method allows you to check the processing status of all invoices sent to KSeF. <br \/><strong>Attention<\/strong>!The method checks the processing status of invoices sent to KSeF using the operation <a href=\"#KsefSessionOpenBatch\">ksefSessionOpenBatch<\/a>. The input method requires sending a parameter in the call path (URL). <a href=\"#post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\">SessionId<\/a>, and on the output it returns an answer consistent with <a href=\"#KsefSessionInvoicesResponse\">KsefSessionInvoicesResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-24.png\" width=\"978\" height=\"323\" alt=\"REST API KSeF 2.0 - sprawdzenie statusu faktur przes\u0142anych w danej sesji\" class=\"aligncenter wp-image-204 size-full\" title=\"REST API KSeF 2.0 - checking the status of invoices sent in a given session\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-24.png 978w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-24-300x99.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-24-768x254.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-24-18x6.png 18w\" sizes=\"auto, (max-width: 978px) 100vw, 978px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefSessionInvoices Operation<\/p>\r\n<h5 id=\"KsefSessionInvoicesResponse\"><em>KsefSessionInvoicesResponse<\/em><\/h5>\r\n<p><code data-no-translation=\"\">invoices[]<\/code> : <a href=\"#InvoiceInfo\">InvoiceInfo<\/a> \u2013 The attribute contains tables with information describing the status of sent invoices.<\/p>\r\n<h5 id=\"InvoiceInfo\"><em>InvoiceInfo<\/em><\/h5>\r\n<p>The class represents an object containing information about the status of sent invoices.<\/p>\r\n<p><code data-no-translation=\"\">status<\/code> : <a href=\"#StatusInfo\">StatusInfo<\/a> \u2013 The attribute contains complete information describing the invoice status.<\/p>\r\n<p><code data-no-translation=\"\">ordinal<\/code> : string \u2013 The attribute contains the invoice sequence number within the session.<\/p>\r\n<p><code data-no-translation=\"\">invoiceNumber<\/code> : string \u2013 The attribute contains the invoice number.<\/p>\r\n<p><code data-no-translation=\"\">ksefNumber<\/code> : string \u2013 The attribute contains the assigned KSeF number.<\/p>\r\n<p id=\"acquisitionDate\"><code data-no-translation=\"\">acquisitionDate<\/code> : string \u2013 This attribute specifies the exact time the invoice was accepted by the KSeF system (the KSeF number was assigned). The format returned is consistent with date-time.<\/p>\r\n<p><code data-no-translation=\"\">permanentStorageDate<\/code> : string \u2013 Date of permanent storage of the invoice in the KSeF repository. Value completed asynchronously at the time of permanent storage; always later than <a href=\"#acquisitionDate\">acquisitionDate<\/a>. While checking the status, it may not be available yet. Returned format compatible with date-time.<\/p>\r\n<h5 id=\"StatusInfo\"><em>StatusInfo<\/em><\/h5>\r\n<p>The class contains detailed information regarding the status of submitted invoices.<\/p>\r\n<p><code data-no-translation=\"\">code<\/code> : int \u2013 Invoice status code<\/p>\r\n<p><code data-no-translation=\"\">description<\/code> : string \u2013 Verbal description of the invoice status<\/p>\r\n<p><code data-no-translation=\"\">details<\/code> : string \u2013 Additional status details<\/p>\r\n<p><code data-no-translation=\"\">extensions[ ]<\/code> : <a href=\"#StatusInfoAttribute\">StatusInfoAttribute<\/a> \u2013 A collection of additional information related to invoice status, stored as key-value pairs. This allows the model to be extended with case-specific data.<\/p>\r\n<p>The table below contains information on invoice statuses that can be provided by KSeF:<\/p>\r\n<table>\r\n<thead>\r\n<tr>\r\n<th><strong>Code<\/strong><\/th>\r\n<th><strong>Description<\/strong><\/th>\r\n<th><strong>Details<\/strong><\/th>\r\n<th><strong>Extensions<\/strong><\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td>100<\/td>\r\n<td>Invoice accepted for further processing<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>150<\/td>\r\n<td>Processing in progress<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>200<\/td>\r\n<td>Success<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>405<\/td>\r\n<td>Processing canceled due to session error<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>410<\/td>\r\n<td>Incorrect scope of permissions<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>415<\/td>\r\n<td>It is not possible to send an invoice with an attachment<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>430<\/td>\r\n<td>Invoice file verification error<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>435<\/td>\r\n<td>File decryption error<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>440<\/td>\r\n<td>Duplicate invoice<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#039;originalSessionReferenceNumber&#039;, &#039;originalKsefNumber&#039;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>450<\/td>\r\n<td>Invoice document semantics verification error<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>500<\/td>\r\n<td>Unknown error ({statusCode})<\/td>\r\n<td>&#8211;<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>550<\/td>\r\n<td>The operation was canceled by the system<\/td>\r\n<td>Processing was interrupted due to internal system issues. Please try again.<\/td>\r\n<td>&#8211;<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<h5 id=\"StatusInfoAttribute\"><em>StatusInfoAttribute<\/em><\/h5>\r\n<p>The class represents additional information regarding the status of submitted invoices in a key-value format.<\/p>\r\n<p id=\"StatusInfoAttributeKey\"><code data-no-translation=\"\">key<\/code> : string \u2013 The attribute contains the name (key).<\/p>\r\n<p><code data-no-translation=\"\">value<\/code> : string \u2013 The attribute contains the value corresponding to the given key (attribute <a href=\"#StatusInfoAttributeKey\">key<\/a>).<\/p>\r\n<p>&nbsp;<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"POST\"><\/span>POST<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>HTTP POST methods.<\/p>\r\n<h4 id=\"ksefSessionOpenOnline\" style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefSessionOpenOnline\"><\/span><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefSessionOpenOnline\">ksefSessionOpenOnline<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefSessionOpenOnline<\/strong>(invoice : KsefSessionOpenOnlineRequest): KsefSessionOpenOnlineResponse<\/code> The method allows you to set up an interactive session with the KSeF system, thanks to which it will be possible to send invoices to KSeF using the operation <a href=\"#post-449-BKM_A746644D_69CD_44A9_98E8_6C12405264CE\">ksefInvoiceSend<\/a>. The input method requires the creation of a request consistent with <a href=\"#post-449-BKM_663A19D5_1CA9_45A4_9D58_95D3B0DAFBCD\">KsefSessionOpenOnlineRequest<\/a>, and on the output it returns an answer consistent with <a href=\"#post-449-BKM_B38BB36D_B873_4B21_9B57_6700ACD76F46\">KsefSessionOpenOnlineResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-25.png\" width=\"903\" height=\"352\" alt=\"REST API KSeF 2.0 - otwarcie sesji interaktywnej (online)\" class=\"aligncenter wp-image-205 size-full\" title=\"REST API KSeF 2.0 - opening an interactive session (online)\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-25.png 903w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-25-300x117.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-25-768x299.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-25-18x7.png 18w\" sizes=\"auto, (max-width: 903px) 100vw, 903px\" \/><\/p>\r\n<p style=\"text-align: center;\"><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefSessionOpenOnline Operation<\/p>\r\n<h5><em>KsefSessionOpenOnlineRequest<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_663A19D5_1CA9_45A4_9D58_95D3B0DAFBCD\">KsefSessionOpenOnlineRequest<\/a>.<\/p>\r\n<h5><em>EncryptionInfo<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#EncryptionInfo\">EncryptionInfo<\/a>.<\/p>\r\n<h5><em>KsefInvoiceVersion<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#KsefInvoiceVersion\">KsefInvoiceVersion<\/a>.<\/p>\r\n<h5><em><a id=\"post-449-BKM_B38BB36D_B873_4B21_9B57_6700ACD76F46\"><\/a>KsefSessionOpenOnlineResponse<\/em><\/h5>\r\n<p>The response in the case of a correctly created session contains the following attributes:<\/p>\r\n<p><a id=\"post-449-BKM_B4E2F9F2_43E3_4B05_8C85_5888E4A9BACC\"><\/a><code data-no-translation=\"\"><strong>id<\/strong><\/code> : string \u2013 The attribute contains the ID of the created session. This must be written to the calling system as it will be used in most other operations.<\/p>\r\n<p><a id=\"post-449-BKM_70D38C86_7AC4_4917_B36E_8B39AF95A73E\"><\/a><code data-no-translation=\"\"><strong>created<\/strong><\/code> : string \u2013 The attribute contains the date and time of the session creation in date-time format.<\/p>\r\n<h4 id=\"KsefSessionOpenBatch\" style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefSessionOpenBatch\"><\/span><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefSessionOpenBatch\">ksefSessionOpenBatch<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\">ksefSessionOpenBatch(invoice : KsefSessionOpenBatchRequest): KsefSessionOpenBatchResponse<\/code> This method allows you to set up a batch session with the KSeF system, which will allow you to send multiple invoices to KSeF in one batch. The input method requires creating a request consistent with <a href=\"#KsefSessionOpenBatchRequest\">KsefSessionOpenBatchRequest<\/a>, and on the output it returns an answer consistent with <a href=\"#KsefSessionOpenBatchResponse\">KsefSessionOpenBatchResponse<\/a>Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-26.png\" width=\"1211\" height=\"360\" alt=\"REST API KSeF 2.0 - otwarcie sesji wsadowej (batch)\" class=\"aligncenter wp-image-206 size-full\" title=\"REST API KSeF 2.0 - opening a batch session\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-26.png 1211w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-26-300x89.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-26-1024x304.png 1024w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-26-768x228.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-26-18x5.png 18w\" sizes=\"auto, (max-width: 1211px) 100vw, 1211px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefSessionOpenBatch Operation<\/p>\r\n<h5 id=\"KsefSessionOpenBatchRequest\"><em>KsefSessionOpenBatchRequest<\/em><\/h5>\r\n<p>The class represents input attributes for batch session opening operations.<\/p>\r\n<p><code data-no-translation=\"\">invoiceVersion<\/code> :\u00a0<a href=\"#post-449-BKM_A99F02C7_8367_44FB_9233_EDEF13514E5D\">KsefInvoiceVersion<\/a> \u2013 One of two possible versions of the schema defined in the enum <a href=\"#post-449-BKM_A99F02C7_8367_44FB_9233_EDEF13514E5D\">KsefInvoiceVersion<\/a>Due date: [1]<\/p>\r\n<p><code data-no-translation=\"\">encryptionInfo<\/code> : <a href=\"#EncryptionInfo\">EncryptionInfo<\/a> \u2013 The type is described in the chapter <a href=\"#EncryptionInfo\">EncryptionInfo<\/a>Due date: [1]<\/p>\r\n<p><code data-no-translation=\"\">offline<\/code> : boolean \u2013 This attribute specifies whether the invoices sent are issued offline24. Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">batchInfo<\/code> : BatchInfo \u2013 The type is described in the chapter <a href=\"#BatchInfo\">BatchInfo<\/a>Due date: [1]<\/p>\r\n<h5 id=\"BatchInfo\"><em>BatchInfo<\/em><\/h5>\r\n<p>The class represents information describing a batch of invoices being sent.<\/p>\r\n<p><code data-no-translation=\"\">batchSize<\/code> : int \u2013 Attribute specifying the size of the entire package. Package file size in bytes. Required: [1]. Maximum package size is 5GB. Range: <span><span class=\"sc-Nxspf sc-fxwrCY lmPAIU jExHJM\">[1 .. 5000000000]<\/span><\/span><\/p>\r\n<p><code data-no-translation=\"\">batchHash<\/code> : string \u2013 An attribute containing the hash (hash function) of the entire package, encoded in Base64 format. Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">batchParts<\/code>: <a href=\"#BatchPartInfo\">BatchPartInfo<\/a> \u2013 An array type attribute containing information about specific parts of the package. The type is described in the chapter <a href=\"#BatchPartInfo\">BatchPartInfo<\/a>. Required: [1]. Maximum number of parts is 50. Scope: <span><span class=\"sc-Nxspf sc-fxwrCY lmPAIU jExHJM\">[1 .. 50]. The maximum allowed part size before encryption is 100MB.<\/span><\/span><\/p>\r\n<h5 id=\"BatchPartInfo\"><em>BatchPartInfo<\/em><\/h5>\r\n<p>A class represents a given part of a package.<\/p>\r\n<p><code data-no-translation=\"\">ordinal<\/code>: int \u2013 An ordinal attribute indicating the next part number of the package. Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">partSize<\/code>: int \u2013 An attribute specifying the size of a parcel part. Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">partHash<\/code>: string \u2013 An attribute containing the hash (hash function) of a given part of the package, encoded in Base64 format. Required: [1]<\/p>\r\n<h5 id=\"KsefSessionOpenBatchResponse\"><em>KsefSessionOpenBatchResponse<\/em><\/h5>\r\n<p>The class represents the response returned after a successful batch session setup.\u00a0<\/p>\r\n<h5><em>PartUploadInfo<\/em><\/h5>\r\n<p><code data-no-translation=\"\">ordinal<\/code> : int \u2013 Ordering attribute, specifies part of the package file.<\/p>\r\n<p><code data-no-translation=\"\">method<\/code> : string \u2013 HTTP method to use when sending part of the package file.<\/p>\r\n<p><code data-no-translation=\"\">url<\/code> : string \u2013 Address to which part of the package file should be sent.<\/p>\r\n<p><code data-no-translation=\"\">headers<\/code> : <a href=\"#PartUploadHeader\">PartUploadHeader<\/a> \u2013 The array type attribute, which was described in the chapter <a href=\"#PartUploadHeader\">PartUploadHeader<\/a>.<\/p>\r\n<h5 id=\"PartUploadHeader\"><em>PartUploadHeader<\/em><\/h5>\r\n<p>The class represents the header to be used when sending part of the package file.<\/p>\r\n<p><code data-no-translation=\"\">name<\/code> : string \u2013 Header name<\/p>\r\n<p><code data-no-translation=\"\">value<\/code> : string \u2013 Header value<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceGenerate\"><\/span><a id=\"post-449-KSEFINVOICEGENERATE\"><\/a><a id=\"post-449-BKM_50F79695_ADB8_4A0D_8322_D287CC1E262B\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceGenerate\">ksefInvoiceGenerate<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceGenerate<\/strong>(ksefInvoiceGenerateRequest : KsefInvoiceGenerateRequest): KsefInvoiceGenerateResponse<\/code> A method that allows you to generate an XML structured invoice that is compliant with the current (up-to-date) version of the schema used in KSeF. Click on the operation name to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Uwaga_Szczegolowy_opis_klas_i_atrybutow_wejsciowych_dla_operacji_zostal_zamieszczony_na_dedykowanej_podstronie_REST_API_%E2%80%93_generowanie_faktur_KSeF_20\"><\/span><strong>Attention<\/strong>! A detailed description of the input classes and attributes for the operation is available on a dedicated subpage: <a href=\"\/en\/ksef-rest-api-generowanie-faktur\/\">REST API \u2013 generating KSeF 2.0 invoices<\/a>.<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-651\" src=\"https:\/\/ksefapi.pl\/wp-content\/uploads\/2024\/04\/15.png\" alt=\"KSeF REST API - generowanie faktury\" width=\"556\" height=\"80\" \/>Diagram: ksefInvoiceGenerate operation<\/p>\r\n<h5><em><a id=\"post-449-BKM_D0838924_3476_452F_AC1F_E736D36F1362\"><\/a>KsefInvoiceGenerateRequest<\/em><\/h5>\r\n<p>The class represents input attributes describing the KSeF invoice. The class is described in detail in the chapter <a href=\"\/en\/ksef-rest-api-generowanie-faktur\/#KsefInvoiceGenerateRequest\">KsefInvoiceGenerateRequest<\/a>.<\/p>\r\n<h5><em><a id=\"post-449-BKM_BE083D7B_7D88_4483_8750_324FF0889975\"><\/a>KsefInvoiceGenerateResponse<\/em><\/h5>\r\n<p>The class represents the response returned by the operation <a href=\"#post-449-BKM_50F79695_ADB8_4A0D_8322_D287CC1E262B\">ksefInvoiceGenerate<\/a>, which contains a generated KSeF invoice compliant with the KSeF schema. The class is described in detail in the chapter <a href=\"\/en\/ksef-rest-api-generowanie-faktur\/#KsefInvoiceGenerateResponse\">KsefInvoiceGenerateResponse<\/a>.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceValidate\"><\/span><a id=\"post-449-KSEFINVOICEVALIDATE\"><\/a><a id=\"post-449-BKM_9BFAFDBE_A342_404F_9DC0_5CBED265ABC4\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceValidate\">ksefInvoiceValidate<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceValidate<\/strong>(ksefInvoice : KsefInvoice): KsefInvoiceValidateResponse<\/code> The method enables verification of the KSeF invoice for compliance with the scheme. An object must be sent as a parameter for calling the operation <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a> containing the generated KSeF invoice. An external tool or operation can be used to generate an invoice <a href=\"#post-449-BKM_50F79695_ADB8_4A0D_8322_D287CC1E262B\">ksefInvoiceGenerate<\/a>. In response, the operation returns an object <a href=\"#post-449-BKM_9EE0569D_8FC8_4DBA_8884_7420EF52505D\">KsefInvoiceValidateResponse<\/a> with information about the schema version in which the invoice was generated and whether it is compatible with this structure. Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-27.png\" width=\"955\" height=\"299\" alt=\"REST API KSeF - walidacja pliku XML faktury ustrukturyzowanej\" class=\"aligncenter wp-image-207 size-full\" title=\"REST API KSeF - validation of the XML file of a structured invoice\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-27.png 955w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-27-300x94.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-27-768x240.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-27-18x6.png 18w\" sizes=\"auto, (max-width: 955px) 100vw, 955px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceValidate Operation<\/p>\r\n<h5><em>TextXmlContent<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\">TextXmlContent<\/a>.<\/p>\r\n<h5><em><a id=\"post-449-BKM_9EE0569D_8FC8_4DBA_8884_7420EF52505D\"><\/a>KsefInvoiceValidateResponse<\/em><\/h5>\r\n<p>A response containing information about the version of the schema in which the sent KSeF invoice was generated and whether it is compatible with this schema. <br \/><code data-no-translation=\"\"><strong>invoiceVersion<\/strong><\/code> : <a href=\"#KsefInvoiceVersion\">KsefInvoiceVersion<\/a> \u2013 One of the supported schema versions defined in the enum <a href=\"#KsefInvoiceVersion\">KsefInvoiceVersion<\/a>.<\/p>\r\n<p><code data-no-translation=\"\"><strong>valid<\/strong><\/code> : boolean \u2013 The value True (1) means that the invoice sent for verification complies with the schema, and if inconsistency of the invoice XML file with the schema is detected, the Http code and the object are returned <a href=\"#post-449-BKM_10DB3E1E_4E99_4AE7_B63C_11FF70E9C13B\">Error<\/a> with a description of the first detected schema non-compliance error in the attribute <a href=\"#post-449-BKM_332861F1_6F93_490C_9977_2A6D30C258D8\">details<\/a>.<\/p>\r\n<p><code data-no-translation=\"\">canonicalForm<\/code> : string \u2013 This attribute contains the canonical form of the invoice submitted for validation. The value is encoded using Base64.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceSend\"><\/span><a id=\"post-449-KSEFINVOICESEND\"><\/a><a id=\"post-449-BKM_A746644D_69CD_44A9_98E8_6C12405264CE\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceSend\">ksefInvoiceSend<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceSend<\/strong>(invoice : KsefInvoiceSendRequest): KsefInvoiceSendResponse<\/code> This method allows you to send a single invoice to the KSeF system as part of a set interactive session. Click on the operation name to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<br \/><strong>Attention<\/strong>! The method can be called any number of times within a set session and thus send more invoices to KSeF. <strong><br \/>Attention<\/strong>! To send invoices to KSeF using this method, the operation must be triggered first <a href=\"#ksefSessionOpenOnline\">ksefSessionOpenOnline<\/a> in order to set up an interactive session. The input method requires the creation of a request consistent with <a href=\"#KsefInvoiceSendRequest\">KsefInvoiceSendRequest<\/a>, and on the output it returns an answer consistent with <a href=\"#post-449-BKM_1C28A96A_30E8_4D8E_AEDB_02C85E1EF62D\">KsefInvoiceSendResponse<\/a>.\u00a0<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-28.png\" width=\"815\" height=\"311\" alt=\"REST API KSeF 2.0 - wys\u0142anie faktury ustrukturyzowanej do KSeF\" class=\"aligncenter wp-image-209 size-full\" title=\"REST API KSeF 2.0 - sending a structured invoice to KSeF\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-28.png 815w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-28-300x114.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-28-768x293.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-28-18x7.png 18w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceSend Operation<\/p>\r\n<h5><a id=\"post-449-BKM_2DF5E4BB_F801_4566_A088_CF9A6D2C8007\"><\/a><em>KsefInvoiceSendRequest<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#KsefInvoiceSendRequest\">KsefInvoiceSendRequest<\/a>.<\/p>\r\n<h5><em>KsefInvoiceEncrypted<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#KsefInvoiceEncrypted\">KsefInvoiceEncrypted<\/a>.<\/p>\r\n<h5><em><a id=\"post-449-BKM_1C28A96A_30E8_4D8E_AEDB_02C85E1EF62D\"><\/a>KsefInvoiceSendResponse<\/em><\/h5>\r\n<p>The class represents the response received from KSeF in the event of a successful invoice submission. <br \/><strong>Attention<\/strong>! The response informs that the invoice has been successfully sent to KSeF, but to make sure that the invoice has been correctly saved in KSeF, the operation must be called <a href=\"#post-449-BKM_4E604362_F662_48C7_B38C_8BE64F4F0738\">ksefInvoiceStatus<\/a>, one of the input parameters is <a href=\"#post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\">technical identifier of the invoice<\/a> returned as an attribute value <a href=\"#post-449-BKM_C03DEBBC_C4C2_493E_BB68_84FA80CDBE1C\">id<\/a>. <br \/><code data-no-translation=\"\"><a id=\"post-449-BKM_E3583970_16D0_4D19_A513_9F7E6A70164A\"><\/a><strong>created<\/strong> <\/code>: string \u2013 The attribute contains information about the exact date and time of sending the invoice to KSeF <br \/><code data-no-translation=\"\"><a id=\"post-449-BKM_C03DEBBC_C4C2_493E_BB68_84FA80CDBE1C\"><\/a><strong>id<\/strong> <\/code>:string \u2013 Attribute contains <a href=\"#post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\">technical identifier of the invoice<\/a> sent to KSeF<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceQueryStart\"><\/span><a id=\"post-449-KSEFINVOICEQUERYSTART\"><\/a><a id=\"post-449-BKM_085D7653_C47C_4DF3_A9A7_AA3865243668\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceQueryStart\">ksefInvoiceQueryStart<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceQueryStart <\/strong>(KsefInvoiceQueryStartRequest : KsefInvoiceQueryStartRequest): KsefInvoiceQueryStartResponse<\/code> This method allows you to define and send invoice search criteria to KSeF. Click on the operation name to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<br \/><strong>Attention<\/strong>! Calling the method requires previously opening an interactive session using the operation <a href=\"#ksefSessionOpenOnline\">ksefSessionOpenOnline<\/a>. The input method requires sending a request consistent with <a href=\"#post-449-BKM_380F543B_A59E_417C_B15F_FBC666DFC45B\">KsefInvoiceQueryStartRequest<\/a>. The method returns an object compatible with <a href=\"#post-449-BKM_2965E670_555F_4AD5_A22A_70C4AE897D00\">KsefInvoiceQueryStartResponse<\/a>, which contains <a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">search ID<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-29.png\" width=\"913\" height=\"344\" alt=\"REST API KSeF 2.0 - wyszukaj faktury kosztowe lub sprzeda\u017cowe\" class=\"aligncenter wp-image-210 size-full\" title=\"REST API KSeF 2.0 - search for cost or sales invoices\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-29.png 913w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-29-300x113.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-29-768x289.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-29-18x7.png 18w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceQueryStart operation<\/p>\r\n<h5><em>KsefInvoiceQueryStartRequest<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_380F543B_A59E_417C_B15F_FBC666DFC45B\">KsefInvoiceQueryStartRequest<\/a>.<\/p>\r\n<h5><em>SubjectType<\/em><\/h5>\r\n<p>The enumeration is described in the chapter <a href=\"#SubjectType\">SubjectType<\/a>.\u00a0<\/p>\r\n<h5><em>KsefInvoiceQueryStartRange<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_A4AA4DAB_30D5_45CC_BF4A_818BF2ED74B6\">KsefInvoiceQueryStartRange<\/a>.<\/p>\r\n<h5><em><a id=\"post-449-BKM_2965E670_555F_4AD5_A22A_70C4AE897D00\"><\/a>KsefInvoiceQueryStartResponse<\/em><\/h5>\r\n<p>The object represents a response from the KSeF system containing <a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">search ID<\/a>, which search was run asynchronously on the KSeF side. <br \/><a id=\"post-449-BKM_3A272247_1DAF_4F57_AC28_F795A0BF7649\"><\/a><code data-no-translation=\"\"><strong>queryId<\/strong><\/code> :string \u2013 Attribute specifies <a href=\"#post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\">search ID<\/a>, which is generated by KSeF.<\/p>\r\n<h4 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceVisualize\"><\/span><a id=\"post-449-KSEFINVOICEVISUALIZE\"><\/a><a id=\"post-449-BKM_EEDE0DC9_EFBD_49F6_B250_A748C985221D\"><\/a><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceVisualize\">ksefInvoiceVisualize<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\"><strong>ksefInvoiceVisualize<\/strong>(KsefInvoiceVisualizeRequest : KsefInvoiceVisualizeRequest): KsefInvoiceVisualizeContent<\/code> A method that allows you to generate an XML structured invoice visualization in one of the following formats: HTML and PDF. The input method requires preparation of the request according to <a href=\"#post-449-BKM_971DE727_C4DE_4C3F_A3B6_94318FC8866B\">KsefInvoiceVisualizeRequest<\/a>, and returns an object of type in response <a href=\"#post-449-BKM_A98BD425_F9DF_41D1_9D4A_6520F08ED831\">TextHtmlContent<\/a> for HTML visualization either <a href=\"#post-449-BKM_B4C5AFC5_C4FA_4E6C_AD88_49F26B7AF795\">ApplicationPdfContent<\/a> for visualization in a PDF file. Click on the name of the operation to go to <strong><a href=\"https:\/\/ksefapi.pl\/public\/rest\/\">Swagger UI<\/a><\/strong>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-30.png\" width=\"973\" height=\"406\" alt=\"REST API KSeF 2.0 - wizualizacja faktury\" class=\"aligncenter wp-image-211 size-full\" title=\"REST API KSeF 2.0 - invoice visualization\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-30.png 973w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-30-300x125.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-30-768x320.png 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-30-18x8.png 18w\" sizes=\"auto, (max-width: 973px) 100vw, 973px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceVisualize Operation<\/p>\r\n<h5><em>KsefInvoiceVisualizeRequest<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#post-449-BKM_971DE727_C4DE_4C3F_A3B6_94318FC8866B\">KsefInvoiceVisualizeRequest<\/a>.<\/p>\r\n<h5><em>OutputFormat<\/em><\/h5>\r\n<p>The enumeration is described in the chapter <a href=\"#post-449-BKM_228F709D_A191_4EC3_B3D0_1E5C58CBE49E\">OutputFormat<\/a>.<\/p>\r\n<h5><em>OutputLanguage<\/em><\/h5>\r\n<p>The enumeration is described in the chapter <a href=\"#post-449-BKM_D4CAA4F7_067E_4E52_817E_931699AB95DE\">OutputLanguage<\/a>.<\/p>\r\n<h5><em>Content<\/em><\/h5>\r\n<p>The class is described in the chapter <a href=\"#Content\">Content<\/a>.<\/p>\r\n<h5><em>ApplicationPdfContent<\/em><\/h5>\r\n<p>The class represents the generated visualization of the KSeF invoice in the form of a PDF file. <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>: string \u2013 = PDF visualization<\/p>\r\n<h5><em>TextHtmlContent<\/em><\/h5>\r\n<p>The class represents the generated visualization of the KSeF invoice in the form of an HTML file. <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>: string<a id=\"post-449-Att.Scope.Start\"><\/a> &#8211; <a id=\"post-449-Att.Const.End\"><\/a> = HTML visualization<\/p>\r\n<h4 id=\"ksefInvoiceLinks\" style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"ksefInvoiceLinks\"><\/span><a href=\"https:\/\/ksefapi.pl\/public\/rest\/#\/invoice\/ksefInvoiceLinks\">ksefInvoiceLinks<\/a><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p><code data-no-translation=\"\">ksefInvoiceLinks(KsefInvoiceLinksRequest : KsefInvoiceLuinksRequest): KsefInvoiceLinksResponse<\/code>A method for generating links and QR codes. The operation accepts the necessary invoice metadata as input, such as the seller&#039;s Tax Identification Number (NIP), issue date, a sha256 hash from the invoice&#039;s XML, and optionally, the invoiceKsefNumber. In response, the operation returns a link and QR code for downloading the invoice. If the invoiceKsefNumber is not provided (indicating OFFLINE mode), the operation also returns a second link and QR code with an offline signature. Click the operation name to access the Swagger UI.<\/p>\r\n<p style=\"text-align: center;\"><a href=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/03\/ksefInvoiceLinks.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/03\/ksefInvoiceLinks.jpg\" alt=\"Ksef Links and QR Code\" width=\"985\" height=\"396\" class=\"alignnone wp-image-275 size-full\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/03\/ksefInvoiceLinks.jpg 985w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/03\/ksefInvoiceLinks-300x121.jpg 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/03\/ksefInvoiceLinks-768x309.jpg 768w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/03\/ksefInvoiceLinks-18x7.jpg 18w\" sizes=\"auto, (max-width: 985px) 100vw, 985px\" \/><\/a><\/p>\r\n<p style=\"text-align: center;\">Diagram: ksefInvoiceLinks Operation<\/p>\r\n<h5><em>KsefInvoiceLinksRequest<\/em><\/h5>\r\n<p>The class represents the request necessary to retrieve generated links and QR codes.\u00a0<br \/><code data-no-translation=\"\">nip<\/code>: string \u2013 Seller&#039;s Subscriber Identification Number. Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">issueDate<\/code>: datetime \u2013 Date of issue of the KSeF structured invoice. Due date: [1]<\/p>\r\n<p><code data-no-translation=\"\">invoiceHash<\/code>: string \u2013 Hash value from the KSeF structured invoice (XML). Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">invoiceKsefNumber<\/code>: string \u2013 Attribute described in the InvoiceKsefNumber chapter. Requirement: [0..1]<\/p>\r\n<h5><em>KsefInvoiceLinksResponse<\/em><\/h5>\r\n<p>The class represents a response containing generated links to download a KseF invoice issued in ONLINE or OFFLINE mode. If in the class <code data-no-translation=\"\">KsefInvoiceLinksRequest<\/code>, was not given <code data-no-translation=\"\">invoiceKsefNumber<\/code>, (which means that the invoice was issued in OFFLINE mode), the second attribute is also returned (<code data-no-translation=\"\">certificate<\/code>) containing a link and a QR code with the signature OFFLINE.<\/p>\r\n<p><code data-no-translation=\"\">invoice<\/code>: KsefQrCode \u2013 Attribute described in the KsefQrCode chapter. Returns the link and QR code necessary to download the invoice. Required: [1].<\/p>\r\n<p><code data-no-translation=\"\">certificate<\/code>: KsefQrCode \u2013 Attribute described in the KsefQrCode chapter. Returns a link and a QR code with the OFFLINE signature. Required: [0..1].<\/p>\r\n<h5><em>KsefQrCode<\/em><\/h5>\r\n<p>The class contains a link and a QR code to download the KSeF invoice.<\/p>\r\n<p><code data-no-translation=\"\">image<\/code>: string \u2013 QR code to download the invoice<\/p>\r\n<p><code data-no-translation=\"\">link<\/code>: string \u2013 Link to download the invoice<\/p>\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Parametry\"><\/span><a id=\"post-449-PARAMETRY\"><\/a><a id=\"post-449-BKM_4050067F_D17B_4C47_9E37_765376AE8406\"><\/a>Parameters<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The chapter contains a summary of all parameters by type:<\/p>\r\n<ul>\r\n<li>path \u2013 parameter passed in the URL path<\/li>\r\n<li>requestBody \u2013 parameter passed in the request body<\/li>\r\n<\/ul>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-31.png\" width=\"753\" height=\"817\" alt=\"REST API KSeF 2.0 - parametry\" class=\"aligncenter wp-image-212 size-full\" title=\"REST API KSeF 2.0 - parameters\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-31.png 753w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-31-276x300.png 276w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-31-11x12.png 11w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/p>\r\n<p style=\"text-align: center;\">\u00a0Diagram: Parameters<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Path\"><\/span>Path<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Parameters for calling the operation included in the path.<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"SessionId\"><\/span><a id=\"post-449-BKM_5FDFF597_22B9_49D7_BD55_5B0A5A057D46\"><\/a><em>SessionId<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents the session ID generated by the KSEF system <br \/><a id=\"post-449-BKM_BB12D693_5AA3_4D52_BAFD_9638B04BDE6F\"><\/a><code data-no-translation=\"\"><strong>sessionId<\/strong><\/code> : string \u2013 Unique session identifier<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"InvoiceId\"><\/span><em><a id=\"post-449-BKM_F42656AB_ADAE_4E26_B039_484273B3C51A\"><\/a>InvoiceId<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents the technical identifier of the invoice, which is returned as an attribute <a href=\"#post-449-BKM_C03DEBBC_C4C2_493E_BB68_84FA80CDBE1C\">id<\/a> classes <a href=\"#post-449-BKM_1C28A96A_30E8_4D8E_AEDB_02C85E1EF62D\">KsefInvoiceSendResponse<\/a>, and can then be used to check the invoice processing status by triggering an operation <a href=\"#post-449-BKM_4E604362_F662_48C7_B38C_8BE64F4F0738\">ksefInvoiceStatus.<\/a> <br \/><a id=\"post-449-BKM_8331B5B0_7855_4C5F_A2F8_6B21FCA07298\"><\/a><code data-no-translation=\"\"><strong>invoiceId<\/strong><\/code> : string \u2013 Invoice ID (technical)<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"InvoiceKsefNumber\"><\/span><em><a id=\"post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\"><\/a>InvoiceKsefNumber<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>KSeF invoice number generated by KSeF. <br \/><code data-no-translation=\"\"><a id=\"post-449-BKM_154AFA1C_9D0C_4C75_AAD7_29BB63423C6E\"><\/a><strong>invoiceKsefNumber<\/strong> <\/code>: string \u2013 Generated by KSeF Invoice ID. Generating this identifier confirms saving the sent invoice in KSeF.<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"QueryId\"><\/span><em><a id=\"post-449-BKM_5EDA1BCB_C6D9_4C25_8D89_4EBC94C91214\"><\/a>QueryId<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class contains a search ID that is generated by KSeF. <br \/><a id=\"post-449-BKM_5ED45ACC_8176_4DA5_85DD_F8C3EAE2FC4B\"><\/a><code data-no-translation=\"\"><strong>queryId<\/strong><\/code> : string \u2013 Search process ID<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"QueryPartNumber\"><\/span><em><a id=\"post-449-BKM_BC3C4915_1195_411B_B2F3_2E6B406EAB11\"><\/a>QueryPartNumber<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents the search package number. <br \/><a id=\"post-449-BKM_4D45BFA7_7251_4801_A2B2_7D9CE337DEE7\"><\/a><code data-no-translation=\"\"><strong>partNumber<\/strong><\/code> : string \u2013 Identifier of the fragment (package) of the search result<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"RequestBody\"><\/span>RequestBody<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Parameters of type requestBody.<\/p>\r\n<h4 id=\"KsefInvoiceEncrypted\"><span class=\"ez-toc-section\" id=\"KsefInvoiceEncrypted\"><\/span><em>KsefInvoiceEncrypted<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The object represents the transmitted invoice in encrypted form.<br \/><a id=\"post-449-BKM_713C307A_E504_4167_951E_FC2B6BD04566\"><\/a><code data-no-translation=\"\">encryptedInvoice<\/code> : string \u2013 Attribute containing the invoice XML file in encrypted form, which is sent to KSeF. The invoice XML file is encrypted with the AES256 algorithm using an initialization vector (attribute <a href=\"#initVector\">initVector<\/a> classes <a href=\"#post-449-BKM_663A19D5_1CA9_45A4_9D58_95D3B0DAFBCD\">KsefSessionOpenOnlineRequest<\/a>) and the symmetric key generated when creating the session. <br \/><a id=\"post-449-BKM_FF7AC31E_AA3C_43C4_8B5A_69CD0DAAD3BD\"><\/a><code data-no-translation=\"\"><strong>invoiceHash<\/strong><\/code> : string \u2013 The attribute contains the hash value from the SHA256 function from the original (unencrypted) XML form of the invoice, which is sent to KSeF.<br \/><a id=\"post-449-BKM_57CB7FB1_75D9_486F_A485_7C9A09FCDB3C\"><\/a><code data-no-translation=\"\"><strong>invoiceSize<\/strong><\/code> : int \u2013 Attribute containing the calculated size of the invoice (size in bytes of the original, unencrypted XML form of the invoice), which is sent to KSeF.<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"KsefInvoiceQueryStartRange\"><\/span><a id=\"post-449-BKM_A4AA4DAB_30D5_45CC_BF4A_818BF2ED74B6\"><\/a><em>KsefInvoiceQueryStartRange<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents the period for which invoices are to be searched. Dates <code data-no-translation=\"\">from<\/code> and <code data-no-translation=\"\">to<\/code>, specify the date <code data-no-translation=\"\">PermanentStorage<\/code>, i.e. the date of permanent recording of the invoice in the KSeF system repository. For incremental invoice downloading, it is necessary to use the date type <code data-no-translation=\"\">PermanentStorage<\/code>, which ensures data reliability. It marks the moment of permanent record materialization, is resistant to asynchronous delays in the data reception process, and allows for the safe definition of incremental windows.<br \/><code data-no-translation=\"\"><strong>from<\/strong><\/code> : string \u2013 Date from which invoices will be searched. <br \/><code data-no-translation=\"\"><strong>to<\/strong><\/code> : string \u2013 Date up to which invoices will be searched.<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"KsefInvoiceQueryStartRequest\"><\/span><a id=\"post-449-BKM_380F543B_A59E_417C_B15F_FBC666DFC45B\"><\/a><em>KsefInvoiceQueryStartRequest<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents a request that allows you to define search parameters.<\/p>\r\n<p><code data-no-translation=\"\"><strong>range<\/strong> <\/code>: <a href=\"#KsefInvoiceQueryStartRange\">KsefInvoiceQueryStartRange<\/a> \u2013 Select the period for which invoices should be searched. Required: [1]<strong>.<br \/><\/strong><code data-no-translation=\"\">encryptionInfo<\/code> : <a href=\"#EncryptionInfo\">EncryptionInfo<\/a> \u2013 The type is described in the chapter <a href=\"#EncryptionInfo\">EncryptionInfo<\/a>. Due date: [1].<br \/><code data-no-translation=\"\"><strong>subjectType<\/strong><\/code> : <a href=\"#SubjectType\">SubjectType<\/a> \u2013 Specify what type of invoice we are searching for. Required: [1]:<\/p>\r\n<ul>\r\n<li>sales (Subject1),<\/li>\r\n<li>cost (Subject2),<\/li>\r\n<li>third party (Subject3),<\/li>\r\n<li>Subject Authorized<\/li>\r\n<\/ul>\r\n<h5 id=\"SubjectType\"><em>SubjectType<\/em><\/h5>\r\n<p>The enumeration specifies the possible types of the entity <br \/><code data-no-translation=\"\"><strong>Subject1<\/strong><\/code> : \u2013 The attribute denotes the entity issuing the invoice <br \/><code data-no-translation=\"\"><strong>Subject2<\/strong><\/code> : \u2013 The attribute denotes the entity receiving the invoice <br \/><code data-no-translation=\"\"><strong>Subject3<\/strong><\/code> : \u2013 The attribute denotes a third party <br \/><code data-no-translation=\"\"><strong>SubjectAuthorized<\/strong><\/code> : \u2013 The attribute denotes the authorized entity<\/p>\r\n<h4 id=\"KsefInvoiceSendRequest\"><span class=\"ez-toc-section\" id=\"KsefInvoiceSendRequest\"><\/span><em>KsefInvoiceSendRequest<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents a request to send an invoice in two modes: encryption or non-encryption of invoices <br \/><code data-no-translation=\"\"><strong>encrypted<\/strong><\/code> : <a href=\"#KsefInvoiceEncrypted\">KsefInvoiceEncrypted<\/a> \u2013 The attribute specifies the variant (choice) used to send an encrypted invoice in a session created with encryption, i.e. the set parameters: <a href=\"#encryptedKey\">encryptedKey<\/a> and <a href=\"#initVector\">initVector<\/a> when creating a session (<a href=\"#post-449-BKM_663A19D5_1CA9_45A4_9D58_95D3B0DAFBCD\">KsefSessionOpenOnlineRequest<\/a>). Due date: [1]<\/p>\r\n<p><code data-no-translation=\"\"><strong>sessionId<\/strong><\/code> : string \u2013 <a href=\"#post-449-BKM_B4E2F9F2_43E3_4B05_8C85_5888E4A9BACC\">Session ID<\/a> obtained when establishing an interactive session: <a href=\"#ksefSessionOpenOnline\">ksefSessionOpenOnline<\/a>Due date: [1]<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"KsefSessionOpenOnlineRequest\"><\/span><a id=\"post-449-BKM_663A19D5_1CA9_45A4_9D58_95D3B0DAFBCD\"><\/a><em>KsefSessionOpenOnlineRequest<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class represents a request to create an interactive session.<\/p>\r\n<p><code data-no-translation=\"\"><strong>invoiceVersion<\/strong><\/code> : <a href=\"#KsefInvoiceVersion\">KsefInvoiceVersion<\/a> \u2013 Indicate the schema version in which KSeF invoices will be sent within the established session. Required: [1]<\/p>\r\n<p><code data-no-translation=\"\">encryptionInfo<\/code> : <a href=\"#EncryptionInfo\">EncryptionInfo<\/a> \u2013 The type is described in the chapter <a href=\"#EncryptionInfo\">EncryptionInfo<\/a>Due date: [1]<\/p>\r\n<h5><em><a id=\"EncryptionInfo\"><\/a>EncryptionInfo<\/em><\/h5>\r\n<p id=\"encryptedKey\"><code data-no-translation=\"\"><strong>encryptedKey<\/strong><\/code> : string \u2013 If encryption of transmitted data (invoices) is to be used as part of an interactive session, the attribute should include a symmetric encryption key (AES256) generated before opening a new session and encrypted with the KSeF platform RSA public key downloaded using the operation <a href=\"#post-449-BKM_DA691A51_7832_4BB5_83F4_604D2B065754\">ksefPublicKey<\/a>Due date: [1]<\/p>\r\n<p id=\"initVector\"><code data-no-translation=\"\"><strong>initVector<\/strong><\/code> : string \u2013 This attribute describes the so-called initialization vector. The acceptable AES symmetric key encryption algorithm is AES\/CBC\/PKCS5Padding (PKCS#7). The acceptable symmetric key is AES with a length of 256 bits supported by a random initialization vector of 16 bytes. Requirement: [1]<\/p>\r\n<h4><span class=\"ez-toc-section\" id=\"KsefInvoiceVisualizeRequest\"><\/span><a id=\"post-449-BKM_971DE727_C4DE_4C3F_A3B6_94318FC8866B\"><\/a><em>KsefInvoiceVisualizeRequest<\/em><span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n<p>The class allows you to define parameters related to the visualization of a structured invoice (KSeF invoice) <br \/><code data-no-translation=\"\"><strong>templateName<\/strong><\/code>: string \u2013 The attribute defines the name of the template to be used to visualize the invoice.<\/p>\r\n<p><code data-no-translation=\"\">offline<\/code>: boolean \u2013 The attribute specifies whether a QR code is to be attached to the visualization. The option may apply to invoices issued to foreign contractors who will not have access to KSeF anyway, and the method of transmitting (delivering) the invoice will depend on the issuing entity.<\/p>\r\n<p><strong><\/strong><code data-no-translation=\"\"><strong>invoiceKsefNumber<\/strong><\/code>: string \u2013 Attribute contains unique <a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">KSeF number of the invoice<\/a> assigned by the National e-Invoice System when the invoice is successfully sent to KSeF.\u00a0<\/p>\r\n<p><code data-no-translation=\"\"><strong>invoiceData<\/strong><\/code>: string \u2013 The attribute transmits the XML file of the KSeF invoice for which the visualization is to be performed.<\/p>\r\n<p><code data-no-translation=\"\"><strong>outputFormat<\/strong><\/code>: <a href=\"#post-449-BKM_228F709D_A191_4EC3_B3D0_1E5C58CBE49E\">OutputFormat<\/a> \u2013 The attribute can take one of two possible values defined in the enumeration <a href=\"#post-449-BKM_228F709D_A191_4EC3_B3D0_1E5C58CBE49E\">OutputFormat.<\/a><\/p>\r\n<p><strong>outputLanguage<\/strong> : <a href=\"#post-449-BKM_D4CAA4F7_067E_4E52_817E_931699AB95DE\">OutputLanguage<\/a> \u2013 The attribute can take one of the three possible values defined in the enumeration <a href=\"#post-449-BKM_D4CAA4F7_067E_4E52_817E_931699AB95DE\">OutputLanguage.<\/a><\/p>\r\n<p>&nbsp;<\/p>\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Enumeracje\"><\/span><a id=\"post-449-ENUMERACJE\"><\/a><a id=\"post-449-BKM_D9A08F90_A57A_4C3D_B5D8_E226CDFA5A5B\"><\/a>Enumerations<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The chapter contains a list of all enumerations that can be used in the interface.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-32.png\" width=\"662\" height=\"457\" alt=\"REST API KSeF 2.0 - enumeracje\" class=\"aligncenter wp-image-213 size-full\" title=\"REST API KSeF 2.0 - enumerations\" srcset=\"https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-32.png 662w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-32-300x207.png 300w, https:\/\/ksef24.com\/wp-content\/uploads\/2026\/01\/image-32-18x12.png 18w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/p>\r\n<p style=\"text-align: center;\">Diagram: Enumerations<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"InvoiceStatus\"><\/span><a id=\"post-449-BKM_3107DB78_BF59_438B_8455_BC16B7B2E84B\"><\/a><em>InvoiceStatus<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>An enumeration specifying the possible status of the submitted invoice returned by <a href=\"#post-449-BKM_5A623BA4_65E7_40EB_8218_16C9A3739076\">KsefInvoiceStatusResponse<\/a> <br \/><a id=\"post-449-BKM_B6FF2C38_D527_4216_AADD_43EA4F2AAA24\"><\/a><code data-no-translation=\"\"><strong>processing<\/strong><\/code> : string \u2013 The status returned from KSeF means that the sent invoice is still being processed. Please wait a while and check the invoice status again. <br \/><a id=\"post-449-BKM_BC2A5432_4439_4CE2_91BF_527E7C711E59\"><\/a><code data-no-translation=\"\"><strong>accepted<\/strong><\/code> : string \u2013 The status returned from KSeF means that the sent invoice has been received correctly and a unique KSeF number has been assigned to it (<a href=\"#post-449-BKM_A332AC3F_A29E_4CCD_964A_114B6C3F7A90\">InvoiceKsefNumber<\/a>). <br \/><a id=\"post-449-BKM_E18D6FC2_ABE2_485E_A480_5252E27BBB73\"><\/a><code data-no-translation=\"\"><strong>rejected<\/strong><\/code> : string \u2013 The status returned from KSeF means that the sent invoice was rejected by KSeF. In the details of the error message (<a href=\"#post-449-BKM_ED51A11B_2565_461E_9F49_113848DDC4F1\">Error<\/a>), you should check what was the reason for rejecting the invoice.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"Algorithm\"><\/span><a id=\"post-449-BKM_AA76CC42_39D3_4287_B024_34CF08DF017F\"><\/a><em>Algorithm<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Cryptographic key algorithms supported by KSeF <br \/><a id=\"post-449-BKM_A0CE3580_2292_4A6B_932F_9386439ED3EC\"><\/a><code data-no-translation=\"\"><strong>RSA<\/strong><\/code> : \u2013 Supported cryptographic key algorithm<\/p>\r\n<h3 id=\"KsefInvoiceVersion\"><span class=\"ez-toc-section\" id=\"KsefInvoiceVersion\"><\/span><em>KsefInvoiceVersion<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Schema version for KSeF invoices \u00a0<br \/><code data-no-translation=\"\"><strong>v2<\/strong><\/code> : \u2013 Second version of the schema <br \/><code data-no-translation=\"\"><strong>v3<\/strong><\/code> : \u2013 Third version of the schema (valid).<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"OutputFormat\"><\/span><a id=\"post-449-BKM_228F709D_A191_4EC3_B3D0_1E5C58CBE49E\"><\/a><em>OutputFormat<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The enumeration defines the format in which the invoice visualization is to be generated <br \/><code data-no-translation=\"\"><strong>html<\/strong><\/code> : string \u2013 The value specifies that the invoice visualization should be returned in HTML format. <br \/><code data-no-translation=\"\"><strong>pdf<\/strong><\/code> : string \u2013 The value specifies that the invoice visualization should be returned in PDF format.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"OutputLanguage\"><\/span><a id=\"post-449-BKM_D4CAA4F7_067E_4E52_817E_931699AB95DE\"><\/a><em>OutputLanguage<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The enumeration defines the language in which the invoice visualization is to be generated <br \/><code data-no-translation=\"\"><strong>pl<\/strong><\/code> : string \u2013 The value specifies that the invoice visualization should be in Polish. <br \/><code data-no-translation=\"\"><strong>en<\/strong><\/code> : string \u2013 The value specifies that the invoice visualization should be in English. <br \/><code data-no-translation=\"\"><strong>pl_en<\/strong><\/code> : string \u2013 The value specifies that the invoice visualization should be in Polish and English.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"SessionStatus\"><\/span><a id=\"post-449-BKM_6D341082_98B9_42D2_B3BC_E8325D57AF97\"><\/a><em>SessionStatus<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The enumeration defines what statuses an interactive session can have <br \/><a id=\"post-449-BKM_7C82D54C_343F_4384_8E86_771F1B33E3A8\"><\/a><code data-no-translation=\"\"><strong>active<\/strong><\/code> : string \u2013 The attribute indicates an active session<br \/><a id=\"post-449-BKM_267D3F3E_3F3D_4E80_A40D_DFCF26125384\"><\/a><code data-no-translation=\"\"><strong>closed<\/strong><\/code> : string \u2013 Attribute indicates an ended session.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"SubjectType\"><\/span><em>SubjectType<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The enumeration specifies the possible types of the entity <br \/><code data-no-translation=\"\"><strong>subject1<\/strong><\/code> : \u2013 The attribute denotes the entity issuing the invoice <br \/><code data-no-translation=\"\"><strong>subject2<\/strong><\/code> : \u2013 The attribute denotes the entity receiving the invoice <br \/><code data-no-translation=\"\"><strong>subject3<\/strong><\/code> : \u2013 The attribute denotes a third party <br \/><code data-no-translation=\"\"><strong>subjectAuthorized<\/strong><\/code> : \u2013 The attribute denotes the authorized entity<\/p>\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Odpowiedzi_typu_content\"><\/span>Content replies<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The chapter identifies and groups classes related to specific content that may occur when exchanging information with KSeF.<\/p>\r\n<p style=\"text-align: center;\"><a id=\"post-449-BKM_745E1B39_4BEC_4008_ABE9_A8CCCE40CF88\"><\/a><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-634\" src=\"https:\/\/ksefapi.pl\/wp-content\/uploads\/2024\/04\/5.png\" alt=\"KSeF REST API - zawarto\u015b\u0107 (content)\" width=\"720\" height=\"300\" \/>Diagram: Content Responses<\/p>\r\n<h3 id=\"Content\"><span class=\"ez-toc-section\" id=\"Content\"><\/span><em>Content<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>A parent class that describes the content from which other classes inherit <br \/><a id=\"post-449-BKM_B7EF5834_1374_4C1E_B543_9A164F6809D5\"><\/a><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 Content description for a given class <br \/><a id=\"post-449-BKM_3DD9DA92_7C63_4A87_8116_D15B1247DBB8\"><\/a><code data-no-translation=\"\"><strong>format<\/strong><\/code> : binary \u2013 Content format \u2013 always BINARY <br \/><a id=\"post-449-BKM_94BBE744_5A94_4590_903D_EEAB9D128EA4\"><\/a><code data-no-translation=\"\"><strong>type<\/strong><\/code> : string \u2013 Content type \u2013 always STRING<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"ApplicationZipContent\"><\/span><em><a id=\"post-449-BKM_0F091857_5CA9_4A1C_9E5F_B65F98CDF963\"><\/a>ApplicationZipContent<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The class represents a ZIP archive with KSeF invoices in XML form <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 ZIP archive with XML invoices<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"ApplicationOctetStreamContent\"><\/span><a id=\"post-449-BKM_14FB405A_D772_455F_8B44_3252BB80A3DC\"><\/a><em>ApplicationOctetStreamContent<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The class represents data in one of two possible forms: a) an encrypted single KSeF invoice (XML), b) an encrypted ZIP archive with multiple KSeF invoices (XML) <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 Encrypted single XML invoice or encrypted ZIP archive with XML invoices<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"TextXmlContent\"><\/span><a id=\"post-449-BKM_4ABF7647_7686_47D5_B5B0_70C5513BF908\"><\/a><em>TextXmlContent<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The class represents a KSeF Invoice or Official Confirmation of Receipt (UPO) in XML form <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 Invoice or UPO<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"ApplicationPdfContent\"><\/span><a id=\"post-449-BKM_B4C5AFC5_C4FA_4E6C_AD88_49F26B7AF795\"><\/a><em>ApplicationPdfContent<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The class represents the generated visualization of the KSeF invoice in the form of a PDF file <br \/><a id=\"post-449-BKM_066A9F50_094B_4E3C_AADE_8E16D453063F\"><\/a><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 = PDF visualization<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"TextHtmlContent\"><\/span><em>TextHtmlContent<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The class represents the generated visualization of the KSeF invoice in the form of an HTML file <br \/><a id=\"post-449-BKM_207D48DD_B04F_4E80_B8FE_E7B954EF2AE5\"><\/a><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 = HTML visualization<\/p>\r\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Komunikaty_bledow\"><\/span><a id=\"post-449-KOMUNIKATY_B\u00a3\u00caD\u00d3W\"><\/a><a id=\"post-449-BKM_FB59E57F_F3F5_41DF_90B9_4A86EB621297\"><\/a>Error messages<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The chapter contains a description of the class responsible for handling error messages.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"Error\"><\/span><em><a id=\"post-449-BKM_10DB3E1E_4E99_4AE7_B63C_11FF70E9C13B\"><\/a>Error<\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The class represents the structure of returned errors <br \/><a id=\"post-449-BKM_440F2C0D_B02E_40C8_83F4_FF6089EE9CA9\"><\/a><code data-no-translation=\"\"><strong>code<\/strong><\/code> : string \u2013 Unique error code <br \/><a id=\"post-449-BKM_205B6F52_6695_4462_9F87_1131B5D3DC1D\"><\/a><code data-no-translation=\"\"><strong>description<\/strong><\/code> : string \u2013 Description of the error<br \/><a id=\"post-449-BKM_332861F1_6F93_490C_9977_2A6D30C258D8\"><\/a><code data-no-translation=\"\"><strong>details<\/strong><\/code> : string \u2013 Detailed description of the error. Attribute used in particular when generating an invoice XML file (<a href=\"#post-449-BKM_50F79695_ADB8_4A0D_8322_D287CC1E262B\">ksefInvoiceGenerate<\/a>) in case of a schema incompatibility error. Information about the first error encountered is always returned. (Requirement: [0..1]). Errors occurring in the area of generating invoices are described in detail in the chapter <a href=\"#post-449-BKM_D0DBD58D_D4AD_400E_9BC6_DD7A925B0B35\">Error messages \u2013 Invoice<\/a>.<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Autoryzacja_i_szyfrowanie\"><\/span><a id=\"post-449-AUTORYZACJA_I_SZYFROWANIE\"><\/a><a id=\"post-449-BKM_2BDC9422_4B92_476A_B551_76F2B179E4A9\"><\/a>Authorization and encryption<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>A set of errors related to the area of authorization and encryption.<\/p>\r\n<p style=\"text-align: center;\"><a id=\"post-449-BKM_ED51A11B_2565_461E_9F49_113848DDC4F1\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-639\" src=\"https:\/\/ksefapi.pl\/wp-content\/uploads\/2024\/04\/6.png\" alt=\"KSeF REST API - komunikaty b\u0142\u0119d\u00f3w (autoryzacja i szyfrowanie)\" width=\"560\" height=\"437\" \/>Diagram: Error Messages - Authorization and Encryption<\/p>\r\n<h4><a id=\"post-449-BKM_05AA074B_45D0_45B9_9612_67F8126D0B84\"><\/a>AES_IV_LENGTH \u2013 Invalid initialization vector length<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1002 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= The initialization vector has an invalid length<\/p>\r\n<h4>AES_KEY_LENGTH \u2013 Incorrect length of the symmetric key used for data encryption<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong><\/code> = 1003 <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> = The symmetric key has an invalid length<\/p>\r\n<h4><a id=\"post-449-BKM_4DF7C840_6CA0_4F12_84AE_7C13E0BE196F\"><\/a>AUTH_CHALLENGE \u2013 Error getting authorization challenge<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong><\/code> = 1001 <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> = Failed to download the authorization challenge from the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_D622D6B5_ABEB_4B8D_8FD3_AE4655EF9AE9\"><\/a>B64_DECODE \u2013 Incorrectly encoded value using base64<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong><\/code> = 1005 <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> = Invalid base64 encoding of values<\/p>\r\n<h4><a id=\"post-449-BKM_C8DCAC4C_3CB4_4126_BC42_EA46CDC95604\"><\/a>KSEF_PUBLIC_KEY \u2013 Error retrieving KSeF public key<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong><\/code> = 1004 <br \/><code data-no-translation=\"\"><strong>description<\/strong><\/code> = Failed to retrieve the KSeF public key<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Sesja\"><\/span><a id=\"post-449-SESJA\"><\/a><a id=\"post-449-BKM_EAE18B50_220A_42F6_840F_19CE03BB8E3B\"><\/a>Session<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>A set of errors related to managing an interactive session.<\/p>\r\n<p style=\"text-align: center;\"><a id=\"post-449-BKM_F0AC801E_65ED_4A4E_8C1D_257EC354C5EC\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-640\" src=\"https:\/\/ksefapi.pl\/wp-content\/uploads\/2024\/04\/7.png\" alt=\"KSeF REST API - komunikaty b\u0142\u0119d\u00f3w (sesja)\" width=\"766\" height=\"867\" \/>Diagram: Error Messages - Session<\/p>\r\n<h4><a id=\"post-449-BKM_A2B1E0CA_BB97_4E48_80F0_2D48EBC42260\"><\/a>SESSION_ACCESS \u2013 Session access error<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1110 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= The user does not have access to the specified session<\/p>\r\n<h4><a id=\"post-449-BKM_570A7B8B_2753_4F77_8DD1_AE3A820AE40C\"><\/a>SESSION_CLOSE \u2013 Error when trying to close an interactive session<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1106 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to close the session in the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_93311677_C938_425A_BE3C_7980DDB074DF\"><\/a>SESSION_INIT \u2013 Error initiating an interactive session with the KSeF system<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1102 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to initialize a new session in the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_921BF248_7E0F_4029_A5CE_B4A070809704\"><\/a>SESSION_NO_UPO \u2013 The UPO object has not been generated yet<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1111 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= No UPO<\/p>\r\n<h4>SESSION_OPEN \u2013 Error creating a new interactive session with KSeF<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1103 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to create a new session in the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_8751B452_9D5B_4295_A792_0FC3D86650DF\"><\/a>SESSION_REF_NUM \u2013 Invalid KSeF interactive session ID<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1104 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Missing new KSeF session ID<\/p>\r\n<h4><a id=\"post-449-BKM_F777D6B3_99EF_4824_A942_554FBA18D7CB\"><\/a>SESSION_SAVE \u2013 Session update error<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1108 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to update KSeF session data<\/p>\r\n<h4><a id=\"post-449-BKM_B3DBC2B6_B6C6_42DA_B74F_E65A977046F5\"><\/a>SESSION_STATUS \u2013 Error getting the status of an interactive session in KSeF<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong><\/code> = 1105 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to retrieve the current session status from the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_C24B5BC2_C0D8_4591_8CBA_F4FD074879DF\"><\/a>SESSION_TOKEN \u2013 Error preparing authorization challenge<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1101 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to prepare a response to the authorization challenge for the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_BDD8BC9D_FBD6_4B9A_B3DA_F03C76AD7724\"><\/a>SESSION_UNKNOWN \u2013 Invalid session ID<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1109 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Unknown KSeF session ID<\/p>\r\n<h4><a id=\"post-449-BKM_44587751_4678_4FD1_AB0B_DA2685E2AD6E\"><\/a>SESSION_UPO \u2013 Error downloading UPO<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1107 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to download UPO from the KSeF system<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Faktura\"><\/span><a id=\"post-449-FAKTURA\"><\/a><a id=\"post-449-BKM_D0DBD58D_D4AD_400E_9BC6_DD7A925B0B35\"><\/a>Invoice<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>A set of errors related to generating, sending, downloading and visualizing invoices.<\/p>\r\n<p style=\"text-align: center;\"><a id=\"post-449-BKM_F6264D58_F4C2_4D53_85ED_908571B83AF4\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-643\" src=\"https:\/\/ksefapi.pl\/wp-content\/uploads\/2024\/04\/8.png\" alt=\"KSeF REST API - komunikaty b\u0142\u0119d\u00f3w (faktura)\" width=\"639\" height=\"707\" \/>Diagram: Error Messages - Invoice<\/p>\r\n<h4><a id=\"post-449-BKM_C9DD9726_B4B1_43E4_A4FB_8DF204AE457E\"><\/a>INVOICE_FORMAT \u2013 Incorrect format of the sent invoice<\/h4>\r\n<p><strong><code data-no-translation=\"\">code <\/code>= 1203<br \/><code data-no-translation=\"\">description<\/code><\/strong> = The invoice has an incorrect format<\/p>\r\n<h4><a id=\"post-449-BKM_E218F5D7_D0BD_4A57_A826_18DEC27F90B4\"><\/a>INVOICE_INPUT \u2013 Required metadata describing the invoice is missing<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1208 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Missing required invoice metadata<\/p>\r\n<h4><a id=\"post-449-BKM_ECFB8D38_DF27_4FDD_9969_3B6C2D77C905\"><\/a>INVOICE_SAVE \u2013 An error occurred while updating the invoice data<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1206 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to update invoice details<\/p>\r\n<h4><a id=\"post-449-BKM_6BBCE424_A084_4686_B4FE_3A99359CA922\"><\/a>INVOICE_SEND \u2013 An error occurred while sending the invoice to KSeF<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1204 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to send the invoice to the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_1AEA9A93_A06E_4119_B269_CC61B304FF4D\"><\/a>INVOICE_SIZE \u2013 Invoice size too large<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1202 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= The invoice is of an unacceptable size<\/p>\r\n<h4><a id=\"post-449-BKM_EA59C349_9CA4_4730_92A4_9CEE996DBFA8\"><\/a>INVOICE_STATUS \u2013 An error occurred while retrieving the invoice status<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1205 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to download the current invoice status from the KSeF system<\/p>\r\n<h4><a id=\"post-449-BKM_BF80D85C_3DC8_40AB_AF95_025A54E6655B\"><\/a>INVOICE_UNKNOWN \u2013 Invalid invoice ID<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1207 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Unknown invoice ID<\/p>\r\n<h4><a id=\"post-449-BKM_DCB669EA_E73D_4E0A_A083_BF32CC1FDAF3\"><\/a>INVOICE_VERSION \u2013 Incorrect version of the invoice schema<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1201 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Incorrect invoice format version<\/p>\r\n<h4><a id=\"post-449-BKM_63351713_B0B0_49BB_B268_ED3072DBD40D\"><\/a>INVOICE_VISUALIZE \u2013 An error occurred while generating the invoice visualization<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1209 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to generate invoice visualization<\/p>\r\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Wyszukiwanie\"><\/span><a id=\"post-449-WYSZUKIWANIE\"><\/a><a id=\"post-449-BKM_34B67330_F5BA_4B8E_8493_123D2BEEBBDC\"><\/a>Search<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>A collection of errors related to entering invoices in KSeF<\/p>\r\n<p style=\"text-align: center;\"><a id=\"post-449-BKM_9A507DC2_4F40_430C_AC2A_C4280427ACF9\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-645\" src=\"https:\/\/ksefapi.pl\/wp-content\/uploads\/2024\/04\/9.png\" alt=\"KSeF REST API - wyszukiwanie\" width=\"639\" height=\"319\" \/>Diagram: Error Messages - Search<\/p>\r\n<h4><a id=\"post-449-BKM_5736024C_DC45_4459_ADD1_D00D39621D24\"><\/a>QUERY_INVOICE_INIT \u2013 An error occurred while initiating the invoice search process<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1302 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to start the invoice search process<\/p>\r\n<h4><a id=\"post-449-BKM_74C732A8_4230_44F6_8AA1_78CF9CA73E71\"><\/a>QUERY_INVOICE_PARAMS \u2013 Invalid search criteria<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1301 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Incorrect or incomplete invoice search criteria<\/p>\r\n<h4><a id=\"post-449-BKM_C2F6549E_7944_4356_B8FA_047AA593855E\"><\/a>QUERY_INVOICE_RESULT \u2013 An error occurred while retrieving invoice search results<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1304 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to retrieve invoice search result<\/p>\r\n<h4><a id=\"post-449-BKM_8C805E80_0CA0_4D0E_B344_4201B636589A\"><\/a>QUERY_INVOICE_STATUS \u2013 An error occurred while checking the invoice search status<\/h4>\r\n<p><code data-no-translation=\"\"><strong>code<\/strong> <\/code>= 1303 <br \/><code data-no-translation=\"\"><strong>description<\/strong> <\/code>= Failed to retrieve the status of the invoice search process<\/p>\r\n<!-- wp:columns -->\r\n<div class=\"wp-block-columns\"><!-- wp:column {\"width\":\"100%\"} -->\r\n<div class=\"wp-block-column\">\u00a0<\/div>\r\n<\/div><!-- \/wp:post-content -->","protected":false},"excerpt":{"rendered":"<p>\u00a0 Wersja dokumentacji: 2.1 (changelog) Data wersji: 2026-03-14 Dokumentacja integracyjna interfejsu REST API dla Krajowego Systemu e-Faktur (KSeF 2.0) Komponenty Na potrzeby niniejszej dokumentacji zosta\u0142y przyj\u0119te 3 podstawowe komponenty, kt\u00f3re uczestnicz\u0105 w procesach biznesowych zwi\u0105zanych z obs\u0142ug\u0105 faktur w ramach KSeF 2.0: System wywo\u0142uj\u0105cy REST API KSeF 2.0 System KSeF [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"page-templates\/template-fullwidth.php","meta":{"footnotes":""},"class_list":["post-2","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/pages\/2","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/comments?post=2"}],"version-history":[{"count":0,"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/pages\/2\/revisions"}],"wp:attachment":[{"href":"https:\/\/ksef24.com\/en\/wp-json\/wp\/v2\/media?parent=2"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}