Add Product crm.product.add
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Scope:
crmWho can execute the method: administrator, user with the "Allow to modify settings" access permission in CRM
DEPRECATED
The development of this method has been halted. Please use catalog.product.add.
The method crm.product.add creates a new product.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
fields |
Field values for creating the product. To find out the required format of the fields, execute the method crm.product.fields and check the format of the incoming values for these fields |
Note
Starting from version CRM 21.700.0, support for auto-generating the product's symbolic code has been included.
If the generated symbolic code exceeds 100 characters, it will be automatically truncated to 100 characters. This should be taken into account when creating requests by passing a unique value at the beginning/middle of the product name to avoid duplicate symbolic codes.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"NAME":"Plastic Chair","CURRENCY_ID":"USD","PRICE":4900,"SORT":500}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.product.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"NAME":"Plastic Chair","CURRENCY_ID":"USD","PRICE":4900,"SORT":500},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.product.add
try
{
const response = await $b24.callMethod(
'crm.product.add',
{
fields:
{
"NAME": "Plastic Chair",
"CURRENCY_ID": "USD",
"PRICE": 4900,
"SORT": 500
}
}
);
const result = response.getData().result;
console.info('Created new product with ID ' + result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$fields = [
'NAME' => 'Sample Product',
'PRICE' => '100.00',
'CURRENCY_ID' => 'USD',
'ACTIVE' => 'Y',
'DATE_CREATE' => (new DateTime())->format(DateTime::ATOM),
'TIMESTAMP_X' => (new DateTime())->format(DateTime::ATOM),
'CREATED_BY' => 1,
'MODIFIED_BY' => 1,
'CATALOG_ID' => 1,
'DESCRIPTION' => 'This is a sample product.',
'VAT_ID' => 1,
'VAT_INCLUDED' => 'Y',
'MEASURE' => 1,
'SECTION_ID' => 1,
'SORT' => 100,
'XML_ID' => 'sample_product_001',
];
$result = $serviceBuilder->getCRMScope()->product()->add($fields);
print($result->getId());
} catch (Throwable $e) {
print("Error: " . $e->getMessage());
}
BX24.callMethod(
"crm.product.add",
{
fields:
{
"NAME": "Plastic Chair",
"CURRENCY_ID": "USD",
"PRICE": 4900,
"SORT": 500
}
},
function(result)
{
if(result.error())
console.error(result.error());
else
console.info("Created new product with ID " + result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'crm.product.add',
[
'fields' => [
'NAME' => 'Plastic Chair',
'CURRENCY_ID' => 'USD',
'PRICE' => 4900,
'SORT' => 500
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client and ctx are already created — see the Go SDK section
res, err := client.Core().Call(ctx, "crm.product.add", b24.Params{
"fields": b24.Params{
"NAME": "Plastic Chair",
"CURRENCY_ID": "EUR",
"PRICE": 4900,
"SORT": 500,
},
})
if err != nil {
return fmt.Errorf("crm.product.add: %w", err)
}
// The response arrives as json.RawMessage — unmarshal it
// into a struct matching the response shape shown below on this page.
fmt.Printf("%s\n", res.Result)