Get Deal by Id crm.deal.get
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:
crmWho can execute the method: any user with "read" access permission for deals
DEPRECATED
The development of this method has been halted. Please use crm.item.get.
The method crm.deal.get returns a deal by its identifier.
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 |
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":410}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.deal.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"ID":410,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.deal.get
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (match the "response handling" section of the page)
type CrmDealResult = {
ID: string
TITLE: string
TYPE_ID: string
STAGE_ID: string
CATEGORY_ID: string
OPPORTUNITY: string
CURRENCY_ID: string
PROBABILITY: string
COMPANY_ID: string
CONTACT_ID: string
ASSIGNED_BY_ID: string
OPENED: string
CLOSED: string
BEGINDATE: ISODate | null
CLOSEDATE: ISODate | null
DATE_CREATE: ISODate | null
DATE_MODIFY: ISODate | null
}
try {
const response = await $b24.actions.v2.call.make<CrmDealResult>({
method: 'crm.deal.get',
params: {
id: 410,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Deal:', result.ID, result.TITLE)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getDeal() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'crm.deal.get',
params: {
id: 410,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Deal:', result.ID, result.TITLE)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getDeal)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.crm.deal.get(bitrix_id=123).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
try {
$response = $b24Service
->core
->call(
'crm.deal.get',
[
'id' => 410,
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
echo 'Deal data: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting deal: ' . $e->getMessage();
}
BX24.callMethod(
'crm.deal.get',
{
id: 410,
},
(result) => {
result.error()
? console.error(result.error())
: console.info(result.data())
;
},
);
require_once('crest.php');
$result = CRest::call(
'crm.deal.get',
[
'ID' => 410
]
);
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.deal.get", b24.Params{
"id": 410,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("crm.deal.get: %w", err)
}
var item struct {
ID b24.ID `json:"ID"`
Title string `json:"TITLE"`
TypeID string `json:"TYPE_ID"`
StageID string `json:"STAGE_ID"`
Probability string `json:"PROBABILITY"`
CurrencyID string `json:"CURRENCY_ID"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
return fmt.Errorf("parse response: %w", err)
}
fmt.Println(item.ID, item.Title)
Response Handling
HTTP Status: 200
{
"result": {
"ID": "410",
"TITLE": "New Deal #1",
"TYPE_ID": "COMPLEX",
"STAGE_ID": "PREPARATION",
"PROBABILITY": "99",
"CURRENCY_ID": "EUR",
"OPPORTUNITY": "1000000.00",
"IS_MANUAL_OPPORTUNITY": "Y",
"TAX_VALUE": "0.00",
"LEAD_ID": null,
"COMPANY_ID": "9",
"CONTACT_ID": "84",
"QUOTE_ID": null,
"BEGINDATE": "2024-08-30T02:00:00+02:00",
"CLOSEDATE": "2024-09-09T02:00:00+02:00",
"ASSIGNED_BY_ID": "1",
"CREATED_BY_ID": "1",
"MODIFY_BY_ID": "1",
"DATE_CREATE": "2024-08-30T14:29:00+02:00",
"DATE_MODIFY": "2024-08-30T14:29:00+02:00",
"OPENED": "Y",
"CLOSED": "N",
"COMMENTS": "[B]Example comment[\/B]",
"ADDITIONAL_INFO": "Additional information",
"LOCATION_ID": null,
"CATEGORY_ID": "0",
"STAGE_SEMANTIC_ID": "P",
"IS_NEW": "N",
"IS_RECURRING": "N",
"IS_RETURN_CUSTOMER": "N",
"IS_REPEATED_APPROACH": "N",
"SOURCE_ID": "CALLBACK",
"SOURCE_DESCRIPTION": "Additional source information",
"ORIGINATOR_ID": null,
"ORIGIN_ID": null,
"MOVED_BY_ID": "1",
"MOVED_TIME": "2024-08-30T14:29:00+02:00",
"LAST_ACTIVITY_TIME": "2024-08-30T14:29:00+02:00",
"UTM_SOURCE": "google",
"UTM_MEDIUM": "CPC",
"UTM_CAMPAIGN": null,
"UTM_CONTENT": null,
"UTM_TERM": null,
"PARENT_ID_1220": "22",
"LAST_ACTIVITY_BY": "1",
"UF_CRM_1721244482250": "Hello world!"
},
"time": {
"start": 1725020945.541275,
"finish": 1725020946.179076,
"duration": 0.637800931930542,
"processing": 0.21427488327026367,
"date_start": "2024-08-30T14:29:05+02:00",
"date_finish": "2024-08-30T14:29:06+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
The root element of the response. Contains information about the deal fields. The structure is described below |
|
time |
Information about the request execution time |
Deal Type
|
Name |
Description |
|
ID |
The identifier of the deal |
|
TITLE |
Title |
|
TYPE_ID |
String identifier of the deal type. To learn more about the obtained deal type, you can use the method crm.status.list by passing the filter:
|
|
CATEGORY_ID |
Sales Funnel. To learn more about this funnel, you can use the method crm.category.get by passing |
|
STAGE_ID |
String identifier of the deal stage. To learn more about the obtained stage, you can use the method crm.status.list by passing the filter:
where:
|
|
STAGE_SEMANTIC_ID |
Stage group. Possible values:
|
|
IS_NEW |
Indicates whether the deal is new. Possible values:
|
|
IS_RECURRING |
Indicates whether the deal is recurring. Possible values:
|
|
IS_RETURN_CUSTOMER |
Indicates whether the deal is a repeat. Possible values:
|
|
IS_REPEATED_APPROACH |
Indicates whether the approach is repeated. Possible values:
|
|
PROBABILITY |
Probability, % |
|
CURRENCY_ID |
Currency |
|
OPPORTUNITY |
Amount |
|
IS_MANUAL_OPPORTUNITY |
Indicates whether manual mode for calculating the amount is enabled. Possible values:
|
|
TAX_VALUE |
Tax rate |
|
COMPANY_ID |
Identifier of the company. To learn more about the company, you can use the method crm.item.get by passing |
|
CONTACT_ID |
Identifier of the contact. Deprecated. To get a list of all contacts associated with the deal, use the method crm.deal.contact.items.get or the universal method crm.item.get |
|
QUOTE_ID |
Identifier of the estimate based on which the deal was created. To learn more about the estimate, you can use the method crm.item.get by passing |
|
BEGINDATE |
Start date |
|
CLOSEDATE |
Close date |
|
OPENED |
Indicates whether the deal is available to everyone. Possible values:
|
|
CLOSED |
Indicates whether the deal is closed. Possible values:
|
|
COMMENTS |
Comment |
|
ASSIGNED_BY_ID |
Responsible person |
|
CREATED_BY_ID |
Created by |
|
MODIFY_BY_ID |
Modified by |
|
MOVED_BY_ID |
Identifier of the user who last changed the stage |
|
DATE_CREATE |
Creation date |
|
DATE_MODIFY |
Modification date |
|
MOVED_TIME |
Date of the last stage change |
|
SOURCE_ID |
Source. To learn more about the obtained source, you can use the method crm.status.list by passing the filter:
|
|
SOURCE_DESCRIPTION |
Additional information about the source |
|
LEAD_ID |
Identifier of the lead based on which the deal was created. To learn more about the lead, you can use the method crm.item.get by passing |
|
ADDITIONAL_INFO |
Additional information |
|
LOCATION_ID |
Location. System field |
|
ORIGINATOR_ID |
External source |
|
ORIGIN_ID |
Identifier of the item in the external source |
|
UTM_SOURCE |
Advertising system |
|
UTM_MEDIUM |
Traffic type |
|
UTM_CAMPAIGN |
Advertising campaign designation |
|
UTM_CONTENT |
Campaign content |
|
UTM_TERM |
Campaign search term |
|
LAST_ACTIVITY_TIME |
Date of the last activity in the timeline |
|
LAST_ACTIVITY_BY |
Author of the last activity in the timeline |
|
UF_CRM_... |
Custom fields. For example, Depending on the portal settings, deals may have a set of custom fields of defined types. Read more in the section about custom fields |
|
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 relationship between this smart process and the deal. The field itself stores the identifier of the item of that smart process. For example, the field |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "Parameter 'fields' must be array."
}
|
Name |
Description |
|
error |
String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only |
|
error_description |
Error message for the developer. Do not show it to the end user without processing |
Possible Error Codes
|
Code |
Description |
Value |
|
Empty value |
|
The |
|
Empty value |
|
The user does not have permission to "read" this deal |
|
Empty value |
|
No deal exists with the provided |
Statuses and System Error Codes
HTTP Status: 4xx, 5xx
The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit |
|
|
|
The request contains no authorization data: neither an access token nor a webhook code was passed |
|
|
|
Methods are called over the HTTPS protocol only |
|
|
|
The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support |
|
|
|
REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — |
|
|
|
No active webhook with the specified user identifier and secret code was found |
|
|
|
No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope |
|
|
|
The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with |
|
|
|
The access token has expired |
|
|
|
The application is installed, but the Bitrix24 administrator has granted access to it only to specific users |
|
|
|
The public part of the site is closed. To open it 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 |