---
title: "Delete a sales invoice"
method: POST
path: "/sales/delete"
tags: ["Sales"]
---

# Delete a sales invoice

`POST /sales/delete`

## Request

- Base URL: `https://api.altera.co`
- URL: `https://api.altera.co/sales/delete`
- Auth: API key in header `Authorization`

Existing removal endpoint, including test drafts. DRAFT is deleted permanently; an eligible issued invoice is soft-deleted. Related documents, read-only or accounting-approved documents, and invoices submitted to or accepted by KSeF cannot be deleted. fullDelete and softDelete count removed invoice records. This endpoint uses POST, not DELETE.

## Request body

- object
  - `invoiceId` integer, required
  - `reason` string: Optional deletion reason.

## Response `200`

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

- object
  - `result` 'OK', required
  - `data` object, required
    - `fullDelete` integer, required: Permanently deleted invoice count.
    - `softDelete` integer, required
    - `counterRollbackResult` 'OK' | 'NOK', required: Invoice-number counter rollback result for eligible issued invoices. Draft deletion returns NOK.

## Other responses

- `400`: Invalid request or document cannot be deleted due to relations, read-only/accounting state, prior deletion or KSeF submission.
- `401`: KEY_EXPIRED: a verified API key has expired. This requires that the company still has OpenAPI access. Unknown/invalid keys can receive the gateway 403.
- `403`: Invoice not found within the API key company, or authorization denied.

## Changes

- **2026-10-12** `45544bcb4e8a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/altera-co/apis/altera-api/changes/sales/delete/post.md)

---

[API](https://skmtc.dev/altera-co/apis/altera-api.md) - [All operations](https://skmtc.dev/altera-co/apis/altera-api/llms.txt) - [OpenAPI document](https://skmtc.dev/altera-co/apis/altera-api/revisions/45544bcb4e8a?raw)
