Update Multiple Categories
Updates several categories in a single request. Each item identifies a category by its id and contains the fields you want to change.
HTTP Request
- URL:
/categories/multiple - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_CATEGORY
Request Body
Send a JSON array. Each item in the array has the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | ID of the category to update. |
name | String | No | Name of the category. |
url | String | No | URL slug of the category page. |
description | String | No | Description of the category. Can be empty. |
parentCategory | String | No | ID of the new parent category, or null for a top-level category. |
image | String | No | URL of the category image. The image is copied to your store's media library. |
sortOrder | Number | No | Display order. Lower numbers appear first. |
isFeatured | Boolean | No | Whether the category is featured. |
isShow | Boolean | No | Whether the category is visible on the storefront. |
isShowNavBar | Boolean | No | Whether the category appears in the navigation bar. |
seo | Object | No | SEO settings with pageTitle, metaKeywords and metaDescription. |
metaFields | Array | No | Custom field values, each with a code and a value. See Metafields. |
cURL Example
curl --location --request PUT '<BASE_URL>/categories/multiple' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
{
"id": "66acedf2bf8641f96544253b",
"sortOrder": 1,
"metaFields": []
},
{
"id": "66acedf2bf8641f96544253c",
"isShowNavBar": true,
"metaFields": [
{ "code": "category_pim_id", "value": "1046" }
]
}
]'
Response
- 200 OK: The categories were updated successfully.
- 400 Bad Request: The access token is missing, invalid or lacks the required scope, or the request body is not valid (for example, an item has no
id).
Sample JSON Response
{
"success": true,
"message": "Categories updated Successfully"
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the categories were updated. |
message | String | Confirmation message. |
Notes
- The response does not include the updated categories. Use Get All Categories with the
id:infilter to read them back. - Metafields you send are merged with the category's existing metafields: a matching
codeis updated and a newcodeis added. - After moving categories to new parents, you can call Generate Category Paths to refresh the paths of the whole category tree.