Skip to main content
KSeF 2.0 · invoice status

KSeF code 440: “Duplikat faktury”

KSeF rejects an invoice with status 440 when it already holds an invoice from the same seller, of the same type and with the same number. It is the only rejection code for which the Ministry of Finance publishes the exact rule, so the cause can be found without guessing.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 5 November 2026

Key facts

Module
KSeF 2.0
Versions
Odoo 17, 18, 19 and 20
Checked
in the module's source code, version 20.0 · against the sources linked at the end
Reading time
3 min

When KSeF treats an invoice as a duplicate

KSeF looks for duplicates across every invoice stored in the system. Three fields decide:

  • the seller's NIP, Podmiot1:NIP;
  • the invoice type, RodzajFaktury;
  • the invoice number, P_2, which the FA(3) schema says must identify the invoice unambiguously.

Uniqueness lasts 10 full years, counted from the end of the year in which the invoice was issued. The seller's NIP always counts: when several branches or units issue invoices on behalf of one company, they have to agree on their numbering.

KSeF code 440 card
Code 440 and the three fields KSeF uses to spot a duplicate.

What the answer carries, and what Odoo keeps

In the KSeF answer, status 440 has the description “Duplikat faktury” (duplicate invoice) and two fields in extensions: originalKsefNumber, the KSeF number of the invoice already in the system, and originalSessionReferenceNumber, the session it came in. The API documentation's example puts a message like “Duplikat faktury. Faktura o numerze KSeF: … została już prawidłowo przesłana do systemu w sesji: …” in details.

In Odoo 18, 19 and 20 the l10n_pl_edi module sets “KSeF Status” to Rejected and adds “KSeF Status: Rejected (Code: 440). Duplicate invoice.” to the history (in Polish on 18 and 19: “Status KSeF: Odrzucono (Kod: 440). Powielona faktura.”). Odoo does not store extensions, so the KSeF number of the original is not on the invoice. As P_2, Odoo writes the invoice number from Odoo.

Where a duplicate comes from with Odoo invoices

SituationWhat happens
The invoice already reached KSeF through another channel and was then sent from OdooThe original is in KSeF; the new sending gets 440.
The same NIP issues from two Odoo databases or companies with identical sequencesTwo different invoices share type and number.
Branches of one company keep separate numbering that overlapsKSeF counts the seller's NIP, not the branch.

Odoo only sends invoices without a KSeF status. An invoice in Sent or Accepted cannot be sent a second time by accident from the same Odoo.

How to solve it

  1. Find where the original is: the KSeF number in originalKsefNumber, or the invoice with that number in KSeF.
  2. If it is the same invoice, sent earlier through another channel, do not send it again. Every new sending under that number gets 440.
  3. If it is a different invoice with the same number, the problem is the numbering: agree with your accountants on separate sequences for each database, company or branch with the same NIP.

Is the invoice in KSeF after a 440?

Yes. KSeF holds the original invoice, the one in originalKsefNumber. Only the new sending was rejected.

How long does KSeF remember an invoice number?

For 10 full years from the end of the year of issue. Until then, the same NIP, type and number give 440.

Diagram: what KSeF returns for code 440 and what Odoo 20 shows
Diagram based on the l10n_pl_edi code of Odoo 20 and the KSeF API 2.9.0 specification; struck-through items are what Odoo does not keep or do.

With our module

Poland KSeF 2.0 Validator does not send invoices, but it has a “Mark accepted by KSeF” button for an invoice uploaded to KSeF outside Odoo, with the KSeF number the system gave. If l10n_pl_edi later sends that invoice as well and KSeF rejects it, the module keeps it Accepted and adds: “KSeF rejected the new sending of this invoice by l10n_pl_edi, already accepted by KSeF with KSeF number …: it stays Accepted.”. In every other case it takes the Rejected status from l10n_pl_edi, without the 440 code.

Keep reading

KSeF code 450: “Błąd weryfikacji semantyki dokumentu faktury”KSeF code 450 means the FA(3) invoice was rejected after its content was checked. Where the real reason is, what Odoo 18, 19 and 20 do not show and how to send it again.KSeF codes 410 and 415: seller permissions and attachmentsKSeF 410 “Nieprawidłowy zakres uprawnień” and 415 for invoices with attachments: what triggers them in the Ministry's tests and what to check in Odoo 18-20.Technical invoice statuses in KSeF: 550, 500, 405, 430 and 435KSeF invoice statuses unrelated to its content: 550 “Operacja została anulowana przez system”, 500, 405, 430 and 435. What Odoo does and why 550 stays in Sent.
Checked in the module's source code (version 20.0) and the linked sources

Sources