API documentation for managing product groups (version 2). This API allows you to create and bulk update product groups, as well as manage their specifications display settings.
Table with field descriptions
Main object (ProductGroup)
| Field | Type | Required? | Description |
|---|---|---|---|
id| int |
No | Unique identifier of the product group. Required to update a specific record by ID. | |
code| string |
No | Group text code. Must be unique within the site. Used for searching when creating/updating if id is not passed. |
|
name| string |
Yes | Product group name. | |
group_specifications| array[object] |
No | List of settings for characteristics (specifications) associated with this group. |
Group specification object (within group_specifications)
| Field | Type | Required? | Description |
|---|---|---|---|
specification_id| int |
Yes | ID of the feature to be linked or configured. | |
order| int |
No | The order in which the characteristics are displayed (sorting). Default: 0. | |
display_type| string |
No | Characteristic display type. Possible values: |
- selects (dropdown list)
- media_params (media parameters)
- blocks (blocks)
- multi_select (multiple selection)
additional_info| array[string]| No| Additional parameters for display on the product page
Possible values:
- price (The display options will show the price)
- quantity (In display options there will be quantity)
- description (In the display options there will be a description of the product)- image (In the display options there will be pictures of the product)
show_in| array[string]| No| Locations for displaying characteristics -
- small_cart (Small product card)
- page_block (Block on the product page)
- page_button (Popup on the product page)
Endpoints
1. Getting all product groups
Description: Returns a list of all product groups for the current site.
Endpoint:
[GET] /external/v2/product-group/
Answer: An array of product group objects.
2. Bulk creation and update
Description: Creates new groups or updates existing ones.
- If
idis passed, searching and updating by ID occurs. - If there is no
id, butcodeis passed, the code is searched and updated. - If there are no matches, a new group is created.
- The nested
group_specificationsdata is also updated (missing connections are added, existing ones are updated, unnecessary ones are removed if they are not in the request). Endpoint:
[POST] /external/v2/product-group/bulk-create/
Example request body (JSON):
[ { "code": "phones", "name": "Smartphones", "groupspecifications": [ { "specificationid": 105, "order": 1, "displaytype": "selects", "showin": ["smallcart", "pageblock"] }, { "specificationid": 106, "order": 2, "displaytype": "blocks" } ] }, { "id": 450, "name": "Laptops (Updated)", "group_specifications": [] } ]
Answer: Returns an array of created or updated objects.
- Status:
201 Created
- Status:
Was the article helpful?
Yes, thank you! Unfortunately no