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
id (path) number yes Payment ID. List of an item's payments: GET /v1/crm-payments

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-payments/567" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
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

javascript
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

javascript
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
HTTP/1.1 204 No Content

Error response example

404 — no payment with this ID exists, including one that was already deleted:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Payment has not been found"
  }
}

Errors

HTTP Code Description
404 ENTITY_NOT_FOUND No payment with this id exists, including one that was already deleted
422 BITRIX_ERROR The payment is marked as paid; error.b24Code equals SALE_PAYMENT_DELETE_EXIST_PAID. Clear the mark first with POST /v1/crm-payments/:id/unpay
422 BITRIX_ERROR Bitrix24 rejected the request; the reason is in error.message
422 BITRIX_NO_EFFECT Bitrix24 did not confirm the deletion
400 INVALID_ID id is not a positive integer
403 BITRIX_ACCESS_DENIED The key's user has no access to the CRM item or payment in Bitrix24
403 WRITE_BLOCKED_READONLY_KEY The key is not allowed to write
403 SCOPE_DENIED The API key does not have the crm scope
401 TOKEN_MISSING The API key has no configured tokens
401 MISSING_API_KEY X-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.

See also