Update Deal Direction crm.dealcategory.update

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: crm

Who can execute the method: any user

DEPRECATED

The development of this method has been halted. Please use crm.category.update.

This method updates an existing deal direction.

Parameters

Name
type

Description

id
integer

Identifier of the direction

fields
array

Field values for updating the deal direction.

To find out the required format for the fields, execute the method crm.dealcategory.fields and check the format of the incoming values for these fields (except for fields marked with the isReadOnly and isImmutable attributes)

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"id":"1","fields":{"SORT":"100"}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.dealcategory.update
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"id":"1","fields":{"SORT":"100"},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/crm.dealcategory.update
        
try
        {
        	const id = prompt("Enter ID");
        	const sort = prompt("Enter sort order");
        	const parsedSort = parseInt(sort);
        	
        	if(isNaN(parsedSort) || parsedSort < 0)
        	{
        		parsedSort = 0;
        	}
        	
        	const response = await $b24.callMethod(
        		"crm.dealcategory.update",
        		{
        			id: id,
        			fields: { "SORT": parsedSort }
        		}
        	);
        	
        	const result = response.getData().result;
        	if(result.error())
        	{
        		console.error(result.error());
        	}
        	else
        	{
        		console.info(result);
        	}
        }
        catch(error)
        {
        	console.error('Error:', error);
        }
        
$id = (int)readline("Enter ID");
        $sort = (int)readline("Enter sort order");
        if (is_nan($sort) || $sort < 0) {
            $sort = 0;
        }
        
        try {
            $response = $b24Service
                ->core
                ->call(
                    'crm.dealcategory.update',
                    [
                        'id'     => $id,
                        'fields' => ['SORT' => $sort],
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                error_log($result->error());
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error updating deal category: ' . $e->getMessage();
        }
        
var id = prompt("Enter ID");
        var sort = prompt("Enter sort order");
        sort = parseInt(sort);
        if(isNaN(sort) || sort < 0)
        {
            sort = 0;
        }
        
        BX24.callMethod(
            "crm.dealcategory.update",
            {
                id: id,
                fields: { "SORT": sort }
            },
            function(result)
            {
                if(result.error())
                    console.error(result.error());
                else
                {
                    console.info(result.data());
                }
            }
        );
        
require_once('crest.php');
        
        $id = 1; // Replace 1 with the actual ID
        $sort = 100; // Replace 100 with the actual sort value
        
        $result = CRest::call(
            'crm.dealcategory.update',
            [
                'id' => $id,
                'fields' => ['SORT' => $sort]
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "crm.dealcategory.update", b24.Params{
        	"id": "1",
        	"fields": b24.Params{
        		"SORT": "100",
        	},
        })
        if err != nil {
        	return fmt.Errorf("crm.dealcategory.update: %w", err)
        }
        
        // The response arrives as json.RawMessage — unmarshal it
        // into a struct matching the response shape shown below on this page.
        fmt.Printf("%s\n", res.Result)