Skip to main content
POST
Delete a sales invoice

Remove a test draft

The existing endpoint removes a DRAFT permanently from the API key’s company. Confirm the invoice identifier and its status before calling it:
reason is optional; when supplied it must contain 5 to 400 characters. This route uses POST. A permanently deleted draft returns:
fullDelete counts removed invoice records, not related rows. A zero count means that no invoice was removed by the mutation. Verify cleanup using the company sales list. A later GET by identifier for a permanently deleted draft returns HTTP 404 with errorCode: "NOT_FOUND".

Restrictions and issued invoices

An eligible issued invoice is soft-deleted rather than permanently removed. Related documents, read-only or accounting-approved documents, and invoices submitted to or accepted by KSeF cannot be deleted through this endpoint. A submitted invoice requires a correction. Deletion of issued invoices can attempt to roll back the invoice-number counter when possible. A NOK counter result is not itself a failed deletion. Use this endpoint for controlled test cleanup, rather than automatic removal of issued documents.

Authorizations

Authorization
string
header
required

OpenApi Key created within Altera.app for a certain company

Body

application/json
invoiceId
integer
required
Required range: x >= 1
reason
string

Optional deletion reason.

Required string length: 5 - 400

Response

Removal processed. Inspect fullDelete and softDelete to determine how many invoice records were removed.

result
enum<string>
required
Available options:
OK
data
object
required