Deals in CRM: Overview of Methods
A deal is one of the key objects in CRM, where you can:
- manage the sales process of a product or service, including tracking stages and accepting online payments
- engage in dialogue with the client: calls, e-mails, chats in open channels
- view the history of interactions: activities, timeline records
Quick navigation: all methods and events
User documentation: deals in Bitrix24
Connection of Deals with Other CRM Objects
Client. A field in the deal card that consists of the associated company and contacts. All activities related to calls, e-mails, and chats with the contact or company will be saved in the active deal card. There can be only one company in the field, and it is accessed directly through the deal field COMPANY_ID. Multiple contacts can be specified, and interaction with them is conducted through a separate group of methods crm.deal.contact.*.
Products. Adding, modifying, and deleting product items in deals can be done through the group of methods crm.item.productrow.*.
Payments. Adding, modifying, and deleting payment documents in deals can be done through the group of methods crm.item.payment.*.
User Documentation
Sales Funnels and Deal Stages
You can create various sales funnels for deals and manage them through the group of methods crm.category.* where entityTypeId of the deal = 2.
Each funnel will have its own stages. These can be managed through the group of CRM reference methods — crm.status.*. The ENTITY_ID of deal statuses is unique for each direction — DEAL_STAGE_xx.
You can retrieve the history of a deal's movement through stages using the method crm.stagehistory.list.
User Documentation
How to Change a Deal's Funnel
The method crm.deal.update can only change the stage of a deal within the current funnel. If you pass a STAGE_ID that does not belong to the current funnel, nothing will change.
To move a deal to a stage in another funnel, use the method crm.item.update with the following parameters:
entityTypeId—2for the deal,id— theidof the deal you are moving,categoryId— theidof the funnel to which you are moving the deal. This can be obtained using the method crm.category.liststageId— theidof the stage in the new funnel. This can be obtained using the method crm.status.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"entityTypeId":2,"id":233,"fields":{"STAGE_ID":"EXECUTING","categoryId":0}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.item.update
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"entityTypeId":2,"id":233,"fields":{"STAGE_ID":"EXECUTING","categoryId":0},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.item.update
try
{
const response = await $b24.callMethod(
'crm.item.update',
{
entityTypeId: 2,
id: 233,
fields: {
STAGE_ID: 'EXECUTING',
categoryId: 0
}
}
);
const result = response.getData().result;
console.log('Updated item with ID:', result);
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'crm.item.update',
[
'entityTypeId' => 2,
'id' => 233,
'fields' => [
'STAGE_ID' => 'EXECUTING',
'categoryId' => 0
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error updating item: ' . $e->getMessage();
}
BX24.callMethod(
"crm.item.update",
{
entityTypeId: 2,
id: 233,
fields:
{
"STAGE_ID": "EXECUTING",
"categoryId": 0
},
},
(result) => {
result.error()
? console.error(result.error())
: console.info(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'crm.item.update',
[
'entityTypeId' => 2,
'id' => 233,
'fields' => [
'STAGE_ID' => 'EXECUTING',
'categoryId' => 0
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Deal Card
The main workspace in a deal is the General tab of its card. It consists of two parts:
-
the left part, which contains fields with information. If the system fields are insufficient, you can create your own custom fields. They allow you to store information in various data formats: string, number, link, address, and others. To create, modify, retrieve, or delete custom deal fields, the group of methods crm.deal.userfield.* is used.
-
the right part, which contains the deal's timeline. In it, you can create, edit, filter, and delete CRM activities — the group of methods crm.activity.*, and timeline records — the group of methods crm.timeline.*.
The parameters of the deal card can be managed depending on the funnel through the group of methods crm.deal.details.configuration.*.
User Documentation
Widgets
You can embed an application into the deal card. By embedding, you can use the application without leaving the deal card.
There are two embedding scenarios:
- Use special embedding locations. For example, by creating your own tab.
- Create a custom field, into which the interface of your application will be loaded.
Typical Use-Cases and Scenarios
Recurring Deals
Automatic creation of similar recurring deals based on templates. To manage templates, the group of methods crm.deal.recurring.* is used.
Overview of Methods and Events
Scope:
crmWho can execute the method: depending on the method
Main
|
Method |
Description |
|
Creates a new deal |
|
|
Modifies a deal |
|
|
Returns a deal by ID |
|
|
Returns a list of deals by filter |
|
|
Deletes a deal and all associated objects |
|
|
Returns the description of deal fields |
|
|
Adds products to a deal |
|
|
Returns products of a deal |
|
Event |
Triggered |
|
When a deal is created |
|
|
When a deal is modified |
|
|
When a deal is deleted |
|
|
When the deal's funnel is changed |
Recurring Deals
|
Method |
Description |
|
Creates a new recurring deal |
|
|
Returns a list of fields for the recurring deal template |
|
|
Creates a new deal from a template |
|
|
Modifies existing settings for the recurring deal template |
|
|
Retrieves the settings fields of the recurring deal template by Id |
|
|
Retrieves a list of settings for recurring deal templates |
|
|
Deletes existing settings for the recurring deal template |
|
Event |
Triggered |
|
When a new recurring deal is created |
|
|
When a recurring deal is modified |
|
|
When a recurring deal is deleted |
|
|
When a new deal is created from a recurring deal |
Custom Fields
|
Method |
Description |
|
Creates a new custom field for deals |
|
|
Modifies an existing custom field for deals |
|
|
Retrieves a custom field for deals by Id |
|
|
Retrieves a list of custom fields for deals |
|
|
Deletes a custom field for deals |
|
Event |
Triggered |
|
When a custom field is added |
|
|
When a custom field is modified |
|
|
When a custom field is deleted |
|
|
When the set of values for a custom list-type field is changed |
Deal Contacts
|
Method |
Description |
|
Adds a contact to a deal |
|
|
Adds multiple contacts to a deal |
|
|
Returns the fields for the deal-contact relationship |
|
|
Retrieves the set of contacts associated with the deal |
|
|
Removes a contact from the specified deal |
|
|
Removes a set of contacts associated with the specified deal |
Managing Deal Cards
|
Method |
Description |
|
Retrieves the settings for deal cards |
|
|
Resets the settings for deal cards |
|
|
Allows setting the settings for deal cards |
|
|
Forces a common deal card for all users |