لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/product-sections.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Product sections

Manage CRM product catalog sections: create, retrieve, update, delete, and search. A section groups products within a catalog and can be nested.

Bitrix24 API: crm.productsection.* Scope: crm

The /v1/product-sections methods are deprecated. For new integrations use Catalog sections.

Create section

POST /v1/product-sections

Creates a new section in the product catalog. Fields are passed flat at the root of the JSON, without a fields wrapper.

Request fields (body)

Field Type Required Description
Fieldname Typestring Requiredyes DescriptionSection name
FieldcatalogId Typenumber Requiredno DescriptionCatalog identifier. If omitted, the CRM product catalog of the Bitrix24 account is used. List: GET /v1/catalogs
FieldsectionId Typenumber Requiredno DescriptionParent section identifier for nesting. null for a top-level section. List: GET /v1/product-sections
Fieldcode Typestring Requiredno DescriptionSection symbolic code. If omitted, it is generated from name
FieldxmlId Typestring Requiredno DescriptionExternal identifier
Fieldsort Typenumber RequiredRO DescriptionSort order. Bitrix24 does not save the value passed here, so the field is rejected with 400 READONLY_FIELD — change the order in the Bitrix24 interface

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/product-sections" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Clothing",
    "catalogId": 25
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/product-sections" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Clothing",
    "catalogId": 25
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Clothing',
    catalogId: 25,
  }),
})

const { success, data } = await res.json()
console.log('Section ID:', data.id)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/product-sections', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Clothing',
    catalogId: 25,
  }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionThe created section
Fielddata.id Typenumber DescriptionIdentifier of the created section
Fielddata.name Typestring DescriptionSection name
Fielddata.catalogId Typenumber DescriptionCatalog identifier. List: GET /v1/catalogs
Fielddata.sectionId Typenumber DescriptionParent section identifier or null. List: GET /v1/product-sections
Fielddata.xmlId Typestring DescriptionExternal identifier or null
Fielddata.code Typestring DescriptionSection symbolic code
Fieldmeta.warnings Typearray DescriptionPresent only when the body contains a field that is not among the section fields. The section is still created. Each element carries code: "UNRECOGNIZED_WRITE_FIELD", field with the field name, and message

Response example

JSON
{
  "success": true,
  "data": {
    "id": 197,
    "name": "Clothing",
    "catalogId": 25,
    "sectionId": null,
    "xmlId": null,
    "code": "clothing"
  }
}

Error response example

422 — section name not provided:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Section name is not specified."
  }
}

Errors

HTTP Code Description
HTTP422 CodeBITRIX_ERROR DescriptionThe name field was not provided — message "Section name is not specified."
HTTP400 CodeREADONLY_FIELD DescriptionA read-only field was passed in the body — id or sort
HTTP403 CodeSCOPE_DENIED DescriptionThe key is missing the crm scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided

Full list of common API errors — Errors.

See also