Table of Contents

Downloading Purchase Invoices from the National System of e-Invoices

Polish Localization for Business Central provides a set of features for downloading structured purchase invoices from the National System of e-Invoice. The downloading process consists of two steps. In the first step, a list of purchase invoices available in the National System of e-Invoices for a business unit is downloaded. In the second step, using the NSeI document number, you can search for and download an .xml file that contains a specific structured invoice to the database.

Viewing the List of Downloaded Invoices and Downloadable Invoices

To view the list of invoices that have been downloaded from the National System of e-Invoices:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.

  2. The NSeI Incoming Documents page contains all documents downloaded from the National System of e-Invoices, sorted based on the **Doc. Processed by NSeI Date ** field by default. The page contains all the necessary information about the imported document:

  • Doc. Processed by NSeI Date - Specifies the date when the document was processed in the NSeI.
  • Doc. Processed by NSeI Time - Specifies the time was the document was processed by the NSeI.
  • NSeI Document No. - Specifies the number of the NSeI document. This is a unique number that identifies the invoice in the National System of e-Invoices.
  • Subject by - Specifies the VAT registration number of the company that issued the purchase invoice.
  • Subject by Name - Specifies the name of the company that issued the purchase invoice.
  • Invoice Type - Specifies the NSeI invoice type for the document.
  • Source Document No. - Specifies the invoice number assigned by the invoice issuer.
  • Status - Specifies the status of document processing:
    • To Download - metadata has been downloaded, but the file has not yet been downloaded from the NSeI,
    • Assigned to Download By Batch – the document has been assigned to a batch of incoming NSeI documents,
    • Downloaded - the XML file has been downloaded from the NSeI and saved in the Business Central database, but it has not been processed yet.
    • Forwarded - the PDF file has been forwarded to the e-mail address indicated on the NSeI Setup page,
    • E-document Created - an e-document has been created,
    • Purchase Document Created - a purchase document has been created,
    • Purchase Document Posted - the purchase document has been posted.
    • Gen. Journal Posted - the purchase document has been posted via the general journal.
    • Skipped for Processing - the document has been skipped for further processing. This applies, for example, to invoices correcting non-value data, invoices awaiting clarification, or scam invoices.
  • E-Document No. - Specifies the e-document number that is linked to the NSeI incoming document.
  • Purchase Document No. - Specifies the purchase document number that is linked to the NSeI incoming document.
  • NSeI Comments - Specifies whether there are comments for the selected document.
  • File Size - Specifies the size of the .xml invoice file downloaded from the NSeI. The value in this field is displayed only after downloading the file from the National System of e-Invoices.
  • Doc. Received by NSeI Date - Specifies the date when the document was received in the NSeI.
  • Doc. Received by NSeI Time - Specifies the time when the document was received in the NSeI.
  • System Code - Specifies the system code of the .xml file.
  • PermanentStorage Timestamp - A technical field that specifies the date and time the document was processed in the NSeI.
  1. To check whether any new purchase invoices are available for downloading in the National System of e-Invoices, choose the Send Request for Documents to Download action. The query to the National System of e-Invoices is always sent for a date range. As a response, Business Central receives a list of purchase invoices available in the National System of e-Invoices that are downloadable for the company with the specified VAT Registration No. The received data is saved on the NSeI Incoming Documents page.
Note

If the list of incoming documents is empty, the system automatically creates a query for the default date range: from the current date minus three months (-3M) to the current date. If there are already incoming documents in the list, a request for new invoices is created for the date range, based on the latest invoice date specified in the NSeI Receipt Date field minus 1 day to the today’s date field.

Downloading Documents from the NSeI

Downloading documents from the NSeI as .xml files is available for incoming documents with the following status: To Download. Incoming documents can be downloaded individually or in batches.

Note

The download of documents from the NSeI can also be configured using the standard job queue. There are a few ways to do this:

  1. Get metadata for purchase invoices: codeunit ITINSeIGetIncomingDocMetaData.
  2. Download metadata of purchase invoices and automatic download of invoice XML files based on downloaded metadata (download in interactive mode - one query per invoice): codeunit ITI NSeI Online Incoming Doc.
  3. Importing XML files of purchase invoices as multi-invoice batches - you need to configure dedicated Azure Functions: Job Queue - Process NSeI Incoming Document Batches - codeunit ITI Incoming Batch.

Downloading a Single Document from the NSeI

To download the .xml file for a specific document from the NSeI:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.

  2. On the NSeI Incoming Documents page, select the document for which the .xml file has not been downloaded yet (Status: To Download), choose the Download NSeI Incoming Document action. As a result, the .xml document is downloaded from the National System of e-Invoices and saved into the database. The Status field is also updated and set to Downloaded.

Downloading Multiple Documents from the NSeI Using a Batch Session

Warning

In order to download invoices in batches, use the Azure Functions service. For this purpose, you can define Business Central settings on the NSeI Setup page by choosing the Azure Function Setup action.

