Skip to main content

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.

FieldTypeRequiredDescription
idStringYesID of the category to update.
nameStringNoName of the category.
urlStringNoURL slug of the category page.
descriptionStringNoDescription of the category. Can be empty.
parentCategoryStringNoID of the new parent category, or null for a top-level category.
imageStringNoURL of the category image. The image is copied to your store's media library.
sortOrderNumberNoDisplay order. Lower numbers appear first.
isFeaturedBooleanNoWhether the category is featured.
isShowBooleanNoWhether the category is visible on the storefront.
isShowNavBarBooleanNoWhether the category appears in the navigation bar.
seoObjectNoSEO settings with pageTitle, metaKeywords and metaDescription.
metaFieldsArrayNoCustom 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​

FieldTypeDescription
successBooleantrue when the categories were updated.
messageStringConfirmation message.

Notes​

  • The response does not include the updated categories. Use Get All Categories with the id:in filter to read them back.
  • Metafields you send are merged with the category's existing metafields: a matching code is updated and a new code is added.
  • After moving categories to new parents, you can call Generate Category Paths to refresh the paths of the whole category tree.