[POST] .../v1/itemgroup/edit
Edits item group. Use this method to rename an item group or move it within the product hierarchy. The method updates the group, recalculates the affected path, invalidates the item group cache, writes the action log, sends the ItemGroupEdited webhook and returns row_affected. The caller must have item group edit permission; id is required, name is optional but limited to 150 characters, parent_id = 0 moves the group to the root, null or a negative parent_id leaves the parent unchanged and cycles, missing parents, nesting limits, denied access or storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Required | Group ID. |
| name | String | Optional | Item group name. Optional and limited to 150 characters when sent. |
| parent_id | Int64 | Optional | Parent group ID. Value 0 moves the group to the root; null or a negative value leaves the parent unchanged. |
Request Example
{
"id": 10,
"parent_id": 0,
"name": "Packaged groceries"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1
}
}