To download .xml files from the NSeI for selected documents:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.

  2. On the NSeI Incoming Documents page, select the document for which the .xml file has not yet been downloaded (Status: To Download), and then select the Batch action, Create NSeI Incoming Document Batch. The action creates a batch of incoming documents, and changes the status of invoices into Assigned to Download By Batch.

Warning

Once a document has been assigned to be downloaded in a batch, it cannot be downloaded manually.

Note

The NSeI incoming document batch will include a maximum number of invoices as indicated in the Max No. of Documents per Incoming Batch field on the NSeI Setup page.

  1. Choose the Open Related NSeI Incoming Batches action to go to the NSeI Incoming Batches page. The NSeI Incoming Batches page contains all information about incoming batches:

    • Status - Specifies the status of the incoming document batch. The following values can be selected in this field:
      • New - incoming documents have been assigned to a batch;
      • Created - the batch export process has been initiated in the NSeI;
      • Failed - an error occurred while sending or receiving the batch from the NSeI;
      • Completed - the download of documents from the NSeI has been completed.
    • NSeI Status Code - Specifies the code of the status of exporting a batch from the NSeI to the Business Central system.
    • NSeI Status Description - Specifies the description of the status of exporting a batch from the NSeI to the Business Central system.
    • Created Date - Specifies the date and time when the batch was created.
    • Reference No. - Specifies the number assigned in the NSeI system.
  2. On the NSeI Incoming Batch page, select the Actions action, Initialize Batch Download to initiate the download of documents.

  3. Choose the Actions action, Download Documents to download .xml document files from the National e-Invoice System and save the files to the database. The Status field is also updated and set to Downloaded.

Note

The status of exporting documents from the NSeI to the Business Central system can be checked using the Actions, Status action on the NSeI Incoming Batch page.

Exporting an Incoming Document

To export the .xml file (and save it to a disk drive) for the incoming document:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.

  2. On the NSeI Incoming Documents page, select the document for which you want to export the .xml file and save it to disk.

  3. Choose the Export NSeI Incoming Document to XML File page. You can run an action only for documents that have the Downloaded status.

Sending an Incoming Document by E-mail

To send an incoming document by e-mail:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.

  2. On the NSeI Incoming Documents page, select the documents you want to send by e-mail.

  3. Choose the Send Documents by E-mail page. You can run an action only for documents that have the Downloaded status.

Skipping a NSeI Document for Processing

If an incoming NSeI document should not be converted into a purchase document, you can change its status to Skipped for Processing. To create a purchase document header:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.
  2. Select the line in the document that you want to skip.
  3. On the action bar, choose Skip/Restore for Processing.

In the same way, you can restore the document for further processing.

Note

This action is hidden by default. To display the action, use personalization.

Adding Comments to a NSeI Document:

You can add comments to incoming NSeI documents. Comments added to documents received from the NSeI are linked to the NSeI number and will appear on all purchase documents. To add comments to the incoming NSeI document:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.
  2. In the document line where you want to add a comment, select the NSeI Comments field (by default, it will be set to No).
  3. On the NSeI Comment Sheet page, enter the date and the text of your comment.

NSeI Document Number on Purchase Documents

The NSeI Document No. field has been added to purchase documents. During the posting process, it is copied to the posted document and to VAT entries. Whether the NSeI Document No. field must be filled in depends on the VAT settlement date in the document header—if the VAT settlement date is after January 31, 2026, then either the NSeI Document No. field or the Missing NSeI No. Reason field is required.

The NSeI No. Validation Type field on the NSeI Setup page specifies whether the system checks for an existing NSeI incoming document or a posted purchase document with the same NSeI number exist when entering a number in the NSeI Document No. field on purchase documents and in journals. The following options are available:

  • Error - the NSeI number will be validated, and if there is no incoming NSeI document or a posted purchase document with the same number, an error message will appear and the document cannot be posted;
  • Warning - the NSeI number will be validated, and if there is no incoming NSeI document or a posted purchase document with the same NSeI number, and a warning will appear and you will requested to decide whether the document should be posted;
  • None - no validation of the NSeI number is performed in the system (the string entered must match the format of the NSeI number).

Updating Purchase Documents on the basis of NSeI Incoming Documents

If the NSeI is unavailable, invoices may be submitted in an agreed-upon manner. You can create and post such documents by selecting BFK in the Missing NSeI No. Reason field. However, once the documents have been successfully submitted to the NSeI, you must include the NSeI number on the invoice and in the related entries. With a large number of documents, this process would be cumbersome, which is why the application enables you to automatically update data on purchase documents, entries, and incoming KSeF documents. To create a purchase document header:

  1. Choose the Lightbulb that opens the Tell Me feature icon, enter NSeI Incoming Documents, and then select a related link.
  2. On the action bar, choose Update NSeI Incoming Documents.

Once the action is run, the system will update the documents based on theVAT Reg. No. and Source Document No. field values .

See Also

Setting up Integration with the National System of e-Invoices

Issuing and Posting a Structured Invoice

Sending Invoices to the National System of e-Invoices

Invoicing Modes and the NSeI Unavailability Log

Processing Purchase Invoices Downloaded from the NSeI

Entering an NSeI Number or a Designation for a Missing NSeI Number