Add Service v 3.0 catalog.product.service.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 "View product catalog", "View catalog products", or "Edit selling price" permissions
The method belongs to REST 3.0. The call specifics and response format of the new API version are described in the REST 3.0 overview.
The catalog.product.service.add method creates a service in the trade catalog and returns its fields.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
fields* |
An object with the fields of the new service. Field description |
Parameter fields
Required parameters are marked with *
|
Name |
Description |
|
iblockId* |
Identifier of the trade catalog information block. It cannot be changed after creation. The identifier can be retrieved using the catalog.catalog.list method |
|
name* |
Name of the service |
|
code |
Symbolic code |
|
xmlId |
External code. If it is not passed, Bitrix24 writes the service identifier to the field |
|
active |
Service activity status. Possible values:
Any value other than Default: |
|
sort |
Sort order. Default: |
|
createdBy |
Identifier of the user who created the service. The identifier can be retrieved using the user.get method |
|
modifiedBy |
Identifier of the user who last modified the service. The identifier can be retrieved using the user.get method |
|
dateActiveFrom |
Activity start date in ISO 8601 format, for example |
|
dateActiveTo |
Activity end date in ISO 8601 format |
|
previewText |
Preview description |
|
previewTextType |
Preview description type. Possible values:
Default: |
|
previewPicture |
Preview picture. An object in the format Currently the method accepts this object without an error but does not save the file: the field stays |
|
detailText |
Detail description |
|
detailTextType |
Detail description type. Possible values:
Default: |
|
detailPicture |
Detail picture. An object in the format Currently the method accepts this object without an error but does not save the file: the field stays |
|
iblockSectionId |
Identifier of the main catalog section. The identifier can be retrieved using the catalog.section.list method. For a section that does not exist, the method returns an access error |
|
iblockSection |
An array of identifiers of the sections to link the service to, for example An empty array together with |
|
quantity |
Quantity |
|
quantityReserved |
Reserved quantity |
|
quantityTrace |
Quantity tracking mode. Possible values:
|
|
canBuyZero |
Allow purchase when out of stock. Possible values:
|
|
subscribe |
Allow subscription to the product. Possible values:
|
|
vatId |
VAT rate identifier. The identifier can be retrieved using the catalog.vat.list method |
|
vatIncluded |
Whether VAT is included in the price. Possible values:
Default: |
|
purchasingPrice |
Purchase price |
|
purchasingCurrency |
Currency code of the purchase price, for example Currency codes can be retrieved using the crm.currency.list method |
|
barcodeMulti |
Unique barcodes for each item. Possible values:
|
|
weight |
Weight |
|
length |
Length |
|
width |
Width |
|
height |
Height |
|
measure |
Unit of measurement identifier. The identifier can be retrieved using the catalog.measure.list method |
|
recurSchemeLength |
Payment period length. Used for content sales in the on-premise version |
|
recurSchemeType |
Time unit of the payment period. Possible values:
Used for content sales in the on-premise version |
|
trialPriceId |
Identifier of the product for a trial payment. Used for content sales in the on-premise version |
|
withoutOrder |
Renewal without placing an order. Possible values:
Used for content sales in the on-premise version |
|
quantityTraceRaw |
Saved value of the quantity tracking mode. Possible values:
|
|
paymentType |
Payment type. Possible values:
Used for content sales in the on-premise version |
|
subscribeRaw |
Saved value of the subscription permission. Possible values:
|
|
canBuyZeroRaw |
Saved value of the out-of-stock purchase permission. Possible values:
|
|
properties |
Service property values. The keys are Property identifiers can be retrieved using the catalog.productProperty.list or catalog.product.fields.getbyfilter method |
Bitrix24 sets the service type type itself. The id, dateCreate, timestampX, type, available, and bundle fields are read-only, and passing them causes an error. Set the service price using the catalog.price.add method.
Code Examples
How to Use Examples in Documentation
The new API call differs by adding the /api/ segment to the request URL:
https://{installation_address}/rest/api/{user_id}/{webhook_token}/catalog.product.service.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"iblockId":25,"name":"Equipment installation","xmlId":"DOCS-V3-SERVICE-1","sort":100,"vatId":1,"vatIncluded":"Y","measure":9,"previewText":"Installation and connection of equipment","iblockSectionId":45,"properties":{"PROPERTY_301":"SRV-001"}}}' \
https://**put_your_bitrix24_address**/rest/api/**put_your_user_id_here**/**put_your_webhook_here**/catalog.product.service.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"iblockId":25,"name":"Equipment installation","xmlId":"DOCS-V3-SERVICE-1","sort":100,"vatId":1,"vatIncluded":"Y","measure":9,"previewText":"Installation and connection of equipment","iblockSectionId":45,"properties":{"PROPERTY_301":"SRV-001"}},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/api/catalog.product.service.add
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
type ServiceAddResult = {
item: {
id: number
iblockId: number
name: string
xmlId: string | null
active: 'Y' | 'N'
sort: number
type: number
iblockSectionId: number | null
vatId: number | null
vatIncluded: 'Y' | 'N'
measure: number | null
previewText: string | null
detailPicture: string | null
timestampX: ISODate
properties: Record<string, { VALUE: string, VALUE_ID: string } | Array<{ VALUE: string, VALUE_ID: string }> | null>
}
}
try {
const response = await $b24.actions.v3.call.make<ServiceAddResult>({
method: 'catalog.product.service.add',
params: {
fields: {
iblockId: 25,
name: 'Equipment installation',
xmlId: 'DOCS-V3-SERVICE-1',
sort: 100,
vatId: 1,
vatIncluded: 'Y',
measure: 9,
previewText: 'Installation and connection of equipment',
iblockSectionId: 45,
properties: {
PROPERTY_301: 'SRV-001',
},
},
},
requestId: Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Service created:', result.item.id)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function addService() {
try {
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v3.call.make({
method: 'catalog.product.service.add',
params: {
fields: {
iblockId: 25,
name: 'Equipment installation',
xmlId: 'DOCS-V3-SERVICE-1',
sort: 100,
vatId: 1,
vatIncluded: 'Y',
measure: 9,
previewText: 'Installation and connection of equipment',
iblockSectionId: 45,
properties: {
PROPERTY_301: 'SRV-001',
},
},
},
requestId: B24Js.Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Service created:', result.item.id)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', addService)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.catalog.product.service.add(
fields={
"iblockId": 25,
"name": "Equipment installation",
"xmlId": "DOCS-V3-SERVICE-1",
"sort": 100,
"vatId": 1,
"vatIncluded": "Y",
"measure": 9,
"previewText": "Installation and connection of equipment",
"iblockSectionId": 45,
"properties": {
"PROPERTY_301": "SRV-001",
},
},
).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}")
SDKs do not yet support the /rest/api/ address in calls. Use direct HTTP requests, for example, via cURL or fetch.
try {
$response = $b24Service
->core
->call(
'catalog.product.service.add',
[
'fields' => [
'iblockId' => 25,
'name' => 'Equipment installation',
'xmlId' => 'DOCS-V3-SERVICE-1',
'sort' => 100,
'vatId' => 1,
'vatIncluded' => 'Y',
'measure' => 9,
'previewText' => 'Installation and connection of equipment',
'iblockSectionId' => 45,
'properties' => [
'PROPERTY_301' => 'SRV-001',
],
],
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
error_log($result->error());
} else {
echo 'Success: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
SDKs do not yet support the /rest/api/ address in calls. Use direct HTTP requests, for example, via cURL or fetch.
BX24.callMethod(
'catalog.product.service.add',
{
fields: {
iblockId: 25,
name: 'Equipment installation',
xmlId: 'DOCS-V3-SERVICE-1',
sort: 100,
vatId: 1,
vatIncluded: 'Y',
measure: 9,
previewText: 'Installation and connection of equipment',
iblockSectionId: 45,
properties: {
PROPERTY_301: 'SRV-001',
},
},
},
result => {
if (result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
SDKs do not yet support the /rest/api/ address in calls. Use direct HTTP requests, for example, via cURL or fetch.
require_once('crest.php');
$result = CRest::call(
'catalog.product.service.add',
[
'fields' => [
'iblockId' => 25,
'name' => 'Equipment installation',
'xmlId' => 'DOCS-V3-SERVICE-1',
'sort' => 100,
'vatId' => 1,
'vatIncluded' => 'Y',
'measure' => 9,
'previewText' => 'Installation and connection of equipment',
'iblockSectionId' => 45,
'properties' => [
'PROPERTY_301' => 'SRV-001',
],
],
]
);
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.service.add", b24.Params{
"fields": b24.Params{
"iblockId": 25,
"name": "Equipment installation",
"xmlId": "DOCS-V3-SERVICE-1",
"sort": 100,
"vatId": 1,
"vatIncluded": "Y",
"measure": 9,
"previewText": "Installation and connection of equipment",
"iblockSectionId": 45,
"properties": b24.Params{
"PROPERTY_301": "SRV-001",
},
},
})
if err != nil {
return fmt.Errorf("catalog.product.service.add: %w", err)
}
// The method wraps the response in an object with the "item" key.
raw, ok := b24.Unwrap(res.Result, "item")
if !ok {
return fmt.Errorf("no item key in the response")
}
var item struct {
ID int `json:"id"`
Name string `json:"name"`
Type int `json:"type"`
Measure int `json:"measure"`
}
if err := json.Unmarshal(raw, &item); err != nil {
return fmt.Errorf("parse response: %w", err)
}
fmt.Println(item.ID, item.Name, item.Type)
Response Handling
HTTP status: 200
{
"result": {
"item": {
"id": 7551,
"iblockId": 25,
"name": "Equipment installation",
"code": null,
"xmlId": "DOCS-V3-SERVICE-1",
"active": "Y",
"sort": 100,
"createdBy": 1,
"modifiedBy": 1,
"dateCreate": "2026-10-22T12:18:35+02:00",
"timestampX": "2026-10-22T12:18:35+02:00",
"dateActiveFrom": null,
"dateActiveTo": null,
"previewText": "Installation and connection of equipment",
"previewTextType": "text",
"previewPicture": null,
"detailText": null,
"detailTextType": "text",
"detailPicture": null,
"iblockSectionId": 45,
"iblockSection": [
45
],
"type": 7,
"available": "N",
"bundle": "N",
"quantity": 0,
"quantityReserved": 0,
"quantityTrace": "N",
"canBuyZero": "Y",
"subscribe": "Y",
"vatId": 1,
"vatIncluded": "Y",
"purchasingPrice": null,
"purchasingCurrency": null,
"barcodeMulti": "N",
"weight": 0,
"length": null,
"width": null,
"height": null,
"measure": 9,
"recurSchemeLength": null,
"recurSchemeType": "D",
"trialPriceId": null,
"withoutOrder": "N",
"quantityTraceRaw": "N",
"paymentType": "S",
"subscribeRaw": "D",
"canBuyZeroRaw": "Y",
"properties": {
"PROPERTY_309": null,
"PROPERTY_293": null,
"PROPERTY_295": null,
"PROPERTY_297": null,
"PROPERTY_299": null,
"PROPERTY_301": {
"VALUE": "SRV-001",
"VALUE_ID": "4017"
},
"PROPERTY_303": null,
"PROPERTY_305": null,
"PROPERTY_307": null,
"PROPERTY_311": null,
"PROPERTY_313": null,
"PROPERTY_315": null,
"PROPERTY_329": null,
"PROPERTY_343": null,
"PROPERTY_359": null,
"PROPERTY_431": null,
"PROPERTY_433": null,
"PROPERTY_435": null,
"PROPERTY_893": null,
"PROPERTY_897": null,
"PROPERTY_901": null,
"PROPERTY_917": null,
"PROPERTY_921": null,
"PROPERTY_931": null,
"PROPERTY_933": null,
"PROPERTY_935": null,
"PROPERTY_1013": null,
"PROPERTY_1015": null,
"PROPERTY_1019": null,
"PROPERTY_1021": null,
"PROPERTY_1023": null,
"PROPERTY_1077": null,
"PROPERTY_1079": null,
"PROPERTY_1081": null,
"PROPERTY_1083": null,
"PROPERTY_1085": null,
"PROPERTY_1231": null
}
}
},
"time": {
"start": 1792660715,
"finish": 1792660715.19402,
"duration": 0.19402003288269043,
"processing": 0,
"date_start": "2026-10-22T12:18:35+02:00",
"date_finish": "2026-10-22T12:18:35+02:00",
"operating_reset_at": 1792660920,
"operating": 0.25499987602233887
}
}
Returned Data
|
Name |
Description |
|
result |
An object with the response data |
|
result.item |
Service fields. Field description |
|
time |
Information about the request execution time |
Item Object
|
Name |
Description |
|
id |
Service identifier |
|
iblockId |
Identifier of the trade catalog information block |
|
name |
Name of the service |
|
code |
Symbolic code |
|
xmlId |
External code. If the code was not passed on creation, it equals the service identifier |
|
active |
Service activity status: |
|
sort |
Sort order |
|
createdBy |
Identifier of the user who created the service |
|
modifiedBy |
Identifier of the user who last modified the service |
|
dateCreate |
Creation date and time |
|
timestampX |
Date and time of the last modification |
|
dateActiveFrom |
Activity start date |
|
dateActiveTo |
Activity end date |
|
previewText |
Preview description |
|
previewTextType |
Preview description type: |
|
previewPicture |
Preview picture file identifier as a string. |
|
detailText |
Detail description |
|
detailTextType |
Detail description type: |
|
detailPicture |
Detail picture file identifier as a string. |
|
iblockSectionId |
Main section identifier. |
|
iblockSection |
An array of identifiers of all sections the service is linked to |
|
type |
Product type. Always |
|
available |
Available for purchase: |
|
bundle |
Set flag: |
|
quantity |
Quantity |
|
quantityReserved |
Reserved quantity |
|
quantityTrace |
Effective quantity tracking mode, taking the catalog settings into account: |
|
canBuyZero |
Effective out-of-stock purchase permission, taking the catalog settings into account: |
|
subscribe |
Effective subscription permission, taking the catalog settings into account: |
|
vatId |
VAT rate identifier. |
|
vatIncluded |
VAT is included in the price: |
|
purchasingPrice |
Purchase price. |
|
purchasingCurrency |
Purchase price currency. |
|
barcodeMulti |
Unique barcodes for each item: |
|
weight |
Weight |
|
length |
Length. |
|
width |
Width. |
|
height |
Height. |
|
measure |
Unit of measurement identifier |
|
recurSchemeLength |
Payment period length. Used for content sales in the on-premise version |
|
recurSchemeType |
Time unit of the payment period, for example |
|
trialPriceId |
Identifier of the product for a trial payment. Used for content sales in the on-premise version |
|
withoutOrder |
Renewal without placing an order: |
|
quantityTraceRaw |
Saved value of the quantity tracking mode: |
|
paymentType |
Payment type: |
|
subscribeRaw |
Saved value of the subscription permission: |
|
canBuyZeroRaw |
Saved value of the out-of-stock purchase permission: |
|
properties |
Service property values. The keys are |
Error Handling
HTTP status: 400
{
"error": {
"code": "BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION",
"message": "Error validating request object.",
"validation": [
{
"message": "productType is not allowed for this catalog"
}
]
}
}
|
Name |
Description |
|
error.code |
String error code. Use it to identify the type of exception |
|
error.message |
Text description of the error |
|
error.validation |
Array with error details. Present only in data validation errors |
|
error.validation[].field |
Name of the field where the validation error occurred |
|
error.validation[].message |
Description of the error related to the specified field |
Possible Error Codes
Request Validation Errors
Error Code: BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Required field |
Pass the |
|
|
Iblock Not Found |
Pass the identifier of an existing trade catalog. The list of catalogs is returned by the catalog.catalog.list method |
|
|
iblock is not catalog |
The information block is not a trade catalog. Pass the identifier of a trade catalog |
|
|
productType is not allowed for this catalog |
A service cannot be created in an offers catalog. Pass the identifier of a product catalog |
|
|
VAT vatId is not exists |
Pass the identifier of an existing VAT rate. The rates are returned by the catalog.vat.list method |
|
|
Currency purchasingCurrency is not exists |
Pass the code of an existing currency |
|
|
User createdBy is not exists |
Pass the identifier of an existing user in |
|
|
User modifiedBy is not exists |
Pass the identifier of an existing user in |
|
|
The properties field accepts only the property keys PROPERTY_{id}, unknown keys: |
Pass property keys in the |
|
|
The properties field names one property by several keys: |
Pass each property with a single key |
|
|
This request requires data type |
Pass a value of the required type |
|
|
Internal error adding product. Try adding again. |
Repeat the request |
Object Validation Errors
Error Code: BITRIX_REST_V3_EXCEPTION_VALIDATION_DTOVALIDATIONEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Required field |
Pass the service name in |
|
|
Required field |
Pass the catalog identifier in |
|
|
Field |
Remove the read-only fields from |
Unknown Field Error
Error Code: BITRIX_REST_V3_EXCEPTION_UNKNOWNDTOPROPERTYEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Unknown field |
Pass only the fields from the Parameter fields table in |
Access Error
Error Code: BITRIX_REST_V3_EXCEPTION_ACCESSDENIEDEXCEPTION
HTTP status: 403
|
Field |
Error description |
How to Fix |
|
|
Access denied |
Check the user's permissions. The error is also returned if the section from |
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 Service Fields v 3.0 catalog.product.service.update
- Get Service Field Values v 3.0 catalog.product.service.get
- Get List of Services v 3.0 catalog.product.service.list
- Delete Service v 3.0 catalog.product.service.delete
- Get List of Service Fields v 3.0 catalog.product.service.field.list
- Add Product Price v 3.0 catalog.price.add