Preparing the interface with KSeF

Preparing the interface with KSeF

The online accounting program mKsiegowa.pl is equipped with a module for direct cooperation with the National e-Invoice System (KSeF) – in accordance with the current API 2.0 standard (applies to selected subscriptions).

The National e-Invoice System is a nationwide platform used for issuing, receiving, and storing structured electronic invoices.

The mKsiegowa.pl system cooperates with KSeF in the following way:

  1. Connection to KSeF is established using a valid authorization token or a KSeF certificate. The token is generated in the KSeF system and then entered into the mKsiegowa.pl program. Until its expiration, this action is required only once.
  2. The program enables loading purchase invoices provided by contractors in KSeF and supports their posting.
  3. The program allows sending sales invoices issued in the system directly to KSeF and monitoring their status.

Configuring Cooperation with KSeF

Before starting work, it is necessary to generate an authorization token or certificate in the KSeF system.

The KSeF system is available at (production version): https://ap.ksef.mf.gov.pl/web/

Logging in may require:

  1. a qualified signature or seal,
  2. a trusted profile authenticated in the context of the company's NIP number.

If your trusted profile was not created in the context of the company's NIP number, submitting the ZAW-FA form may be necessary. The current login method should be verified on the KSeF site.

Token configuration in the program should be done in the General Settings → KSeF Settings module.

Note: if the KSeF Settings tab is not visible, please contact us using the contact form.

Preparing the Token

Note: KSeF tokens will only be available until the end of 2026. After that time, their use may no longer be possible. If token authorization is not possible, use KSeF certificate authorization, described below.

  1. Log in to the KSeF system. Depending on the chosen authorization method, login may require several steps:
    • selecting the login context – usually the company’s NIP number
    generating ksef token in mcu

    sign the document

    generating ksef token in mcu

    Go to the Tokens tab.

    generating ksef token - mksiegowa configuration
      • Click Generate token.
      • Enter the token name, e.g. mksiegowa-token.
      • Select roles:
        • access to invoices,
        • issuing invoices.
      • Copy the generated token.
        Note: this is the only opportunity to copy the token — if you do not do this, you will need to generate a new one.
    generating ksef token - configuration in mksiegowa
    • Paste the token in the mKsiegowa.pl program in the Authorization token field.
    • Environment prod – sending real invoices.
    • Set the start date for using KSeF.
    • Click Update.
ksef configuration in mksiegowa

Note: if the required roles are not available in KSeF, the user must first obtain permissions in the PermissionsManage permissions module.

After saving the token, the program will automatically verify:

  • whether the token allows connection to KSeF in the context of the specified NIP number,
  • whether the required roles are assigned.

In case of errors, the program will display an appropriate message.

The program also allows automatic sending of emails to clients with the KSeF invoice number. To activate the function, please contact us.

Authorization Using a Certificate

The program allows authorization in the KSeF system using a certificate, which can also be obtained in the KSeF system (link provided above).

To prepare the certificate, you should:

    • log in to the KSeF system as in the case of the token (described above)
    • select Generate certificate
ksef configuration in mksiegowa
    • enter the certificate name (e.g. mksiegowa-certificate)
    • enter a password securing your certificate
    • click Generate
    • the system will save your private key in the chosen location on the disk. Note: the saved key and password must be kept in a secure place.
    • on the next screen, select the given option and click Submit certificate request
ksef certificate configuration in mksiegowa
    • after completion, click Download certificate. As with the key, save the certificate in a secure place.
    • go to the Settings screen in mKsiegowa. Open the key and certificate using any text editor
    • in the KSeF Settings tab enter the key, password, and certificate and click Update
ksef certificate configuration in mksiegowa

If authorization is successful, the program will signal readiness to work with KSeF. If possible, the program generates KSeF token autmatically.

Note: mKsiegowa does not store the key and certificate on the mKsiegowa server; secure storage of the key and certificate is necessary if re-login is required.

Note: according to KSeF documentation, the certificate is valid for 2 weeks; after that time, re-authentication in KSeF may be necessary; however, as long as the Ministry of Finance maintains token validity, the program will not require re-entering the certificate, as communication with KSeF is maintained using an automatically generated token.

Loading Purchase Invoices

If access to KSeF has been properly configured, you can find the KSeF tab in the Purchases module in Supplier Transaction Inquiry.

This tab shows a table with invoices and corrections uploaded from KSeF.

Detailed process description: loading and posting purchase documents.

Sending Sales Invoices

If the authorization token is correctly configured, after issuing a sales invoice, the Send document to KSeF server option becomes available.

Clicking it sends the invoice to KSeF and displays its status.

The sending status can also be checked in the Customer transactions, corrections module.

Note: sending the first document after a longer break may take longer because the program opens a new communication session.