Update Deal crm.deal.update
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Scope:
crmWho can execute the method: any user with "edit" access permission for deals
DEPRECATED
The development of this method has been halted. Please use crm.item.update.
The method crm.deal.update updates an existing deal.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
id* |
The identifier of the deal. The identifier can be obtained using the methods crm.deal.list or crm.deal.add |
|
fields |
An object in the following format:
where:
The list of available fields is described below. An incorrect field in Only those fields that need to be changed should be passed in |
|
params |
A set of additional parameters (detailed description) |
Fields Parameter
|
Name |
Description |
|
TITLE |
The title of the deal |
|
TYPE_ID |
The string identifier of the deal type. The list of available deal types can be found using the method crm.status.list with the filter |
|
STAGE_ID |
The stage of the deal. The list of available stages can be found using the method crm.status.list with the filter:
If you need to change the Sales Funnel of the deal, use the method crm.item.update, with the |
|
IS_RECURRING |
Indicates whether the deal is a template for a recurring deal. Possible values:
|
|
IS_RETURN_CUSTOMER |
Indicates whether the deal is a repeat. Possible values:
|
|
IS_REPEATED_APPROACH |
Indicates whether the deal is a repeated approach. Possible values:
|
|
PROBABILITY |
Probability, % |
|
CURRENCY_ID |
Currency. The list of available currencies can be found using the method crm.currency.list |
|
OPPORTUNITY |
Amount |
|
IS_MANUAL_OPPORTUNITY |
Indicates whether manual calculation of the amount is enabled. Possible values:
|
|
TAX_VALUE |
Tax amount |
|
COMPANY_ID |
The identifier of the company associated with the deal. The list of companies can be found using the method crm.item.list by passing |
|
CONTACT_ID |
Contact. Deprecated |
|
CONTACT_IDS |
A list of contacts associated with the deal. The field is completely replaced. To change individual related contacts, use the methods crm.deal.contact.items.*. |
|
BEGINDATE |
Start date |
|
CLOSEDATE |
End date |
|
OPENED |
Is the deal available to everyone? Possible values:
|
|
CLOSED |
Is the deal closed? Possible values:
|
|
COMMENTS |
Comment. Supports BB codes |
|
ASSIGNED_BY_ID |
Responsible person |
|
SOURCE_ID |
The string identifier of the source type. The list of available sources can be found using the method crm.status.list with the filter |
|
SOURCE_DESCRIPTION |
Additional information about the source |
|
ADDITIONAL_INFO |
Additional information |
|
LOCATION_ID |
Client's location. System field |
|
ORIGINATOR_ID |
Identifier of the data source. Used only for linking to an external source |
|
ORIGIN_ID |
Identifier of the element in the data source. Used only for linking to an external source |
|
UTM_SOURCE |
Advertising system (Google-Adwords and others) |
|
UTM_MEDIUM |
Type of traffic. Possible values:
|
|
UTM_CAMPAIGN |
Advertising campaign designation |
|
UTM_CONTENT |
Content of the campaign. For example, for contextual ads |
|
UTM_TERM |
Search term of the campaign. For example, keywords for contextual advertising |
|
UF_CRM_... |
Custom fields. For example, Depending on the portal settings, deals may have a set of custom fields of specific types. Values of multiple fields are passed as an array. To change file fields, it is recommended to use the method crm.item.update. You can add a custom field to a deal using the method crm.deal.userfield.add |
|
PARENT_ID_... |
Relationship fields. If there are smart processes associated with deals on the portal, there is a field for each such smart process that stores the link between this smart process and the deal. The field itself stores the identifier of the element of that smart process. For example, the field |
Params Parameter
|
Name |
Description |
|
REGISTER_SONET_EVENT |
Should the event of the deal change be registered in the live feed? Possible values:
|
|
REGISTER_HISTORY_EVENT |
Should a record be created in the history? Possible values:
|
Related Methods and Topics
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"ID":123,"FIELDS":{"TITLE":"New Deal Title!","TYPE_ID":"GOODS","STAGE_ID":"WON","IS_RECCURING":"Y","IS_RETURN_CUSTOMER":"Y","OPPORTUNITY":9999.99,"IS_MANUAL_OPPORTUNITY":"Y","ASSIGNED_BY_ID":1,"UF_CRM_1725365197310":"String","PARENT_ID_1032":1},"PARAMS":{"REGISTER_SONET_EVENT":"N","REGISTER_HISTORY_EVENT":"N"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.deal.update
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"ID":123,"FIELDS":{"TITLE":"New Deal Title!","TYPE_ID":"GOODS","STAGE_ID":"WON","IS_RECCURING":"Y","IS_RETURN_CUSTOMER":"Y","OPPORTUNITY":9999.99,"IS_MANUAL_OPPORTUNITY":"Y","ASSIGNED_BY_ID":1,"UF_CRM_1725365197310":"String","PARENT_ID_1032":1},"PARAMS":{"REGISTER_SONET_EVENT":"N","REGISTER_HISTORY_EVENT":"N"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.deal.update
try
{
const response = await $b24.callMethod(
'crm.deal.update',
{
id: 123,
fields: {
TITLE: "New Deal Title!",
TYPE_ID: "GOODS",
STAGE_ID: "WON",
IS_RECCURING: "Y",
IS_RETURN_CUSTOMER: "Y",
OPPORTUNITY: 9999.99,
IS_MANUAL_OPPORTUNITY: "Y",
ASSIGNED_BY_ID: 1,
UF_CRM_1725365197310: "String",
PARENT_ID_1032: 1,
},
params: {
REGISTER_SONET_EVENT: "N",
REGISTER_HISTORY_EVENT: "N",
},
}
);
const result = response.getData().result;
result.error() ? console.error(result.error()) : console.info(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'crm.deal.update',
[
'id' => 123,
'fields' => [
'TITLE' => "New Deal Title!",
'TYPE_ID' => "GOODS",
'STAGE_ID' => "WON",
'IS_RECCURING' => "Y",
'IS_RETURN_CUSTOMER' => "Y",
'OPPORTUNITY' => 9999.99,
'IS_MANUAL_OPPORTUNITY' => "Y",
'ASSIGNED_BY_ID' => 1,
'UF_CRM_1725365197310' => "String",
'PARENT_ID_1032' => 1,
],
'params' => [
'REGISTER_SONET_EVENT' => "N",
'REGISTER_HISTORY_EVENT' => "N",
],
]
);
$result = $response
->getResponseData()
->getResult();
if ($response->getError()) {
echo 'Error: ' . $response->getError();
} else {
echo 'Success: ' . print_r($result, true);
// Your logic for processing data
processData($result);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error updating deal: ' . $e->getMessage();
}
BX24.callMethod(
'crm.deal.update',
{
id: 123,
fields: {
TITLE: "New Deal Title!",
TYPE_ID: "GOODS",
STAGE_ID: "WON",
IS_RECCURING: "Y",
IS_RETURN_CUSTOMER: "Y",
OPPORTUNITY: 9999.99,
IS_MANUAL_OPPORTUNITY: "Y",
ASSIGNED_BY_ID: 1,
UF_CRM_1725365197310: "String",
PARENT_ID_1032: 1,
},
params: {
REGISTER_SONET_EVENT: "N",
REGISTER_HISTORY_EVENT: "N",
},
},
(result) => {
result.error()
? console.error(result.error())
: console.info(result.data())
;
},
);
require_once('crest.php');
$result = CRest::call(
'crm.deal.update',
[
'ID' => 123,
'FIELDS' => [
'TITLE' => 'New Deal Title!',
'TYPE_ID' => 'GOODS',
'STAGE_ID' => 'WON',
'IS_RECCURING' => 'Y',
'IS_RETURN_CUSTOMER' => 'Y',
'OPPORTUNITY' => 9999.99,
'IS_MANUAL_OPPORTUNITY' => 'Y',
'ASSIGNED_BY_ID' => 1,
'UF_CRM_1725365197310' => 'String',
'PARENT_ID_1032' => 1,
],
'PARAMS' => [
'REGISTER_SONET_EVENT' => 'N',
'REGISTER_HISTORY_EVENT' => 'N',
],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Method Explanation
For managing deal contacts, it is not recommended to use the fields CONTACT_IDS and CONTACT_ID.
Use the methods crm.deal.contact.* for working with a single contact, and the methods crm.deal.contact.items.* for working with a group of deal contacts.
Response Handling
HTTP Status: 200
{
"result": true,
"time": {
"start": 1725365418.056843,
"finish": 1725365419.671506,
"duration": 1.6146628856658936,
"processing": 1.3475170135498047,
"date_start": "2024-09-03T14:10:18+02:00",
"date_finish": "2024-09-03T14:10:19+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
The root element of the response, contains |
|
time |
Information about the execution time of the request |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "Parameter 'fields' must be array."
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Description |
Value |
|
|
|
The parameter |
|
|
|
The deal with the provided |
|
|
|
The parameter |
|
|
|
The parameter |
|
|
|
The user does not have permission to "edit" deals |
|
|
Disk resource exhausted |
|
|
|
Invalid value for the "Currency" field |
|
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred. Please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not permitted for calls using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The HTTPS protocol is required for method calls |
|
|
|
The REST API is blocked due to overload. This is a manual individual block; please contact Bitrix24 technical support to lift it |
|
|
|
The REST API is only available on commercial plans |
|
|
|
The user associated with the access token or webhook used to call the method lacks the necessary permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the portal administrator has restricted access to this application to specific users only |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Create a New Deal crm.deal.add
- Get Deal by Id crm.deal.get
- Get a List of Deals crm.deal.list
- Delete Deal crm.deal.delete
- Get Fields of the Deal crm.deal.fields
- Update CRM Item
- How to Save the Payment Date in the Deal Field