Skip to main content

Generate Category Paths

Rebuilds the path of every category from the current parent and subcategory relationships. Use it after importing or reorganizing categories.

HTTP Request​

  • URL: /categories/generatepath
  • Method: PATCH
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_WRITE_CATEGORY

This endpoint takes no parameters and no request body.

cURL Example​

curl --location --request PATCH '<BASE_URL>/categories/generatepath' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The paths were generated successfully.
  • 400 Bad Request: The access token is missing, invalid or lacks the required scope.

Sample JSON Response​

{
"success": true,
"message": "Paths generated successfully",
"summary": {
"total": 312,
"updated": 27,
"unchanged": 285
}
}

Response Details​

FieldTypeDescription
successBooleantrue when the paths were generated.
messageStringConfirmation message.
summaryObjectCounts of the categories processed. See below.

Summary Details​

FieldTypeDescription
totalNumberNumber of categories checked.
updatedNumberNumber of categories whose path was changed.
unchangedNumberNumber of categories whose path was already correct.

Notes​

  • Each path lists the category IDs from the top-level category down to the category itself, for example /663a0cbe516313e5bc94aa87/66acedf2bf8641f96544253b/.
  • If your store has no categories, the message is No categories found and all counts are 0.