Update a category node
Updates a category node. name is required.
Despite being a PUT, this operation does not replace the record: fields left out of the body keep their current value, exactly as with PATCH. The only difference between the two is that PUT requires name.
Unlike create, an update honors every writable field it is sent — attributes, attributes_kwargs, localized_attributes, localized_attributes_kwargs, and sort_option included. depth and path are read-only and a value sent for them is ignored.
Important: every update also re-positions the node. With neither
parentnorprev_siblingin the body, the node is moved to the front of its current parent's children (a tree root stays where it is). Sendprev_siblingto keep the node where it is among its siblings. When bothparentandprev_siblingare sent,prev_siblingwins andparentis silently ignored — the node adoptsprev_sibling's parent, which may be a different branch than the one you asked for. See Tree Structure & Positioning in the section description.
The node's pretty URL is regenerated from its name, and a redirect from the previous URL is kept. If the update changed the node's path, a background job re-indexes every active, listable product filed under the node's new parent's branch — including the node's new siblings and their descendants; products under the node's previous location are not re-indexed.
Important: a pretty URL that cannot be generated is not swallowed here — the request is rejected with
406and apretty_url_100_*error code. The re-positioning happens before the pretty URL is regenerated and is not rolled back, so a406leaves the node already moved with its other fields unchanged. Re-read the node and retry.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
The unique identifier of the category node.
The body of a category node create or update request.
On create only name, uuid, parent / prev_sibling, and localized_attributes are persisted; attributes, attributes_kwargs, localized_attributes_kwargs, and sort_option are accepted but ignored. On update every field below is honored, and fields left out keep their current value — a PUT is not a replacement, it differs from a PATCH only in requiring name.
The display name of the node. Stored as the value of the deployment's default language; translations go in localized_attributes.
The client-supplied unique identifier. Not enforced as required by the API, but the create service cannot run without it — omitting it on POST produces an unhandled server error (HTTP 500) rather than a 400, so always send it on create. Must be unique across all category nodes; a duplicate is reported as a 400. Optional on update.
The identifier of the node to file this node under. Omit on create to make the node a new tree root. On update, moves the node and its entire subtree under this parent as its first child — but is silently ignored when prev_sibling is also sent.
The identifier of the sibling this node should be placed immediately after. Ignored on create when no parent is given. On update it takes precedence over parent; send it to keep the node's position among its siblings, since without it the node is moved to the front of the list.
The identifier of the sort option used as the default ordering of the node's category page. Ignored on create.
The updated category node.
A category node of the catalog category tree.
The unique identifier of the node.
The display name of the node, rendered in the language selected for the request.
The client-supplied unique identifier of the node.
The node's level in the tree, starting at 1 for a tree root.
The node's materialized path — one step of exactly 4 base-36 characters (0-9A-Z) per tree level, e.g. 0001 for a root and 00010002 for a child of it. A node and its descendants are exactly the records whose path starts with this value. Use it for prefix matching only; never parse a step as a decimal number.
The storefront path of the node's category page — its pretty URL when one exists, otherwise the default /category/{pk}/ route (language-prefixed on deployments that enable I18N_ACTIVE).
The uuid of the menu item mirroring this node in the storefront navigation, or null when the node has no menu item.
The identifier of the sort option used as the default ordering of the node's category-page product listing, applied only when the visitor has not chosen an explicit sort.
The request contains invalid or missing data — for example a missing name, a name longer than 64 characters, a malformed or already-used uuid, or a parent, prev_sibling, or sort_option that does not reference an existing record. The response names the field the complaint belongs to.
Note that a missing uuid on create is not reported here; it produces a server error instead. See the warning on POST /category_node/.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
No category node exists with the given identifier.
The request is well-formed but violates a business rule — creating a tree root when the storefront navigation already has a root menu item, deleting a tree root or a node that still holds products, or a pretty URL that could not be generated. See the CategoryNodeBusinessError schema for the individual codes.
PUT /api/v1/remote/1/category_node/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 141
{
"name": "Shoes",
"uuid": "9f1c2e7a-4b8d-4f3a-9c11-2d6e8b7a0f45",
"parent": 7,
"prev_sibling": 41,
"localized_attributes": {
"de": {
"l_name": "Schuhe"
}
}
}{
"pk": 42,
"name": "Shoes",
"menuitemmodel": "3f2a1c9e-8b7d-4a6f-9c0e-1d2b3a4c5e6f",
"absolute_url": "/shoes/",
"sort_option": 3,
"uuid": "9f1c2e7a-4b8d-4f3a-9c11-2d6e8b7a0f45",
"depth": 2,
"path": "00010002",
"attributes": {
"size_chart": {
"value": 12,
"kwargs": {
"label": "Women's Shoes"
}
}
}
}Last updated
Was this helpful?

