Client Details Autofill Point in CRM

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: crm

The CRM_REQUISITE_AUTOCOMPLETE point connects an application handler to the search for client details in a CRM card. It is required when an application searches for and populates Company details for a company or contact from an external source.

The general workflow and common errors are described in the Autofilling details in the CRM card overview.

How to register a handler

When registering a handler using the placement.bind method, pass the value CRM_REQUISITE_AUTOCOMPLETE in the PLACEMENT parameter. Bitrix24 uses this code to determine that the handler belongs to client details autofill.

Connection parameters are not included in the data that Bitrix24 passes to the handler during a search.

Required parameters are marked with *

Parameter
type

Description

PLACEMENT*
string

Embedding point code. Pass the value CRM_REQUISITE_AUTOCOMPLETE

HANDLER*
string

Application handler URL

TITLE
string

Handler name in the search source selection interface

OPTIONS[countries]
string

Country identifiers separated by commas without spaces. If the parameter is not passed, the handler is available to all countries for which the search field is open.

Country identifiers can be obtained via the crm.requisite.preset.countries

Example of registering a handler:

BX24.callMethod(
            'placement.bind',
            {
                PLACEMENT: 'CRM_REQUISITE_AUTOCOMPLETE',
                HANDLER: 'https://example.com/requisite-autocomplete/',
                TITLE: 'Search for details',
                OPTIONS: {
                    countries: '1,14'
                }
            },
            function(result)
            {
                if (result.error())
                {
                    console.error(result.error());
                }
            }
        );
        

What the handler receives

Bitrix24 sends a POST request with the point data to the handler. The searchQuery string is passed in the PLACEMENT_OPTIONS parameter — this is the string that the user entered in the details search field.

Example POST request:

Array
        (
            [DOMAIN] => xxx.bitrix24.com
            [PROTOCOL] => 1
            [LANG] => ru
            [APP_SID] => 8b3f2c5d9c1a4f6e9d7a2b4c6f8e1a3d
            [AUTH_ID] => 1f0f107e5806d5fe9a98e02021a72e57645f86a
            [AUTH_EXPIRES] => 3600
            [REFRESH_ID] => 1f0f107a80816604b24a8719792ac2a21d629b5
            [member_id] => da45a03b265edd8787f8a258d793cc5d
            [status] => L
            [PLACEMENT] => CRM_REQUISITE_AUTOCOMPLETE
            [PLACEMENT_OPTIONS] => {"searchQuery":"1707083893"}
        )
        

Parameter
type

Description

DOMAIN*
string

The Bitrix24 address where the widget handler was invoked

PROTOCOL*
string

Secure or non-secure HTTP protocol:

  • 0 - HTTP
  • 1 - HTTPS

LANG*
string

The user interface language of Bitrix24 that invoked the widget. You can localize the interface language in your widget based on this value

APP_SID
string

String identifier of the application that registered the widget handler

AUTH_ID
string

Authorization token OAuth 2 issued for the user who invoked the widget. Can be used for REST API calls on behalf of this user

AUTH_EXPIRES
integer

Time in seconds after which the authorization token will become invalid

REFRESH_ID
string

Refresh token OAuth 2 issued for the user who invoked the widget. Can be used to refresh the authorization token on behalf of this user

member_id*
string

Unique string identifier of Bitrix24 where the widget handler was invoked.

status
string

Type of application that registered the handler for this widget. Accepts values:

PLACEMENT*
string

Code for the widget embedding location. You can use the same handler URL for all your widgets. The value that Bitrix24 will report in the PLACEMENT parameter will help determine from which specific widget embedding location your handler was invoked in each case

PLACEMENT_OPTIONS
string

Additional data in the form of a JSON string that defines the context of the widget execution. For example, this could be an array containing the numeric identifier of the CRM object in the detail form where the widget handler was invoked, etc. The PLACEMENT_OPTIONS parameter, along with the PLACEMENT parameter, allows you to accurately determine for which specific widget embedding location and object the widget handler was invoked.

How to return found options

Pass the found options using the BX24.placement.call command with the name crmShowFoundEntities.

Field
type

Description

data
array

List of found options

data[].id
string

Option identifier on the application side

data[].name
string

Option name that will be shown to the user

data[].phone
string

Option phone. Pass the field if the number is found

data[].email
string

Option E-mail. Pass the field if the address is found

data[].web
string

Option website. Pass the field if the website is found

BX24.placement.call(
            'crmShowFoundEntities',
            {
                data: [
                    {
                        id: 'company-123',
                        name: 'Acme LLC',
                        phone: '+1 495 000-00-00',
                        email: 'info@example.com',
                        web: 'https://example.com'
                    }
                ]
            }
        );
        

How to create the selected option

If a user selects an option from the application response, Bitrix24 triggers the onCrmEntityIsNeedToCreate interface event. Subscribe to it using the BX24.placement.bindEvent method.

The data of the selected option is passed to the onCrmEntityIsNeedToCreate event handler.

Field
type

Description

appSid
string

Application session identifier in which the selected option was found

data
object

Data of the selected option from the list that the application passed via crmShowFoundEntities

In the fields object, pass the detail fields that should be populated in the CRM card. The composition of the object depends on the data that the application retrieved from its source.

BX24.placement.bindEvent('onCrmEntityIsNeedToCreate', function (eventData) {
            const selected = eventData.data;
            const selectedTitle = selected.title || selected.name;
        
            BX24.placement.call(
                'crmShowCreatedEntity',
                {
                    entityType: 'company',
                    id: selected.id,
                    title: selectedTitle,
                    fields: {
                        RQ_COMPANY_NAME: selectedTitle
                    }
                }
            );
        });
        

Fields of the crmShowCreatedEntity command:

Field
type

Description

entityType
string

Created object type. For a company, pass company, for a contact — contact

id
string

Created object identifier on the application side

title
string

Created object name

fields
object

Requisite fields to be inserted into the CRM card

Continue Learning