Add Product catalog.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:
catalogWho can execute the method: a user with the "Create product" permission and one of the following permissions: "View product catalog", "View catalog products", or "Edit selling price"
The catalog.product.add method adds a product to the trade catalog and returns its fields.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
fields* |
Object with the fields of the new product (detailed description) |
Parameter fields
Required parameters are marked with *
|
Name |
Description |
|
iblockId* |
Identifier of the trade catalog information block. You can retrieve the identifier using the catalog.catalog.list method. Pass the products information block, not the variations one: with the variations information block, the method creates a variation without a parent product. Add variations using the catalog.product.offer.add method |
|
name* |
Product name |
|
active |
Product activity. Possible values:
Other values are saved as Default: |
|
code |
Symbolic code |
|
xmlId |
External code. If not passed, it matches the product identifier |
|
sort |
Sorting Default: |
|
createdBy |
Identifier of the user who created the product. You can retrieve the identifier using the user.get method. Default: the user who called the method |
|
modifiedBy |
Identifier of the user who modified the product. Default: the user who called the method |
|
dateActiveFrom |
Activity start date. Currently the date cannot be set: a string in any format causes the "Incorrect starting date format" error, and a number is ignored. |
|
dateActiveTo |
Activity end date. Currently the date cannot be set: a string in any format causes the "Incorrect expiration date format" error, and a number is ignored. |
|
dateCreate |
Creation date. The field is filled in automatically, so you do not need to pass it: currently a passed date is saved incorrectly, for example, |
|
iblockSectionId |
Identifier of the main section. You can retrieve the identifier using the catalog.section.list method. For a nonexistent section, the method returns the |
|
iblockSection |
Array of identifiers of the sections to link the product to, for example, |
|
previewText |
Preview description |
|
previewTextType |
Type of the preview description. Possible values:
Default: |
|
previewPicture |
Preview picture. An object in the format To delete the picture, pass |
|
detailText |
Detailed description |
|
detailTextType |
Type of the detailed description. Possible values:
Default: |
|
detailPicture |
Detailed picture. An object in the format To delete the picture, pass |
|
quantity |
Available quantity. When inventory management is enabled, the value is not retained: the method returns no error, but the field keeps its previous value |
|
quantityReserved |
Reserved quantity. When inventory management is enabled, the value is not retained: the method returns no error, but the field keeps its previous value |
|
quantityTrace |
Quantity accounting mode. Possible values:
Default: The response returns the resulting value |
|
canBuyZero |
Allow purchase when the product is out of stock. Possible values:
Default: The response returns the resulting value |
|
subscribe |
Allow subscription to the product. Possible values:
Default: The response returns the resulting value |
|
vatId |
VAT rate identifier. You can retrieve the identifier using the catalog.vat.list method |
|
vatIncluded |
VAT is included in the price. Possible values:
Default: |
|
purchasingPrice |
Purchasing price. When inventory management is enabled, the value is not retained: the method returns no error, but the field keeps its previous value |
|
purchasingCurrency |
Purchasing price currency, for example, When inventory management is enabled, the value is not retained: the method returns no error, but the field keeps its previous value |
|
barcodeMulti |
Unique barcode for each item. Possible values:
Default: |
|
weight |
Weight |
|
length |
Length |
|
width |
Width |
|
height |
Height |
|
measure |
Unit of measure identifier. You can retrieve the identifier using the catalog.measure.list method. The method does not check that the unit of measure exists: a nonexistent identifier is saved without an error |
|
recurSchemeLength |
Payment period length. Used only in the on-premise version for selling content |
|
recurSchemeType |
Time unit of the payment period. Possible values:
Default: Used only in the on-premise version for selling content |
|
trialPriceId |
Identifier of the product for trial payment. Used only in the on-premise version for selling content |
|
withoutOrder |
Renewal without placing an order. Possible values:
Default: Used only in the on-premise version for selling content |
|
propertyN |
Product property value, where Pass a single property value as a string, a number, or a The method skips properties with a nonexistent identifier without an error. Uploading values of "File" properties is described in the How to Upload Files article |
The id, type, available, bundle, and timestampX fields are filled in automatically. The method skips fields that are not in the table without an error.
Working with Product Prices
To set the product price, use the catalog.price.* methods.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"iblockId":25,"name":"Basic T-shirt","code":"tshirt-basic","iblockSectionId":41,"iblockSection":[41,39],"vatId":1,"vatIncluded":"Y","measure":9,"weight":200,"previewText":"Cotton T-shirt","previewPicture":{"fileData":["photo.png","iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="]},"property301":"TS-001","property305":["Cotton","Polyester"]}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/catalog.product.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"iblockId":25,"name":"Basic T-shirt","code":"tshirt-basic","iblockSectionId":41,"iblockSection":[41,39],"vatId":1,"vatIncluded":"Y","measure":9,"weight":200,"previewText":"Cotton T-shirt","previewPicture":{"fileData":["photo.png","iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="]},"property301":"TS-001","property305":["Cotton","Polyester"]},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/catalog.product.add
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of the payload returned in result (match the "response handling" section of the page)
type ProductResult = {
element: {
id: number,
iblockId: number,
iblockSectionId: number | null,
iblockSection: number[] | null,
name: string,
code: string | null,
active: string,
xmlId: string,
dateCreate: ISODate,
timestampX: ISODate,
previewPicture: { id: string, url: string, urlMachine: string } | null,
detailPicture: { id: string, url: string, urlMachine: string } | null,
property301: { value: string, valueId: string } | null,
property305: Array<{ value: string, valueId: string }> | null,
[key: string]: unknown,
}
}
try {
const response = await $b24.actions.v2.call.make<ProductResult>({
method: 'catalog.product.add',
params: {
fields: {
iblockId: 25,
name: 'Basic T-shirt',
code: 'tshirt-basic',
iblockSectionId: 41,
iblockSection: [41, 39],
vatId: 1,
vatIncluded: 'Y',
measure: 9,
weight: 200,
previewText: 'Cotton T-shirt',
previewPicture: {
fileData: ['photo.png', 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='],
},
property301: 'TS-001',
property305: ['Cotton', 'Polyester'],
},
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Added product id:', result.element.id, 'name:', result.element.name)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function addProduct() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'catalog.product.add',
params: {
fields: {
iblockId: 25,
name: 'Basic T-shirt',
code: 'tshirt-basic',
iblockSectionId: 41,
iblockSection: [41, 39],
vatId: 1,
vatIncluded: 'Y',
measure: 9,
weight: 200,
previewText: 'Cotton T-shirt',
previewPicture: {
fileData: ['photo.png', 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='],
},
property301: 'TS-001',
property305: ['Cotton', 'Polyester'],
},
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Added product id:', result.element.id, 'name:', result.element.name)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', addProduct)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.catalog.product.add(
fields={
"iblockId": 25,
"name": "Basic T-shirt",
"code": "tshirt-basic",
"iblockSectionId": 41,
"iblockSection": [41, 39],
"vatId": 1,
"vatIncluded": "Y",
"measure": 9,
"weight": 200,
"previewText": "Cotton T-shirt",
"previewPicture": {
"fileData": ["photo.png", "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="],
},
"property301": "TS-001",
"property305": ["Cotton", "Polyester"],
},
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
try {
$response = $b24Service
->core
->call(
'catalog.product.add',
[
'fields' => [
'iblockId' => 25,
'name' => 'Basic T-shirt',
'code' => 'tshirt-basic',
'iblockSectionId' => 41,
'iblockSection' => [41, 39],
'vatId' => 1,
'vatIncluded' => 'Y',
'measure' => 9,
'weight' => 200,
'previewText' => 'Cotton T-shirt',
'previewPicture' => [
'fileData' => ['photo.png', 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='],
],
'property301' => 'TS-001',
'property305' => ['Cotton', 'Polyester'],
],
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error adding product: ' . $e->getMessage();
}
BX24.callMethod(
'catalog.product.add',
{
'fields': {
'iblockId': 25,
'name': 'Basic T-shirt',
'code': 'tshirt-basic',
'iblockSectionId': 41,
'iblockSection': [41, 39],
'vatId': 1,
'vatIncluded': 'Y',
'measure': 9,
'weight': 200,
'previewText': 'Cotton T-shirt',
'previewPicture': {
'fileData': ['photo.png', 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==']
},
'property301': 'TS-001',
'property305': ['Cotton', 'Polyester']
}
},
function(result)
{
if(result.error())
console.error(result.error());
else
console.log(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'catalog.product.add',
[
'fields' => [
'iblockId' => 25,
'name' => 'Basic T-shirt',
'code' => 'tshirt-basic',
'iblockSectionId' => 41,
'iblockSection' => [41, 39],
'vatId' => 1,
'vatIncluded' => 'Y',
'measure' => 9,
'weight' => 200,
'previewText' => 'Cotton T-shirt',
'previewPicture' => [
'fileData' => ['photo.png', 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='],
],
'property301' => 'TS-001',
'property305' => ['Cotton', 'Polyester'],
],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client and ctx are already created — see the Go SDK section
res, err := client.Core().Call(ctx, "catalog.product.add", b24.Params{
"fields": b24.Params{
"iblockId": 25,
"name": "Basic T-shirt",
"code": "tshirt-basic",
"iblockSectionId": 41,
"iblockSection": []int{41, 39},
"vatId": 1,
"vatIncluded": "Y",
"measure": 9,
"weight": 200,
"previewText": "Cotton T-shirt",
"previewPicture": b24.Params{
"fileData": []string{"photo.png", "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="},
},
"property301": "TS-001",
"property305": []string{"Cotton", "Polyester"},
},
})
if err != nil {
return fmt.Errorf("catalog.product.add: %w", err)
}
// The method wraps the response in an object with the "element" key.
raw, ok := b24.Unwrap(res.Result, "element")
if !ok {
return fmt.Errorf("no element key in the response")
}
var item struct {
ID int `json:"id"`
IblockID int `json:"iblockId"`
IblockSectionID int `json:"iblockSectionId"`
Name string `json:"name"`
Code string `json:"code"`
Active string `json:"active"`
XMLID string `json:"xmlId"`
}
if err := json.Unmarshal(raw, &item); err != nil {
return fmt.Errorf("parse response: %w", err)
}
fmt.Println(item.ID, item.Name)
Response Handling
HTTP status: 200
{
"result": {
"element": {
"active": "Y",
"available": "Y",
"barcodeMulti": "N",
"bundle": "N",
"canBuyZero": "Y",
"code": "tshirt-basic",
"createdBy": 1269,
"dateActiveFrom": null,
"dateActiveTo": null,
"dateCreate": "2026-11-05T18:23:16+01:00",
"detailPicture": null,
"detailText": null,
"detailTextType": "text",
"height": null,
"iblockId": 25,
"iblockSection": [
39,
41
],
"iblockSectionId": 41,
"id": 7651,
"length": null,
"measure": 9,
"modifiedBy": 1269,
"name": "Basic T-shirt",
"previewPicture": {
"id": "40041",
"url": "/rest/catalog.product.download?fields%5BfieldName%5D=previewPicture&fields%5BfileId%5D=40041&fields%5BproductId%5D=7651",
"urlMachine": "/rest/catalog.product.download?fields%5BfieldName%5D=previewPicture&fields%5BfileId%5D=40041&fields%5BproductId%5D=7651"
},
"previewText": "Cotton T-shirt",
"previewTextType": "text",
"property301": {
"value": "TS-001",
"valueId": "4083"
},
"property305": [
{
"value": "Cotton",
"valueId": "4085"
},
{
"value": "Polyester",
"valueId": "4087"
}
],
"purchasingCurrency": null,
"purchasingPrice": null,
"quantity": null,
"quantityReserved": null,
"quantityTrace": "Y",
"recurSchemeLength": null,
"recurSchemeType": "D",
"sort": 500,
"subscribe": "Y",
"timestampX": "2026-11-05T18:23:16+01:00",
"trialPriceId": null,
"type": 1,
"vatId": 1,
"vatIncluded": "Y",
"weight": 200,
"width": null,
"withoutOrder": "N",
"xmlId": "7651"
}
},
"time": {
"start": 1793892196,
"finish": 1793892196.679604,
"duration": 0.6796040534973145,
"processing": 0,
"date_start": "2026-11-05T18:23:16+01:00",
"date_finish": "2026-11-05T18:23:16+01:00",
"operating_reset_at": 1793892360,
"operating": 1.0158729553222656
}
}
Returned Data
|
Name |
Description |
|
result |
Request result containing the created product |
|
result.element |
Object with information about the added product |
|
time |
Information about the request execution time |
Error Handling
HTTP status: 400
{
"error":"200040300010",
"error_description":"Access Denied"
}
|
Name |
Description |
|
error |
String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only |
|
error_description |
Error message for the developer. Do not show it to the end user without processing |
Possible Error Codes
|
Status |
Code |
Description |
Value |
|
|
|
|
The section in |
|
|
|
|
No permission to create a product |
|
|
|
|
No permission to add an information block element |
|
|
|
|
No permission to view the product catalog |
|
|
|
|
The information block in |
|
|
|
|
The required |
|
|
|
|
Required fields are missing in |
|
|
|
|
A |
|
|
|
|
The VAT rate in |
|
|
|
|
The purchasing price currency was not found |
|
|
|
|
The user in |
|
|
|
|
An internal error occurred while saving the product |
Validation of required fields and product properties can return additional errors that describe a specific field.
Statuses and System Error Codes
HTTP Status: 4xx, 5xx
The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit |
|
|
|
The request contains no authorization data: neither an access token nor a webhook code was passed |
|
|
|
Methods are called over the HTTPS protocol only |
|
|
|
The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support |
|
|
|
REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — |
|
|
|
No active webhook with the specified user identifier and secret code was found |
|
|
|
No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope |
|
|
|
The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with |
|
|
|
The access token has expired |
|
|
|
The application is installed, but the Bitrix24 administrator has granted access to it only to specific users |
|
|
|
The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Update Product catalog.product.update
- Get Product by ID catalog.product.get
- Get a List of Products by Filter catalog.product.list
- How to Add a Product with Custom Property Values
- Download Product Files catalog.product.download
- Delete Product catalog.product.delete
- Get Product Fields by Filter catalog.product.getFieldsByFilter