[POST] .../v1/itemgroup/add
Creates a new item group. Use this method to create a product hierarchy group before assigning catalog items to it. The method writes a new group, recalculates the group path, invalidates the item group cache, writes the action log, sends the ItemGroupAdded webhook and returns new_id. The caller must have item group add permission; name is required and limited to 150 characters, parent_id is optional and 0 creates a root group and missing parents, subgroup-count limits, nesting limits, denied access or database errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | String | Required | Item group name. Required and limited to 150 characters. |
| parent_id | Int64 | Optional | Parent group ID. Default is 0. |
Request Example
{
"parent_id": 1,
"name": "Groceries"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 10
}
}