## Delete a pay system

`DELETE /v1/pay-systems/:id`

Deletes a pay system by ID. Deleted records cannot be restored through the API.

## Parameters

|Parameter|Type|Required|Description|
|---|---|---|---|
|`id` (path)|integer|yes|Positive integer ID of the pay system. Source: [`GET /v1/pay-systems`](/docs/entities/pay-systems/list).|

## Examples

### curl — personal key

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

### curl — OAuth application

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

const { success, data } = await res.json()
```

### JavaScript — OAuth application

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

const { success, data } = await res.json()
```

## Response fields

HTTP 200.

|Field|Type|Description|
|---|---|---|
|`success`|boolean|Always `true` on success.|
|`data`|boolean|`true` when deletion is confirmed.|

## Response example

```json
{
  "success": true,
  "data": true
}
```

## Error response example

404 — the pay system was not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Entity not found"
  }
}
```

## Errors

|HTTP|Code|Description|
|---|---|---|
|400|`INVALID_PARAMS`|`id` is not a positive integer.|
|404|`ENTITY_NOT_FOUND`|The pay system does not exist.|
|403|`BITRIX_ACCESS_DENIED`|Insufficient permissions, a built-in pay system, or the OAuth application does not own the handler.|
|422|`BITRIX_ERROR`|A business error occurred. Details are in `error.message`.|
|502|`BITRIX_RESPONSE_INVALID`|The response to the operation has an invalid structure.|
|403|`SCOPE_DENIED`|The API key lacks the `pay_system` scope.|
|403|`WRITE_BLOCKED_READONLY_KEY`|The key is restricted to read operations.|
|401|`TOKEN_MISSING`|The key has no configured Bitrix24 credentials.|

For common API errors, see [Error codes](/docs/errors).

## See also

- [List pay systems](/docs/entities/pay-systems/list)
- [Get a pay system](/docs/entities/pay-systems/get)
- [Create a pay system](/docs/entities/pay-systems/create)
- [Update a pay system](/docs/entities/pay-systems/update)
- [Pay systems](/docs/entities/pay-systems)
