## Delete a VAT rate

`DELETE /v1/catalog-vat-rates/:id`

Deletes a VAT rate from the product catalog. A deleted record cannot be restored through the API. Create a new one if needed.

## Parameters

| Parameter | Type | Required | Description |
|------|------|------|------|
| `id` (path) | number | yes | VAT rate identifier, a non-negative integer. List: [`GET /v1/catalog-vat-rates`](/docs/entities/catalog-vat-rates/list). |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/catalog-vat-rates/25" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

if (res.status === 204) {
  console.log('VAT rate deleted')
}
```

### JavaScript — OAuth application

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

if (res.status === 204) {
  console.log('VAT rate deleted')
}
```

## Response

Successful deletion returns HTTP status `204 No Content` with an empty body. Check the status code to confirm success.

## Response example

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

## Error response example

404 — the rate does not exist, for example on repeated deletion:

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

## Errors

| HTTP | Code | Description |
|------|------|------|
| 404 | `ENTITY_NOT_FOUND` | No VAT rate exists with this `id`, including after deletion. |
| 400 | `INVALID_PARAMS` | `id` is not a non-negative integer, for example `abc`. |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request. See `error.message` for the reason and `error.b24Code` for the original code. |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | Writes are blocked: the key is read-only. |
| 403 | `SCOPE_DENIED` | The key does not have the `catalog` scope. |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing. |
| 401 | `TOKEN_MISSING` | The key has no configured Bitrix24 tokens. For an OAuth application key, check the user session. |

For all common API errors, see [Errors](/docs/errors).

## Known specifics

**Before deleting a rate, check the products that use it.** Find them with [`GET /v1/catalog-products?filter[vatId]=25`](/docs/entities/catalog-products/list) and assign another rate if needed.

To deactivate a rate while retaining its record, first check its current `rate`. If `rate` is numeric, send [`PATCH /v1/catalog-vat-rates/:id`](/docs/entities/catalog-vat-rates/update) with `{"active": "N"}`. For an existing "No VAT" rate with `rate: null`, this PATCH is rejected with `422 BITRIX_ERROR` and `Required fields: rate`. The record remains active. An `active`-only PATCH cannot deactivate it while `rate` remains `null`.

## See also

- [Create a VAT rate](/docs/entities/catalog-vat-rates/create)
- [Get a VAT rate](/docs/entities/catalog-vat-rates/get)
- [List VAT rates](/docs/entities/catalog-vat-rates/list)
- [Update a VAT rate](/docs/entities/catalog-vat-rates/update)
- [Catalog products](/docs/entities/catalog-products)
- [Batch](/docs/batch)
