Numbering Rules: Overview of Methods

A numbering rule defines the number template and counter settings for CRM documents. For example, a numbering rule with the template INV-{NUMBER} assigns document numbers in the format INV-1, INV-2.

The numbering rule is a preliminary step: it is created once and linked to the document template via numeratorId. Multiple templates can use a single numbering rule, sharing one counter.

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.

Quick navigation: all methods

User documentation: Create and configure auto numbering template in CRM

Getting Started

  1. Create a numbering rule using the method crm.documentgenerator.numerator.add — pass the name and the number template. If the numbering rule already exists, find its id using the method crm.documentgenerator.numerator.list.
  2. Pass the received id as numeratorId to crm.documentgenerator.template.add when uploading a template, or to crm.documentgenerator.template.update for a template that has already been uploaded.
  3. Create a document from this template using the method crm.documentgenerator.document.add — the number is inserted automatically.

What a Numbering Rule Consists Of

  • Number Template. A string with placeholders, for example INV-{NUMBER}. The {NUMBER} placeholder is replaced with the counter value.
  • Counter Settings. These define the starting value and the step of the counter, the minimum length of the number, and the reset period — day, month, year, or no reset.

The exact list of placeholders and settings is described in the parameters of the method crm.documentgenerator.numerator.add.

Important Considerations

Relationship with Other Objects

Document Templates. The numbering rule is linked to the template via the numeratorId parameter in the methods crm.documentgenerator.template.add and crm.documentgenerator.template.update.

Documents. The document number is generated by the method crm.documentgenerator.document.add when creating a document from a template. If the numbering rule does not return the next number during generation, the method will return an error.

Overview of Methods

Scope: crm

Who can execute the method: a user with permission to modify document generator templates

Method

Description

crm.documentgenerator.numerator.add

Adds a new numbering rule

crm.documentgenerator.numerator.update

Updates an existing numbering rule

crm.documentgenerator.numerator.get

Returns information about the numbering rule by identifier

crm.documentgenerator.numerator.list

Returns a list of numbering rules

crm.documentgenerator.numerator.delete

Deletes a numbering rule