
## 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

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/basket-items/9" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth app

```bash
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

```javascript
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

```javascript
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
HTTP/1.1 204 No Content
```

## Error response example

422 — item not found:

```json
{
  "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](/docs/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.

## See also

- [List items](./list.md)
- [Get item](./get.md)
- [Update item](./update.md)
- [Update order](../orders/update.md)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
