KSeF e-invoices
KSeF (Krajowy System e-Faktur) is the Polish national e-invoicing system. In the app's words: "Once connected, your purchase and sales invoices land in a Quanty table as rows, so you can filter them, run AI columns on them, put them on a board or a dashboard and ask about them in chat." Quanty can also issue an invoice to KSeF from a table row, once an admin switches sending on; that has its own page, Sending invoices to KSeF.
This page covers connecting, receiving, the Invoices list, the KSeF invoice data column, the KSeF trigger and disconnecting. Quanty describes what it does with KSeF; it does not give tax advice.
Before you start
- Plan. KSeF is part of the Gold plan and higher. On a lower plan the KSeF page says "KSeF is part of Gold" with See Gold and upgrade, or "Ask an administrator of this organization to upgrade the plan."
- Role. Only an organization admin connects KSeF, tests it, rotates the token, disconnects and changes what is received: "Only a workspace admin can change the connection." Any member can see the connection, the runs and the invoices; members who can edit the destination table can click Sync now.
- A token from KSeF. "An authorisation token is a long string that lets an application act on your company behalf in KSeF. It is not your password and it is tied to the permissions you grant it." "You generate one in the KSeF application: sign in with your trusted profile or qualified signature, open the tokens section and create a token that may read invoices. Add the right to issue invoices only if you plan to send them from Quanty."
Open KSeF from the KSeF (e-invoices) card on the Integrations page.
Connect KSeF
Click Connect KSeF. The dialog has three steps: Environment, NIP and Token.
1. Environment
"Which KSeF should Quanty talk to? Start with test if you are trying this out."
| Environment | What it is |
|---|---|
| Test | "A sandbox with throwaway data. Nothing you do here reaches the tax authority." The default. |
| Demo | "Works like production against invoices that are not legally binding. Good for a dress rehearsal." |
| Production (Live) | "The real KSeF: the register your company invoices actually live in." |
"Production is your company real register: what Quanty pulls are your actual accounting documents, and any invoice sent there has legal effect. Connect it once you have seen the flow work in test or demo."
Production is switched on by Quanty
The Production option stays greyed out until Quanty switches production KSeF on. The same switch covers receiving and sending. Quanty sets this up for your organization; ask us. Until then the option says "Switched off on the server for now. Contact Quanty support to have production KSeF enabled." Test and Demo are always available.
2. NIP
Company NIP: "Ten digits. A PL prefix, spaces and dashes are fine, we strip them." Quanty checks the check digit as you type ("Checks out: 1234563218"), so a typo is caught before anything goes to KSeF.
3. Token
| Field | What it means | Example |
|---|---|---|
| Authorisation token | "Paste the token from KSeF". "Generate it in the KSeF application, in the tokens section, with permission to read invoices." | |
| Name (optional) | A name for the connection. | Main company |
Click Connect. Quanty tries the token with KSeF first; a token KSeF refuses is never saved. "Quanty stores the token encrypted and never shows it again. Only the last four characters stay visible so you can tell which token is in use."
One connection at a time
The KSeF page holds one connection. Its environment and NIP cannot be changed: to move from Test to Production, or to another NIP, disconnect and connect again. Proof that sending worked in Test or Demo stays with your organization (see Sending invoices to KSeF).
The KSeF page
Once connected, the page has five tabs:
| Tab | What it holds |
|---|---|
| Connection | The status (Connected), the NIP, the end of the Token, Last verified and Connected, with Test connection, Rotate token and Disconnect. |
| Receiving | What is pulled, where it goes and how often (see Receive invoices). |
| Sending | Issuing invoices from a table (see Sending invoices to KSeF). |
| Submissions | Every invoice prepared or sent from Quanty (see Sending invoices to KSeF). |
| Invoices | Every invoice Quanty pulled (see The Invoices tab). |
Test connection answers "KSeF accepted the connection" or "KSeF refused the connection". Rotate token: "Paste the new token. The old one is replaced immediately and is not readable, so there is nothing to copy first." "Rotate the token whenever someone who knew it leaves, and whenever KSeF says it was revoked."
Receive invoices
"Invoices are pulled from KSeF on a schedule and written into the table you choose as rows: one invoice, one row."
- Open Receiving.
- Switch on Purchases ("Invoices other companies issued to you.") and/or Sales ("Invoices you issued, as KSeF recorded them.").
- For each, pick the Destination table and its Page, or Create a new table (named "Purchase invoices (KSeF)" or "Sales invoices (KSeF)").
- Under Schedule, choose Check every and, if you like, Pull invoices from.
- Click Sync now for the first pull, or wait for the schedule.
Only an admin changes these settings. A member sees them greyed out with "Only an admin of this organization can change these settings."; a member who can edit the destination table can still click Sync now.
"Quanty creates them itself on the first sync. There is nothing to prepare." A register switched on without a table warns: "Nowhere to write: purchases. Pick a table, or the next run will find invoices and drop them."
The columns of a row
Each invoice becomes one row, once: the KSeF number is the key, so an invoice already in the table is never added again. The columns are created with Polish names, whatever your language:
| Column | What it holds |
|---|---|
| Numer KSeF | The number KSeF gave the invoice. |
| Numer faktury | The number on the invoice. |
| Data wystawienia | The issue date. |
| Sprzedawca, NIP sprzedawcy | On purchases: who invoiced you. |
| Nabywca, NIP nabywcy | On sales: who you invoiced. |
| Netto, VAT, Brutto, Waluta | The amounts and the currency. |
| Rodzaj | The KSeF document type. |
| Data nadania numeru KSeF | The day KSeF gave the invoice its number. |
| Status | Nowa, Do zapłaty, Zapłacona or Sporna (New, To pay, Paid, Disputed). |
A column with the same name that already exists in the table is used instead of a new one. Status is yours: every new invoice starts as Nowa, and Quanty never changes the status again, so you can move invoices through your own process by hand, on a Kanban board or with an automation.
The schedule
| Setting | What it means | Default |
|---|---|---|
| Check every | 30 minutes, hour, 3 hours, 6 hours, 12 hours or day. KSeF limits how often a company may ask, so Quanty checks at most every 30 minutes. | hour |
| Pull invoices from | "Nothing issued before this date is fetched. Leave it empty to start 90 days back." | Empty |
Last run and Next run say when Quanty checked and will check. Recent runs lists each run, manual or scheduled, with Running, Done or Failed and a summary: "Checked 42 invoices, 3 of them new, and added 3 rows." A long history comes in over several runs; a run KSeF slows down ends cleanly and the next one carries on from the same place.
After three failed runs in a row the connection shows "3 failed attempts in a row.", Quanty waits longer between tries (up to 6 hours), and the admin who connected KSeF gets a notification. Test the connection, or rotate the token if KSeF revoked it.
The Invoices tab
Invoices lists every invoice Quanty pulled, with Purchases and Sales, search ("Counterparty, number, NIP"), dates from and to, and Clear filters. The columns are Counterparty, Number, Issued, Net, VAT, Gross and Type.
Click an invoice to see all it carries: KSeF number, Counterparty, Issue date, Invoicing date, Received in KSeF, Stored permanently, Net, VAT, Gross, Currency, Invoice type, Form, Mode and Marks such as Self-invoicing or Has attachment.
The KSeF invoice data column
KSeF invoice data is a column type that answers from the invoices Quanty has already pulled: "Reads the KSeF invoices already synced into this workspace. Instant, free, and never calls KSeF."
| Setting | What it means | Default |
|---|---|---|
| Match invoices by | Supplier or customer NIP, KSeF number or Invoice number. | NIP |
| Key column | The column of this table that holds the NIP or number, or This row's own KSeF invoice on a table the sync fills. | |
| Side | Purchases, Sales or Both. | Purchases |
| Period | All time, This month, This year or Last 12 months. | This year |
| Value to pull | Totals (Gross total, Net total, VAT total, Invoice count, Last invoice date, Last invoice number, Last KSeF number); when matching by KSeF number or invoice number, also one invoice's own fields. | Gross total |
The presets Bought this year, How many invoices and Last invoice fill the settings at once. The column is refreshed when the table runs, at 0 credits. See Column types.
Example: what you buy from each supplier
On a table of suppliers with a NIP column:
- Add a column of the type KSeF invoice data.
- Match invoices by NIP, Key column your NIP column, Side Purchases, Period This year, Value to pull Gross total.
- Add two more: Invoice count and Last invoice date.
Each supplier now shows how much you bought this year, how many invoices and when the last one came, without opening KSeF.
AI columns and chat
AI columns and the chat can look invoices up in the pulled data: "how much did we spend with this supplier in August" is answered from KSeF's own record of each invoice, not from what someone typed into a cell, and totals cover every matching invoice, not only the rows on screen. See Columns and AI and AI assistant.
The KSeF invoice received trigger
An automation with KSeF invoice received starts when a sync brings in a new invoice, filtered by Register, Seller's NIP, Buyer's NIP, Document type, Currency and Gross total (see Triggers and conditions). It works on the row the sync just created, so it must be built on the table that register writes into. Its messages can quote the invoice: Invoice number, KSeF number, Seller, Gross total and more (see Actions). The template Process a new purchase invoice from KSeF runs the AI columns on each new purchase invoice and tells the team.
Disconnect
Disconnect on the Connection tab: "The scheduled pull stops and the token is deleted. Rows already in your tables stay where they are." and "Invoices already pulled are not deleted." To receive again, connect KSeF anew with a token.
Good to know
- Security. The token is stored encrypted and never shown again; only its last four characters are visible. Only admins change the connection. Disconnecting deletes the token.
- Read-only token. A token that may only read invoices cannot be used to issue one, whatever happens to it. Give it the right to issue invoices only for sending.
- Corrections in KSeF. A correcting invoice comes in as a new invoice with its own KSeF number and type.
- TMS invoices. Invoices issued in the TMS have their own KSeF flow (see Sending invoices).
Related pages
- Sending invoices to KSeF: issue an invoice from a table row, sandbox first.
- Integrations: the KSeF card.
- Triggers and conditions: the KSeF trigger.
- Column types: the KSeF invoice data column.