For AI agents: markdown of this page — /docs-content-en/entities/crm-payments/products-delete.md documentation index — /llms.txt
Delete a line item from a CRM payment
DELETE /v1/crm-payments/:id/products/:itemId
Deletes a line item from a CRM payment. The payment amount is recalculated immediately. A deleted line item cannot be restored via the API. Add it again if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionPayment ID. Payments of a CRM item: GET /v1/crm-payments |
ParameteritemId (path) |
Typenumber | Requiredyes | DescriptionPayment line item ID, not the deal product row ID. List: GET /v1/crm-payments/:id/products, field data[].id |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-payments/573/products/445" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-payments/573/products/445" \
-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/573/products/445', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
if (res.status === 204) {
console.log('Line item deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/573/products/445', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Line item deleted')
}
Response
On successful deletion the response is HTTP status 204 No Content with an empty body. Check success by the status. The new payment amount is returned by GET /v1/crm-payments/:id.
Response example
HTTP/1.1 204 No Content
Error response example
404 — no line item with this itemId in this payment, including one already deleted:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Payable item has not been found in this payment."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo line item with this itemId in this payment, including one already deleted, message Payable item has not been found in this payment. |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo payment with this id, message Payment has not been found |
| HTTP400 | CodeINVALID_ID |
Descriptionid or itemId is not a positive integer |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the request. The reason is in error.message |
| HTTP422 | CodeBITRIX_NO_EFFECT |
DescriptionBitrix24 did not confirm the deletion |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe key's user has no access to the CRM item or the 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 not provided |
Full list of common API errors — Errors.
Known specifics
The line item quantity returns to the row's remainder. After a line item of 3 units is deleted, the row's quantity in the available product rows again includes these 3 units, and they can be added to this or another payment.