Skip to main content
KSeF 2.0 · sending an invoice

KSeF exceptions when sending an invoice: 21405, 21180, 21184 and the rest

These codes arrive straight away, as an HTTP 400 answer to sending the invoice, before KSeF even looks at its content. That is the difference from statuses such as 450, which you get later. In Odoo you see them together with the full KSeF response.

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
4 min

How to see them in Odoo

When KSeF rejects the request, l10n_pl_edi in Odoo 18, 19 and 20 shows “Error when sending invoices to the KSeF” on the invoice, and below it “KSeF API Error: ” followed by the response exactly as it came, exceptionCode included. If KSeF refuses when the session is being opened, the message starts with “Failed to open KSeF session: ”. The invoice gets no KSeF status, so once fixed you send it the same way as before.

KSeF exception 21405 card with the sending codes
Code 21405 with its API description and the other exceptions returned when sending an invoice in an interactive session.

Codes, texts and what to do

CodeKSeF textWhat to do
21405“Błąd walidacji danych wejściowych.” (input data validation error), details from the validatorRead the details; the documentation's example is “Wskazany kod formularza nie jest wspierany.” (form code not supported).
21001“Nieczytelna treść.” (unreadable content), details with a descriptionKSeF could not read the request; documented in API 2.9.0, returned before as well.
21155“Przekroczono dozwoloną liczbę faktur w sesji.” (too many invoices in the session)A session holds up to 10 000 invoices; a new session is needed.
21173“Brak sesji o wskazanym numerze referencyjnym.” (no session with that reference)KSeF does not know the session stored on the company; Odoo will not replace it by itself (see below).
21180“Status sesji nie pozwala na wykonanie operacji.” (session status does not allow it), e.g. “Status sesji {code} uniemożliwia wysyłkę faktur.”The session closed or expired between the check and the sending.
21184“Sesja tymczasowo niedostępna.” (session temporarily unavailable), with details about maintenanceKSeF suggests trying later or opening a new session.
21402“Nieprawidłowy rozmiar pliku.” (wrong file size)The size in the request does not match the content.
21403“Nieprawidłowy skrót pliku.” (wrong file hash)The SHA-256 hash does not match the content.
21166“Korekta techniczna niedostępna.” (technical correction not available)About the technical correction of an offline invoice.
21167“Status faktury nie pozwala na korektę techniczną.” (invoice status does not allow a technical correction)Same: no technical correction for an invoice that was processed correctly.

The session in Odoo

Odoo keeps the interactive session number on the company. Before sending it asks KSeF for the session status: if it is 100, an open session, it keeps using it; otherwise it opens a new one with the FA (3) 1-0E form. So 21180 usually goes away on the next attempt. 21173 is different: on the next sending Odoo asks about that same session, gets the same error (“Failed to check KSeF session: …”) and does not open a new one. The stored session is only cleared by removing the KSeF certificate in the settings and saving, then adding the certificate again. That follows from Odoo's code; we have not tried it against KSeF. For 21184 KSeF suggests a new session, but Odoo only opens one once the stored session no longer has status 100; if the error repeats, wait, as the message advises.

Codes 21402 and 21403 concern calculations the sending program does itself: Odoo computes the hash and size of the invoice before and after encryption. With standard Odoo they do not come from the invoice data. Odoo does not send technical corrections of offline invoices, so 21166 and 21167 come from another program.

Before you report the problem

  • Copy the full message from Odoo, including the JSON after “KSeF API Error:”.
  • Note the code and the details text.
  • Check whether the error affects one invoice or every invoice being sent.
  • Check whether it happens in production or in the test environment.
Diagram: what KSeF returns for exception 21405 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.

Statuses of the session itself: 440 and 445

An interactive session has its own status too. 440 “Sesja anulowana” (session cancelled) with details “Nie przesłano faktur” means no invoice was sent in the session, and 445 “Błąd weryfikacji, brak poprawnych faktur” means no invoice passed verification. Odoo only checks whether the session has status 100, so it will not show these; look for the cause in the invoice statuses, such as 450.

Our module, Poland KSeF 2.0 Validator, does not send invoices and does not see these codes; with the FlexigoTech Cloud subscription, if you click “Validate FA(3) (FlexigoTech Cloud)” before sending the invoice, it checks the FA(3) file against the schema. That result does not stop l10n_pl_edi from sending: a “Not valid” invoice goes out anyway if you send it.

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.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.KSeF HTTP 429, 403 and 401: request limits and access deniedKSeF 2.0 answers 429 Too Many Requests over the limit, 403 with a reasonCode when access is missing and 401 on an expired token. Limits and what Odoo does.
Checked in the module's source code (version 20.0) and the linked sources

Sources