
## Delete a warehouse

`DELETE /v1/warehouses/:id`

Deletes a warehouse by identifier.

## Path parameters

| Parameter | Type | Description |
|----------|-----|---------|
| `id` | number | Warehouse identifier. List: [`GET /v1/warehouses`](/docs/entities/warehouses/list) |

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/warehouses/1" \
  -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/warehouses/1', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

console.log(res.status) // 204
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses/1', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

console.log(res.status) // 204
```

## Response

A successful deletion returns HTTP status `204 No Content` with an empty body — check success by the status code.

## Response example

```http
HTTP/1.1 204 No Content
```

## Error response example

404 — a warehouse with this `id` does not exist:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "store does not exist."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `id` is not a canonical positive integer: `12.5`, `12abc`, `1e2`, `007` are rejected before the Bitrix24 call |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 404 | `ENTITY_NOT_FOUND` | A warehouse with the specified `id` does not exist |

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

**A nonexistent warehouse is `404`.** Deleting a warehouse by an unknown `id` returns `404` with code `ENTITY_NOT_FOUND`. Deleting an already-deleted warehouse again returns the same error.

## See also

- [List warehouses](/docs/entities/warehouses/list)
- [Get a warehouse](/docs/entities/warehouses/get)
- [Create a warehouse](/docs/entities/warehouses/create)
- [API reference](/docs/api-reference)
