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
- 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
idusing the method crm.documentgenerator.numerator.list. - Pass the received
idasnumeratorIdto crm.documentgenerator.template.add when uploading a template, or to crm.documentgenerator.template.update for a template that has already been uploaded. - 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
- The methods crm.documentgenerator.numerator.update and crm.documentgenerator.numerator.delete only work with numbering rules created using the method crm.documentgenerator.numerator.add. Numbering rules created in the Bitrix24 interface cannot be modified or deleted via REST.
- The numbering rules of the document generator in CRM and the numbering rules of the Document Generator section are different groups of methods. For CRM documents, use
crm.documentgenerator.numerator.*.
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:
crmWho can execute the method: a user with permission to modify document generator templates
|
Method |
Description |
|
Adds a new numbering rule |
|
|
Updates an existing numbering rule |
|
|
Returns information about the numbering rule by identifier |
|
|
Returns a list of numbering rules |
|
|
Deletes a numbering rule |