For AI agents: markdown of this page — /docs-content-en/entities/crm-payments/delete.md documentation index — /llms.txt
Delete a CRM payment
DELETE /v1/crm-payments/:id
Deletes a CRM payment that is not marked as paid, together with its line items; the product quantities from those items become available for payments again. A deleted payment cannot be restored through the API; create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionPayment ID. List of an item's payments: GET /v1/crm-payments |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-payments/567" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-payments/567" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/567', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
if (res.status === 204) {
console.log('Payment deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/567', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Payment deleted')
}
Response
On successful deletion the API returns HTTP status 204 No Content with an empty body; check the status code to confirm success.
Response example
HTTP/1.1 204 No Content
Error response example
404 — no payment with this ID exists, including one that was already deleted:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Payment has not been found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo payment with this id exists, including one that was already deleted |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe payment is marked as paid; error.b24Code equals SALE_PAYMENT_DELETE_EXIST_PAID. Clear the mark first with POST /v1/crm-payments/:id/unpay |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the request; the reason is in error.message |
| HTTP422 | CodeBITRIX_NO_EFFECT |
DescriptionBitrix24 did not confirm the deletion |
| HTTP400 | CodeINVALID_ID |
Descriptionid is not a positive integer |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe key's user has no access to the CRM item or payment in Bitrix24 |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is not allowed to write |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the crm scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionX-Api-Key is missing |
Full list of common API errors: Errors.
Known specifics
After deletion the product quantities are available for payments again. The quantity that was in the deleted payment's line items shows up again in the available product rows and can go into a new payment.