Skip to main content

What is KSeF and How to Use it in the cairo.ERP System?

The National e-Invoicing System (KSeF) is a central database managed by the Ministry of Finance, to which companies are obligated to submit information about their sales (invoices, returns). This article explains how KSeF is integrated with the cairo.ERP system and how to configure it for use.


What is KSeF?

KSeF is an ICT system used for issuing and receiving structured invoices. Its main goal is to digitize and automate invoicing processes in Poland. More information can be found on the official KSeF website: https://ksef.mf.gov.pl/.


Key Aspects of KSeF for Companies

The implementation of KSeF involves several important aspects to consider:

  • Definition of a structured invoice: KSeF exclusively concerns structured invoices, meaning those issued and received through the Ministry of Finance's system.

  • Mandatory implementation: Eventually, the KSeF system will become mandatory for all entrepreneurs. Exceptions may include invoices issued to natural persons not conducting business activities (consumer invoices) or simplified invoices (e.g., receipts with NIP up to PLN 450).

  • Invoice signing: Invoices in KSeF must be authorized by one of the following methods: qualified electronic signature, electronic seal, or KSeF token.

  • Invoice statuses: The system allows tracking the statuses of sent and received invoices (e.g., delivered, rejected).

  • Compliance with regulations: KSeF ensures compliance with current tax law regulations.


Benefits of KSeF Implementation

Implementing the National e-Invoicing System brings a number of benefits for entrepreneurs:

  • Faster invoice issuance and receipt: The invoicing process becomes more efficient.

  • Increased data security: A central database enhances the security of stored information.

  • Simplification of accounting and control processes: Automation facilitates document management.

  • Possibility of process automation: Invoicing-related processes can be largely automated.

  • Easier access to invoices and their archiving: All invoices are available in one place and easy to archive.

  • Reduced VAT refund time: For active VAT taxpayers, the refund period can be shortened from 60 to 40 days.


How does KSeF integration with cairo.ERP work?

In the cairo.ERP system, integration with KSeF is achieved through two independent modules:

  • cairo.ERP: Responsible for generating documents and sending data to the cairo.KSEF WS module.

  • cairo.KSEF WS: This is a web service that receives data from cairo.ERP (or another ERP system) and processes it into the appropriate KSeF format (compliant with the XSD schema).

The introduction of the KSeF module to cairo.ERP necessitated a change in the document approval logic. Approval now takes place before printing, right after selecting the payment method.


Abbreviated Scheme for Sending Documents to KSeF from cairo.ERP

Below is the sequence of steps when sending a document to KSeF:

  1. Print document: Start the process by printing the document in cairo.ERP (using the TAB key).

  2. Define data: Set print data, payment method, etc.

  3. KSeF validation: The system performs KSeF validation. If validation fails, you will return to step 2.

  4. Approve cairo.ERP document: After successful validation, the document is approved in cairo.ERP.

  5. Send to KSeF: The document is sent to KSeF. After this stage, the document cannot be recreated.

  6. Print document: The final document print occurs.

A document that has not been sent receives an "awaiting" status. You can view it in the appropriate cairo.ERP window, check the reason for non-delivery, resend it, or examine its structure.


KSeF Implementation and Configuration in cairo.ERP

To implement and configure the KSeF module in cairo.ERP, the following parameters must be completed in ERP > ADMINISTRATION > PARAMETERS > KSEF > PARAMETERS:

  • STATUS (ACTIVE) - This field indicates whether the KSeF module is active in your cairo.ERP system. When active, the system will attempt to send invoices to KSeF according to the configuration.

  • cairo.KSEF WS ADDRESS - In this field, you need to enter the address of the cairo.KSEF WS (Web Service) server. This is the address where your cairo.ERP system will communicate with the intermediary module responsible for data conversion and sending to KSeF. To obtain it, contact the Helpdesk (+48 89 533 95 07).

  • AUTHORIZATION CODE - This field is used to generate and manage the authorization token, which is essential for secure communication between your cairo.ERP system and the cairo.KSEF WS module. Clicking this field generates a unique private key, which is then used to authenticate connections. The company's identity is encoded using this key.

  • CONNECTION TEST - This option allows for a quick check to see if the configuration is correct and if the cairo.ERP system can establish a connection with the cairo.KSEF WS module. After clicking, the system will attempt to send a test query, and you will receive feedback on the connection status. This is a crucial step after any configuration change to ensure everything is working correctly.

Full implementation should occur well in advance of the planned KSeF start date.


How to Generate a New cairo.KSEF WS Token?

The token currently has no time limit, so there's usually no need to generate a new one. However, if security reasons require it, you can do so as follows:

  1. Contact Helpdesk (+48 89 533 95 07); we will remove the previous token.

  2. Generate a new key. Generate the key again in cairo.ERP, as described in the "Generating a token and testing the connection in cairo.ERP" section.
  3. Restart Falcons. A restart of Falcons is required for the changes to take effect.


What Data Does the Client Need to Provide for ksef.ini Configuration?

For us to correctly configure communication for your company, please prepare and provide the following information:

  • Company NIP (Tax Identification Number): This is your company's primary identifier in the KSeF system.

  • KSeF Host Address: Please indicate which KSeF environment you wish to work on:

    • Test: For testing purposes, with no impact on real settlements.

    • Pre-production (Demo): An environment similar to production, also for testing, but already requiring real authentication data.

    • Production: The environment for sending actual invoices.

  • KSeF Token: You must generate this token yourself on the official Ministry of Finance KSeF portal. This key is essential for authorizing communication with KSeF.

  • Preferences regarding KSeF session mode:

    • Immediate UPO (Official Receipt Confirmation): Each document sent will generate a separate session, and the UPO will be available almost immediately.

    • Batch UPO: The system will use one session lasting up to 2 hours, and the batch UPO will be available with a delay (after approximately 4 hours). This mode is often recommended for larger companies due to performance.

Please provide this data to allow us to quickly and correctly launch KSeF integration in your system.

In the test and pre-production KSeF environments, anonymized data should be used. This data should not contain real accounting information. Although the pre-production environment operates similarly to the production environment and requires real authentication data, it is always recommended to use test data to avoid accidentally entering actual accounting data into non-production environments.