Fiscalization
Poland: KSeF e-invoices
How Renteon sends your Polish invoices to KSeF: certificates and settings, which documents are sent and when, KSeF numbers and QR codes, corrections and rejections.
Last updated
In Poland invoices are issued through KSeF, the national e-invoicing system of the Ministry of Finance. When the KSeF module is switched on, Renteon turns your finance documents into KSeF invoices (structure FA(3)), sends them to KSeF, collects the KSeF number that KSeF assigns and stores KSeF's official receipt confirmation (UPO) with the document.
Sending is not done at the moment you save. When the sending job is enabled, a background job sends new documents every 26 minutes, and you can always send a single document at once from the finance document list. Saving does check the document, though: a document that does not fit KSeF's invoice structure, for example because of a missing address or an unsupported VAT rate, is not saved at all.
This guide covers what you need before you start, the settings, which documents are sent, how dates, corrections, advance invoices and printouts work, and what to do when KSeF rejects an invoice.
What Renteon sends to KSeF and when
With the module on, these finance document types are sent: Invoice, Bill, Advance payment invoice, Corrective invoice, Approval, Debit and Bill - payout. They are sent for every client: companies, foreign companies and private persons. Two exceptions: Cashbook payout documents are never sent, and a Corrective invoice that corrects an Accounting note is not sent either.
Renteon picks the KSeF invoice type by itself:
- an ordinary document goes as a regular VAT invoice;
- an Advance payment invoice goes as an advance invoice, with its lines as the order the advance is paid for;
- a final invoice that uses an advance payment (it has a payment line of the type Advance payment) goes as a settlement invoice and refers to the KSeF numbers of the advance payment invoices it uses;
- a Corrective invoice goes as a correction; when it corrects an advance payment invoice or a settlement invoice, the matching correction type is used.
When documents are sent:
- Automatically, if Sending job enabled is ticked in the KSeF settings. Every 26 minutes Renteon sends all documents of the company that are waiting, then asks KSeF for the result of every document that has no final answer yet.
- Manually, from Sales → Bills → Search: click Actions on the document's row and choose Send to KSEF. Renteon sends the document, waits up to about 20 seconds for KSeF to process it and stores the result. The action is greyed out for documents that are not meant for KSeF and for documents that already have a KSeF number. The success message you see afterwards only means that Renteon handled the request; KSeF's answer is in the e-Invoice Status column (see "Following the status" below).
While a document waits to be sent, the list shows a yellow flag next to its amount with the tooltip E-invoice not sent. The flag disappears once the document has been sent, whatever KSeF answers.
When the KSeF number arrives, Renteon also marks the document for re-export, so an accounting export that already took the document picks it up again with the KSeF number.
What you need before you start
Renteon logs in to KSeF on behalf of your company with a certificate. Prepare:
- A KSeF certificate issued for your company's NIP, with its private key. Renteon logs in with it as your company and sends the invoices.
- A second certificate with its private key for the QR code that Renteon prints on invoices that do not have a KSeF number yet (see "Printed invoices" below).
- The password of each private key, if the key file is protected with one. Both password fields are mandatory on the settings screen; when a key file has no password, the value you type there is not used.
- Both certificates and both keys as text files: the certificate as a .cer file whose text starts with "BEGIN CERTIFICATE", the private key as a .key file. The upload fields offer .cer and .key files; if your certificate file ends in .crt, rename it to .cer. Renteon accepts only elliptic-curve (ECDSA) keys; an RSA key is refused when Renteon connects to KSeF.
Also check your company data in Administration → Code book → Settings, tab Basic, panel Company:
- VAT ID: your NIP. Enter the ten digits without PL, spaces or dashes. Renteon removes a leading PL only in the invoice itself; it logs in to KSeF and builds the verification link in the QR code with the value exactly as entered.
- Name, Address, Town and Postal code: sent as the seller's data. Address, town and postal code are mandatory while the KSeF module is on; without them no finance document can be saved and you see "When the KSeF module is enabled, the company address, city, and postal code are required".
Warning: Upload all four files (both certificates and both private keys) before you switch the module on. Renteon reads all four every time it connects to KSeF, and the QR code pair again when it prints an invoice that has no KSeF number yet, even though the screen does not mark the file fields as mandatory. A missing file makes sending and printing fail.
Setting up the KSeF connection
Go to Administration → Code book → Settings, click Edit and open the tab Fiscalization. The panel Ksef is shown to accounts whose country is Poland. Tick the checkbox in the panel header to switch the module on.
- Password: the password of the private key of the KSeF certificate.
- Fiscalisation certificate and Fiscalisation private key: the certificate and private key Renteon logs in to KSeF with.
- Password (QRCode), Fiscalisation certificate (QRCode) and Fiscalisation private key (QRCode): the second certificate, its private key and the key's password, used only to sign the QR code on invoices that have no KSeF number yet.
- E-mail: mandatory. After every automatic run, Renteon e-mails the KSeF rejections of that run to this address. Several addresses can be separated by a comma or a semicolon.
- KSeF start finance document ID: optional, see below.
- Environment: Test, Demo or Production, the KSeF environment Renteon sends to. Use Test or Demo while you try the connection out; only Production is the real KSeF. A document sent while Test or Demo is selected counts as sent: Renteon does not send it again when you switch to Production, so try the connection with test documents only.
- Sending job enabled: when ticked, the automatic job sends documents and checks their results every 26 minutes. When it is not ticked, nothing is sent until you use Send to KSEF on each document.
KSeF start finance document ID keeps existing documents out of KSeF when you switch the module on in an account that already has documents: documents whose ID is equal to or lower than this number are not marked for KSeF when they are saved again. It cannot be used to postpone the start: a new document is always marked for KSeF, whatever its ID. The ID of a document is shown in the ID column of the finance document list.
Click Confirm to save. You need the role Application settings management to open and change Settings.
Warning: Untick Sending job enabled only if you really want to send every document by hand. With the job off, Renteon does not send anything on its own and does not fetch KSeF results either.
Several companies in one account
If your account issues documents for more than one company, each company connects to KSeF with its own certificates. Open Administration → Code book → Companies (shown when your account has more than one company; you need the role Company editing), open the company and click Edit.
The company's panel Ksef has the same settings under slightly different names: API password, Certificate, Fiscalisation private key, Signature API password, Signature certificate, Signature private key, Recipient e-mail, Environment and Sending job enabled. The KSeF start ID is not on this screen. Renteon always uses the settings of the company the document belongs to; the automatic job runs separately for every company that has the module and the sending job switched on.
What is checked when you save a document
When you save a new document that goes to KSeF, Renteon builds the KSeF invoice and checks it against the official KSeF structure. If the check fails, the document is not saved and you see "Finance document did not pass Ksef validation. Error messages:" followed by the problems found. Some problems stop the document before that check, with their own message.
The most common causes:
- Client address. Every finance document needs a client address while the KSeF module is on, also for private persons. Pick one in the Address field of the document; otherwise you see "The client's address is mandatory". If the client has no address at all in the address book, add one first.
- Correction reason. A Corrective invoice without a correction reason cannot be saved ("Corrective invoice must have correction reason defined.").
- NIP format. A Polish company's VAT ID must be a valid ten-digit NIP. A leading PL is removed automatically; spaces and dashes are not, so enter the digits only.
- Payment types. KSeF knows the payment methods Renteon sends for Cash, Credit card (also Credit card - preauthorisation), Checks, Voucher, Transactional account, Bank transfer and the online payment gateways (PayPal, Checkout, Eurobank ePos, STCPay, Stripe, PayTabs, Monri, Windcave, Adyen). A document with a payment line of another type, for example Payment delay, Offset account, Internal transfer, External document or Billing specification, cannot be saved; the message starts with "KSEF - Unsupported payment type". This also means that an invoice on payment terms (Payment delay) cannot be issued while KSeF is on. Lines of the type Advance payment are fine: they link the invoice to the advance payment invoice. For Bank transfer and Transactional account lines Renteon adds the bank account of the payment line, or your default company account.
- VAT rates. Renteon supports 23%, 8% and 5% (22% and 7% are sent as 23% and 8%). Other rates, such as 4% or 3%, cannot be sent.
- 0% lines. A 0% line is sent as exempt ("zw") when its VAT rate is marked VAT-exempt in Administration → Code book → VAT rate. Otherwise the line needs an Article whose code is one of KSeF's rate codes: 0 KR, 0 WDT, 0 EX, zw, oo, np I or np II (codes are maintained in Administration → Code book → Articles). On a line you add by hand, you can pick an article only when the line's VAT rate is marked VAT free or VAT-exempt.
Each line is sent with the name of its service in your domestic language, the quantity, the unit "SZT", the net unit price, the net amount and the VAT. Make sure every service you invoice has a name in your domestic language.
Clients and how they are identified
KSeF needs to know who the buyer is. Renteon decides this from the client in the address book:
- Polish company (company without the Foreigner flag): the NIP from the client's VAT ID.
- Foreign company in the EU or EEA (company with Foreigner and EU/EEA ticked): the EU VAT number without its country prefix, and the country code taken from the prefix of the VAT ID or, if it has none, from the country of the client's address.
- Other foreign company (Foreigner ticked, EU/EEA not ticked): the VAT ID as it is, with the country code.
- Private person (client of type Individual): sent with the KSeF marker "no identifier", only with name and address. This applies to every client of type Individual, also one marked Artisan that has a VAT ID: its NIP is not sent.
The buyer's address is the client address chosen on the document: street, postal code and town, and the country of that address. When you create a new client, Renteon sets Foreigner and EU/EEA from the countries of the client's addresses; check both flags on existing clients.
Dates on the KSeF invoice
KSeF expects calendar days. Renteon keeps times in universal time (UTC) and converts them to your account's time zone (Settings, tab Basic, Time zone, set by Renteon) before it writes them into the invoice. So the issue date, the delivery date, the payment due date and the payment date are the Polish calendar day of the document. A payment date is sent only when all payment lines are Cash or Credit card; such an invoice is reported as paid on its issue date.
Example: an invoice saved at 00:30 on 3 March Polish time carries 3 March as its issue date, not 2 March, although in UTC it was still 2 March. A due date of 15 March stays 15 March.
The moment the invoice was created is sent separately as an exact timestamp in UTC. For invoices that were already sent, Renteon keeps the dates KSeF has on record: when you correct such an invoice or print its QR code, Renteon uses the issue date exactly as it was sent to KSeF.
Corrective invoices and advance payment invoices
To correct an invoice that is already in KSeF, use a Corrective invoice. On the finance document list click Actions on the original's row and choose Corrective invoice (you need the role Corrective Invoices; the action is offered for an Invoice, Bill, Advance payment invoice or Accounting note that is not cancelled). In the dialog, tick the lines that are wrong, enter the new amount for each, enter the Correction reason and click Confirm. Renteon books a new document with the differences; in KSeF every corrected line appears twice, once as it was and once as it is now.
The order matters, and Renteon enforces it:
- You can create a corrective invoice only when the original and all earlier corrections of it already have a KSeF number. Otherwise you see "Cannot create a corrective invoice because the original document or one of its previous corrections has not yet been sent to KSeF." Originals that never had to go to KSeF are not blocked.
- A corrective invoice is sent only after the original and all earlier corrections have their KSeF numbers. Until then the job leaves it waiting.
- A final invoice that uses advance payments is sent only after all the advance payment invoices it uses have their KSeF numbers.
The correction refers to the original by its KSeF number, its invoice number and its issue date. If the original was never sent to KSeF (for example because it was issued before the start ID), the correction marks it as an invoice issued outside KSeF and refers to its number and date only.
Approvals, debits and cancellations of invoices are also sent to KSeF, each as a separate invoice of its own. Check with your accountant which document to use for which change; the KSeF correction type is the one Renteon creates with Corrective invoice. For advance payments in general see Advance payment invoice.
Printed invoices: KSeF number and QR codes
When the KSeF module is on, the printed finance document has a Ksef Number field in its header. It stays empty until KSeF has assigned the number.
Invoices that go to KSeF also get QR codes:
- QR code with the KSeF number. Once the KSeF number is known, the printout shows one QR code with the KSeF number under it. The code links to KSeF's verification page for this invoice.
- Before the KSeF number is known. If you print the invoice before KSeF has assigned a number (for example right after saving, before the job has sent it), the first QR code is labelled OFFLINE and a second QR code labelled CERTYFIKAT is added. The second code is signed with the QR certificate from the settings.
Reprint the invoice after the KSeF number has arrived if you need the version with the KSeF number.
Following the status
Open Sales → Bills → Search. When KSeF is on for at least one of your companies, the list has an extra column headed e-Invoice Date and e-Invoice Status. For a document sent to KSeF its second line shows the date that came back from KSeF and KSeF's answer, for example "200 - Sukces" for an accepted invoice. A rejection is shown in red with KSeF's code, description and details.
Useful search filters in the section Fiscalization / e-Invoice:
- E-Invoicing date from and E-Invoicing date to: the date that came back from KSeF with the invoice.
- Ksef Number: finds the document with exactly this KSeF number.
- Should be e-invoiced: Yes shows every document that is or should be in KSeF.
To see exactly what was sent, open the document and choose Open fiscalization Xml data from its Actions menu. The action is there once the document has been sent. Request shows the KSeF invoice as Renteon sent it, and Response shows KSeF's receipt confirmation (UPO) once KSeF has accepted the invoice.
When KSeF rejects an invoice
KSeF processes invoices in sessions, so its answer comes a little after sending. Renteon fetches it right after a manual Send to KSEF, after every automatic run, and on the next runs for documents whose answer is still missing.
When KSeF rejects an invoice:
- the rejection appears in red in the e-Invoice Status column;
- if the rejection was found by the automatic job, the run e-mails it to the E-mail address from the settings. The subject is "KSeF reservations import log" and every rejected document is listed with KSeF's status code, description and details;
- the document is not sent again automatically.
Fix the cause, for example the client's data in the address book or your company data in Settings, and send the document again with Actions → Send to KSEF. Renteon builds the invoice again from the current data and sends it.
If KSeF has not finished processing a document yet, Send to KSEF does not send it a second time: it only asks KSeF for the result again. If KSeF reports that the invoice was already received earlier (this can happen when an earlier answer was lost), Renteon takes over the KSeF number from that earlier submission and treats the invoice as accepted.
When Renteon cannot reach KSeF at all, for example because a certificate, key or password is wrong or KSeF is down, nothing is e-mailed and no status appears: the documents simply keep the yellow E-invoice not sent flag and the job tries again on every run. If Send to KSEF on such a document shows an error, read it; it usually names the problem. If ordinary invoices keep the flag for more than an hour while Sending job enabled is ticked, check the KSeF settings. (Corrective invoices and settlement invoices can wait longer on purpose, see "Corrective invoices and advance payment invoices".)
Warning: A rejected invoice stays rejected until someone sends it again. Check the e-Invoice Status column and the e-mails regularly, especially after you change certificates or company data.
With the module running, the daily routine is: watch the yellow E-invoice not sent flags and the e-Invoice Status column, fix rejected invoices and send them again, and use Corrective invoice for changes to invoices that are already in KSeF.
Related guides: