For the complete documentation index, see llms.txt. This page is also available as Markdown.

Partially update a category node

Updates one or more fields of a category node. Only the fields included in the request body are changed; everything left out keeps its current value.

This is the operation to use for the fields the create operation ignores — attributes, attributes_kwargs, localized_attributes_kwargs, and sort_option are all applied here.

Important: a partial update re-positions the node exactly as a full update does. Even a body containing nothing but name moves the node to the front of its sibling list unless prev_sibling is sent as well, and prev_sibling overrides parent when both are present. See Tree Structure & Positioning in the section description.

As with a full update, the pretty URL is regenerated with a redirect kept from the old one, and a changed path triggers a re-index of the new parent's branch. A pretty URL that cannot be generated is rejected with 406 without undoing the move.

patch
/category_node/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the category node.

Body

The body of a category node partial update request. Only the fields included are changed.

Every writable field is honored, including the ones the create operation ignores. Note that the update still re-positions the node: send prev_sibling to keep it in place among its siblings, and be aware that prev_sibling overrides parent when both are present.

namestring · max: 64Optional

The display name of the node.

uuidstring · uuidOptional

The client-supplied unique identifier. Must remain unique across all category nodes if changed.

parentintegerWrite-onlyOptional

Moves the node and its entire subtree under this parent, as its first child. Silently ignored when prev_sibling is also sent.

prev_siblingintegerWrite-onlyOptional

Moves the node immediately after this sibling, adopting that sibling's parent. Takes precedence over parent.

sort_optioninteger · nullableOptional

The identifier of the sort option used as the default ordering of the node's category page.

Responses
200

The updated category node.

application/json

A category node of the catalog category tree.

pkintegerRead-onlyOptional

The unique identifier of the node.

namestring · max: 64Optional

The display name of the node, rendered in the language selected for the request.

uuidstring · uuidOptional

The client-supplied unique identifier of the node.

depthintegerRead-onlyOptional

The node's level in the tree, starting at 1 for a tree root.

pathstring · max: 255Read-onlyOptional

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.

absolute_urlstringRead-onlyOptional

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).

menuitemmodelstring · nullableRead-onlyOptional

The uuid of the menu item mirroring this node in the storefront navigation, or null when the node has no menu item.

sort_optioninteger · nullableOptional

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.

patch/category_node/{id}/
PATCH /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: 58

{
  "name": "Women's Shoes",
  "prev_sibling": 41,
  "sort_option": 3
}
{
  "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?