For AI agents: markdown of this page — /docs-content-en/entities/invoices/delete.md documentation index — /llms.txt
Delete invoice
DELETE /v1/invoices/:id
Deletes an invoice by ID. A deleted invoice cannot be restored via the API — create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionInvoice ID |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/invoices/129" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/invoices/129" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/invoices/129', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
if (res.status === 204) {
console.log('Invoice deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/invoices/129', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Deleted')
}
Response
On successful deletion, HTTP status 204 No Content is returned with an empty body — success is checked by the status.
Response example
HTTP/1.1 204 No Content
Error response example
404 — invoice not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Item not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionInvoice with the specified ID not found. The same code is returned for a repeated delete of an already deleted invoice |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe id in the URL is not a non-negative integer |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionAPI key lacks the crm scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionAPI key has no configured tokens |
Full list of common API errors — Errors.