Linking Orders to CRM Entities: Overview of Methods

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.

Online store orders can be linked to CRM entities. This allows you to use order information in workflows related to deals and invoices.

Quick Navigation: all methods

Linking to Other Entities

Online Store Orders. The order identifier orderId links the order record to a CRM entity.

CRM Entities. The linking is supported for deals and invoices using the parameter pair ownerTypeId and ownerId. The first defines the type of entity, while the second specifies the identifier of a particular deal or invoice.

Getting Started

  1. Obtain the order identifier orderId using the sale.order.add or sale.order.list methods.
  2. Determine the entity type ownerTypeId using the crm.enum.ownertype method: 2 for deals, 31 for invoices.
  3. Retrieve ownerId using the crm.deal.list method for deals or crm.item.list with entityTypeId = 31 for invoices.
  4. Create the link using the crm.orderentity.add method.
  5. Check the result using the crm.orderentity.list method.
  6. If necessary, remove the link using the crm.orderentity.deleteByFilter method.
  7. To obtain the structure of the link fields, use crm.orderentity.getFields.

Overview of Methods

Scope: crm

Who can execute the methods: depending on the method

Method

Description

crm.orderentity.add

Creates a link between an order and a CRM entity

crm.orderentity.list

Returns a list of links between orders and CRM entities

crm.orderentity.deleteByFilter

Deletes a link between an order and a CRM entity

crm.orderentity.getFields

Returns the fields of the order link