Skip to main content

Update deal

Modifies an existing deal

Function UpdateDeal(Val URL, Val DealID, Val FieldsStructure, Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
DealID--dealNumber, StringDeal ID
FieldsStructure--fieldsStructure of KeyAndValueDeal fields structure
Token--tokenStringAccess token, when app auth method used

Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API


tip

Method at API documentation: crm.deal.update


1C:Enterprise/OneScript code example
    FieldsStructure = New Structure;
FieldsStructure.Insert("TITLE" , "Sale in RUB");
FieldsStructure.Insert("CURRENCY_ID" , "RUB");
FieldsStructure.Insert("OPPORTUNITY" , 50000);

URL = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";
DealID = "1696";

Result = OPI_Bitrix24.UpdateDeal(URL, DealID, FieldsStructure);

FieldsStructure.Insert("TITLE" , "Future deal in RUB");
FieldsStructure.Insert("BEGINDATE", "2025-01-01");

URL = "b24-ar17wx.bitrix24.by";
Token = "2f4e4067006e9f06006b12e400000001000...";
DealID = "1698";

Result = OPI_Bitrix24.UpdateDeal(URL, DealID, FieldsStructure, Token);
    # JSON data can also be passed as a path to a .json file

oint bitrix24 UpdateDeal \
--url "b24-ar17wx.bitrix24.by" \
--deal 1730 \
--fields "{'TITLE':'Future deal in RUB','CURRENCY_ID':'RUB','OPPORTUNITY':50000,'BEGINDATE':'2025-01-01'}" \
--token "***"
Result
{
"result": true,
"time": {
"start": 1728454947.49523,
"finish": 1728454947.66518,
"duration": 0.169941902160645,
"processing": 0.142473936080933,
"date_start": "2024-10-09T09:22:27+03:00",
"date_finish": "2024-10-09T09:22:27+03:00",
"operating_reset_at": 1728455547,
"operating": 0.142450094223022
}
}