Delete an invoice
DELETE/api/v1/invoices/:id
Delete an invoice by ID.
Authorization is based on the OAuth application's tenant access to the invoice's workspace.
Important: an invoice is deletable only when ALL of the following hold:
- it is in "draft" lifecycle state;
- it has never been exchanged over an external network (Peppol AS4 / French PPF), in either direction;
- it has never entered the invoicing lifecycle (no recorded CDV status - deposit, inbound CDAR echo, ...);
- for a Scribee-issued invoice, it has not already consumed a final sequential invoice number (imported invoices carrying an externally-issued number are exempt from this last check);
- it has not already been included in an accounting export (any export run - pending or completed - that has already picked up the invoice's accounting entry; the entry must not silently disappear from that run mid-batch or after delivery);
- it was not created by converting a quote (the quote's converted state must keep its invoice);
- it is not matched to a confirmed purchase order or receipt (confirmed matches must be unlinked before deletion; proposed/rejected matches are removed with the invoice).
A non-destroyable invoice returns 422 with a precise error message identifying which of the above conditions failed.
Request
Responses
- 204
- 401
- 403
- 404
- 422
The invoice was deleted. The response body is empty.
The request carries no OAuth bearer token, or the token is invalid or expired.
The invoice cannot be deleted: it is not in draft lifecycle state, or it is a draft that already carries a final (non-DRAFT-prefixed) invoice number.
No invoice exists with the given ID, or the invoice belongs to a workspace the token's application cannot access - both cases return this same response so cross-workspace existence is never revealed.
invoice cannot be deleted - not destroyable (network-exchanged, already entered the invoicing lifecycle, non-draft state, a Scribee-issued invoice with a consumed final invoice number, part of an accounting export, created by converting a quote, or matched to a confirmed purchase order or receipt)