Error codes · KSeF 2.0 · Poland
KSeF session status does not allow this operation
This is the rejection, word for word: „[KSEF-21180] The KSeF 2.0 API rejected your request because the session referenced by referenceNumber is in a state that does not permit the requested action. Typical example: attempting POST /sessions/online/{ref}/invoices while the session status is 415 (closing) or an already-terminal status such as 445 (no valid invoices). The invoice itself was never processed.“
Endpoints that surface this error include POST /sessions/online/{referenceNumber}/invoices, POST /sessions/online/{referenceNumber}/close, and POST /sessions/batch/{referenceNumber}/close. The Polish message returned is "Status sesji nie pozwala na wykonanie operacji". The error payload usually includes the numeric session status. States that block invoice submission include 415 (closing initiated), 425/435 (processing terminated), and 445 (finished — no valid invoices).