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
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the paths were generated. |
message | String | Confirmation message. |
summary | Object | Counts of the categories processed. See below. |
Summary Details
| Field | Type | Description |
|---|---|---|
total | Number | Number of categories checked. |
updated | Number | Number of categories whose path was changed. |
unchanged | Number | Number 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 foundand all counts are0.