For AI agents: markdown of this page — /docs-content-en/entities/basket-items/delete.md documentation index — /llms.txt
Delete basket item
DELETE /v1/basket-items/:id
Deletes a basket item by identifier. A deleted item cannot be restored via the API — create a new one if needed.
Parameters
| Parameter | Type | Req. | Description |
|---|---|---|---|
id (path) |
number | yes | Item identifier |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/basket-items/9" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth app
curl -X DELETE "https://vibecode.bitrix24.com/v1/basket-items/9" \
-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/basket-items/9', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
if (res.status === 204) {
console.log('Item deleted')
}
JavaScript — OAuth app
const res = await fetch('https://vibecode.bitrix24.com/v1/basket-items/9', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Item deleted')
}
Response
On a successful deletion an HTTP 204 No Content status is returned with an empty body — success is checked by the status.
Response example
HTTP/1.1 204 No Content
Error response example
422 — item not found:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "basket item is not exists"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 422 | BITRIX_ERROR |
An item with this ID was not found or has already been deleted |
| 403 | SCOPE_DENIED |
The API key lacks the sale scope |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
For the full list of common API errors, see Errors.
Known specifics
The order stays unchanged. Deleting an item does not affect the parent order — only one basket line disappears. The order total (orders.price) is not recalculated automatically.