## Delete a price type

`DELETE /v1/catalog-price-types/:id`

Deletes a catalog price type. The deleted record and its related data cannot be restored through the API.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|-------|----------|
| `id` (path) | number | yes | Price type ID, a non-negative integer. List: [List price types](./list.md). |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/catalog-price-types/19" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

if (res.status === 204) {
  console.log('Price type deleted')
}
```

### JavaScript — OAuth application

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

if (res.status === 204) {
  console.log('Price type deleted')
}
```

## Response

Successful deletion returns HTTP status `204 No Content` with an empty body. The response status indicates success.

## Response example

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

## Error response example

404 — the price type does not exist, for example when deleting it again:

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

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | During the check before deletion, Bitrix24 reported that no price type exists with this `id`. |
| 404 | `ENTITY_NOT_FOUND` | The check before deletion returned an empty price type record. |
| 422 | `BASE_PRICE_TYPE_CANNOT_DELETE` | The price type is the base type: its `base` is `Y`. |
| 400 | `INVALID_PARAMS` | `id` is not a non-negative integer, for example `abc`. |
| 400 | `INVALID_PARAMS` | Bitrix24 rejected the request parameters. |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request. The reason is in `error.message`. |
| 403 | `BITRIX_ACCESS_DENIED` | The user does not have the Bitrix24 “Manage price types” permission. |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. |
| 403 | `SCOPE_DENIED` | The key does not have the `catalog` scope. |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was omitted. |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens configured. For an OAuth application key, check the user session. |

For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

**Deleting a price type also deletes every product price assigned to that type and its rounding rules on the Bitrix24 account.** Before calling the method, check the record with [Get a price type](./get.md) and find related prices with [List prices](/docs/entities/catalog-prices/list).

## See also

- [Get a price type](./get.md)
- [List price types](./list.md)
- [Create a price type](./create.md)
- [Update a price type](./update.md)
- [Catalog prices](/docs/entities/catalog-prices)
