Create Inventory Document catalog.document.add
Scope:
catalogWho can execute the method: a user with "Create and edit" permission for the required document type
The method catalog.document.add creates a new inventory document.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
fields* |
Document fields (detailed description) |
Parameter fields
Required parameters are marked with *
|
Name |
Description |
|
docType* |
Document type. Possible values:
Current document types can be obtained using the method catalog.enum.getStoreDocumentTypes |
|
currency* |
Document currency in ISO 4217 format, for example To get a list of currencies with codes, use the method crm.currency.list |
|
responsibleId* |
Identifier of the responsible person |
|
siteId |
Site code to which the document relates. Default is This parameter is relevant for on-premise Bitrix, for cloud Bitrix the standard value is |
|
dateDocument |
Document date in ISO 8601 format |
|
title |
Document title |
|
commentary |
Document commentary |
|
total |
Total amount for the document items. The value is calculated automatically after processing but can be set manually |
|
docNumber |
Internal document number. If not provided, it is generated automatically |
|
createdBy |
Identifier of the user who created the document. An administrator can specify any value; by default, it is filled with the current user |
To fill in supplier data, use the method catalog.documentcontractor.add.
To fill in product data, use the method catalog.document.element.add.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"docType":"A","currency":"USD","responsibleId":29,"docNumber":"IN-00042","title":"Receipt from Supplier-1","commentary":"Planned warehouse replenishment"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/catalog.document.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"docType":"A","currency":"USD","responsibleId":29,"docNumber":"IN-00042","title":"Receipt from Supplier-1","commentary":"Planned warehouse replenishment"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/catalog.document.add
try
{
const response = await $b24.callMethod(
'catalog.document.add',
{
fields: {
docType: 'A',
currency: 'USD',
responsibleId: 29,
docNumber: 'IN-00042',
title: 'Receipt from Supplier-1',
commentary: 'Planned warehouse replenishment',
}
}
);
const result = response.getData().result;
console.log('Created element with ID:', result);
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'catalog.document.add',
[
'fields' => [
'docType' => 'A',
'currency' => 'USD',
'responsibleId' => 29,
'docNumber' => 'IN-00042',
'title' => 'Receipt from Supplier-1',
'commentary' => 'Planned warehouse replenishment'
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error adding product row: ' . $e->getMessage();
}
BX24.callMethod(
'catalog.document.add',
{
fields: {
docType: 'A',
currency: 'USD',
responsibleId: 29,
docNumber: 'IN-00042',
title: 'Receipt from Supplier-1',
commentary: 'Planned warehouse replenishment'
}
},
function(result)
{
if (result.error())
console.error(result.error());
else
console.log(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'catalog.document.add',
[
'fields' => [
'docType' => 'A',
'currency' => 'USD',
'responsibleId' => 29,
'docNumber' => 'IN-00042',
'title' => 'Receipt from Supplier-1',
'commentary' => 'Planned warehouse replenishment'
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP code: 200
{
"result": {
"document": {
"commentary": "Planned warehouse replenishment",
"createdBy": 29,
"currency": "USD",
"dateCreate": "2025-10-30T11:19:38+02:00",
"dateDocument": null,
"dateModify": "2025-10-30T11:19:38+02:00",
"dateStatus": "2025-10-30T11:19:38+02:00",
"docNumber": "IN-00042",
"docType": "A",
"id": 11,
"modifiedBy": 29,
"responsibleId": 29,
"siteId": "s1",
"status": "N",
"statusBy": null,
"title": "Receipt from Supplier-1",
"total": null
}
},
"time": {
"start": 1761805178,
"finish": 1761805178.991429,
"duration": 0.9914290904998779,
"processing": 0,
"date_start": "2025-10-30T09:19:38+02:00",
"date_finish": "2025-10-30T09:19:38+02:00",
"operating_reset_at": 1761805778,
"operating": 0.2595658302307129
}
}
The document is created with status N — draft. To process the document, use the method catalog.document.conduct or catalog.document.conductList.
Returned Data
|
Name |
Description |
|
result |
Root element of the response |
|
document |
Object with data of the created document |
|
time |
Information about the request execution time |
Error Handling
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
HTTP code: 400
{
"error": "0",
"error_description": "DOC_TYPE isn't available"
}
Possible Error Codes
|
Code |
Description |
Value |
|
|
Insufficient permissions to save the document |
The user does not have permission to create the required document type |
|
|
DOC_TYPE isn't available |
An invalid document type was provided |
|
|
Inventory accounting is not available on your plan |
Inventory accounting is not available on your plan |
|
|
- |
Other internal errors when adding the document |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Add Product to Inventory Document catalog.document.element.add
- Add Vendor to Inventory Document catalog.documentcontractor.add
- Update Warehouse Accounting Document catalog.document.update
- Conduct Warehouse Accounting Document catalog.document.conduct