Catalog categories
The tree of categories products are filed in, reshaped with :move, with a per-view overlay of each category’s name, text and URL segment.
List catalog categories
A category of the website's catalog — «Clothing», «Clothing / Shirts». The categories form one tree: parent_id names the one above, path, url_path, level and sort_order are kept by the server, and the tree is reshaped with :move. A product lists the categories it is in in its category_ids. Deleting a category deletes its whole subtree and takes them out of every product. At most 500 per website.
path Parameters
website_idId of the parent website.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: path asc. Sortable: create_time, display_name, path, sort_order, url_path.
filterAIP-160 subset (§8). Filterable: create_time, display_name, parent_id, path, url_path. A field outside the list is INVALID_ARGUMENT.
List catalog categories › Responses
One page of catalog_categories.
This page of catalog_categories, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create catalog category
Adds a category under parent_id, or at the root without one. display_name is required; slug is derived from it when omitted, and one a sibling already has answers ALREADY_EXISTS. The new category comes last among its siblings, with path, url_path and level computed; a website that already has 500 categories answers FAILED_PRECONDITION.
path Parameters
website_idId of the parent website.
Create catalog category › Request Body
display_nameThe category's name. Not blank, at most 255 characters. display_name:"shirt" lists the categories whose name holds the text, case aside.
slugThe category's URL segment: lowercase letters and digits joined by single dashes, at most 120 characters. Derived from display_name when omitted on create. Unique among the category's siblings; a new one rewrites the url_path of the whole subtree.
parent_idThe id of the category this one sits under; absent at the root. Set on create and fixed afterwards — :move changes it, together with the placement of the whole subtree.
descriptionText about the category, for its page on the storefront. At most 10000 characters.
image_media_idThe id of the media item that pictures the category — one of the website's media library. Deleting the media item clears it.
is_activeWhether the category is in use. true when omitted.
visible_view_idsThe ids of the website's views this is shown on, each once, at most 100. Empty — the default — means every view, not none. An id that is not a view of this website is refused; a view deleted later leaves the list on its own. Replaced whole when sent; null under update_mask empties it. What a view says instead of the master's text is its version under views.
filter_layoutWhat the storefront shows around the category's product grid: NONE — the grid alone, SUBCATEGORIES — a row of tiles of its subcategories that narrows the grid, SIDEBAR — a filter panel beside it. Unset, the category inherits: the nearest ancestor that sets one, else the website setting general.catalog.filters.layout — which wins outright when general.catalog.filters.category_override is off. FILTER_LAYOUT_UNSPECIFIED or null clears it; omitted when unset.
sortingWhether the category's storefront listing offers a sort order to choose: ENABLED or DISABLED. Unset, the category inherits: the nearest ancestor that sets it, else the website setting general.catalog.sort.enabled — which wins outright when general.catalog.sort.category_override is off. SORTING_UNSPECIFIED or null clears it; omitted when unset.
show_in_navigationWhether the category is listed in a menu item's automatic subcategory dropdown; a hidden one takes its subtree with it. Absent counts as on. The category's pages, tiles and search are not affected. null clears it; omitted when unset.
Create catalog category › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe category's name. Not blank, at most 255 characters. display_name:"shirt" lists the categories whose name holds the text, case aside.
slugThe category's URL segment: lowercase letters and digits joined by single dashes, at most 120 characters. Derived from display_name when omitted on create. Unique among the category's siblings; a new one rewrites the url_path of the whole subtree.
parent_idThe id of the category this one sits under; absent at the root. Set on create and fixed afterwards — :move changes it, together with the placement of the whole subtree.
pathThe ids of the category's ancestors and its own, from the root: /{root}/.../{own}. Kept by the server; a list in path order is the tree, parents before their children.
url_pathThe slugs from the root down to the category's own, joined by / — unique on the website. Kept by the server.
levelHow deep the category sits: 0 at the root. Kept by the server.
sort_orderThe category's place among its siblings, from 0: a new category comes last, and :move is the only way to change it.
descriptionText about the category, for its page on the storefront. At most 10000 characters.
image_media_idThe id of the media item that pictures the category — one of the website's media library. Deleting the media item clears it.
is_activeWhether the category is in use. true when omitted.
visible_view_idsThe ids of the website's views this is shown on, each once, at most 100. Empty — the default — means every view, not none. An id that is not a view of this website is refused; a view deleted later leaves the list on its own. Replaced whole when sent; null under update_mask empties it. What a view says instead of the master's text is its version under views.
filter_layoutWhat the storefront shows around the category's product grid: NONE — the grid alone, SUBCATEGORIES — a row of tiles of its subcategories that narrows the grid, SIDEBAR — a filter panel beside it. Unset, the category inherits: the nearest ancestor that sets one, else the website setting general.catalog.filters.layout — which wins outright when general.catalog.filters.category_override is off. FILTER_LAYOUT_UNSPECIFIED or null clears it; omitted when unset.
sortingWhether the category's storefront listing offers a sort order to choose: ENABLED or DISABLED. Unset, the category inherits: the nearest ancestor that sets it, else the website setting general.catalog.sort.enabled — which wins outright when general.catalog.sort.category_override is off. SORTING_UNSPECIFIED or null clears it; omitted when unset.
show_in_navigationWhether the category is listed in a menu item's automatic subcategory dropdown; a hidden one takes its subtree with it. Absent counts as on. The category's pages, tiles and search are not affected. null clears it; omitted when unset.
Get catalog category
A category of the website's catalog — «Clothing», «Clothing / Shirts». The categories form one tree: parent_id names the one above, path, url_path, level and sort_order are kept by the server, and the tree is reshaped with :move. A product lists the categories it is in in its category_ids. Deleting a category deletes its whole subtree and takes them out of every product. At most 500 per website.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get catalog category › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe category's name. Not blank, at most 255 characters. display_name:"shirt" lists the categories whose name holds the text, case aside.
slugThe category's URL segment: lowercase letters and digits joined by single dashes, at most 120 characters. Derived from display_name when omitted on create. Unique among the category's siblings; a new one rewrites the url_path of the whole subtree.
parent_idThe id of the category this one sits under; absent at the root. Set on create and fixed afterwards — :move changes it, together with the placement of the whole subtree.
pathThe ids of the category's ancestors and its own, from the root: /{root}/.../{own}. Kept by the server; a list in path order is the tree, parents before their children.
url_pathThe slugs from the root down to the category's own, joined by / — unique on the website. Kept by the server.
levelHow deep the category sits: 0 at the root. Kept by the server.
sort_orderThe category's place among its siblings, from 0: a new category comes last, and :move is the only way to change it.
descriptionText about the category, for its page on the storefront. At most 10000 characters.
image_media_idThe id of the media item that pictures the category — one of the website's media library. Deleting the media item clears it.
is_activeWhether the category is in use. true when omitted.
visible_view_idsThe ids of the website's views this is shown on, each once, at most 100. Empty — the default — means every view, not none. An id that is not a view of this website is refused; a view deleted later leaves the list on its own. Replaced whole when sent; null under update_mask empties it. What a view says instead of the master's text is its version under views.
filter_layoutWhat the storefront shows around the category's product grid: NONE — the grid alone, SUBCATEGORIES — a row of tiles of its subcategories that narrows the grid, SIDEBAR — a filter panel beside it. Unset, the category inherits: the nearest ancestor that sets one, else the website setting general.catalog.filters.layout — which wins outright when general.catalog.filters.category_override is off. FILTER_LAYOUT_UNSPECIFIED or null clears it; omitted when unset.
sortingWhether the category's storefront listing offers a sort order to choose: ENABLED or DISABLED. Unset, the category inherits: the nearest ancestor that sets it, else the website setting general.catalog.sort.enabled — which wins outright when general.catalog.sort.category_override is off. SORTING_UNSPECIFIED or null clears it; omitted when unset.
show_in_navigationWhether the category is listed in a menu item's automatic subcategory dropdown; a hidden one takes its subtree with it. Absent counts as on. The category's pages, tiles and search are not affected. null clears it; omitted when unset.
Delete catalog category
Deletes a category with its whole subtree, and takes each of them out of the category_ids of every product before it answers. The products themselves stay.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete catalog category › Responses
Deleted. No body (§7).
Update catalog category
Changes a category. parent_id is fixed here — a category is moved with :move. A new slug rewrites the url_path of the category and of every category below it.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update catalog category › Request Body
display_nameThe category's name. Not blank, at most 255 characters. display_name:"shirt" lists the categories whose name holds the text, case aside.
slugThe category's URL segment: lowercase letters and digits joined by single dashes, at most 120 characters. Derived from display_name when omitted on create. Unique among the category's siblings; a new one rewrites the url_path of the whole subtree.
descriptionText about the category, for its page on the storefront. At most 10000 characters.
image_media_idThe id of the media item that pictures the category — one of the website's media library. Deleting the media item clears it.
is_activeWhether the category is in use. true when omitted.
visible_view_idsThe ids of the website's views this is shown on, each once, at most 100. Empty — the default — means every view, not none. An id that is not a view of this website is refused; a view deleted later leaves the list on its own. Replaced whole when sent; null under update_mask empties it. What a view says instead of the master's text is its version under views.
filter_layoutWhat the storefront shows around the category's product grid: NONE — the grid alone, SUBCATEGORIES — a row of tiles of its subcategories that narrows the grid, SIDEBAR — a filter panel beside it. Unset, the category inherits: the nearest ancestor that sets one, else the website setting general.catalog.filters.layout — which wins outright when general.catalog.filters.category_override is off. FILTER_LAYOUT_UNSPECIFIED or null clears it; omitted when unset.
sortingWhether the category's storefront listing offers a sort order to choose: ENABLED or DISABLED. Unset, the category inherits: the nearest ancestor that sets it, else the website setting general.catalog.sort.enabled — which wins outright when general.catalog.sort.category_override is off. SORTING_UNSPECIFIED or null clears it; omitted when unset.
show_in_navigationWhether the category is listed in a menu item's automatic subcategory dropdown; a hidden one takes its subtree with it. Absent counts as on. The category's pages, tiles and search are not affected. null clears it; omitted when unset.
Update catalog category › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
display_nameThe category's name. Not blank, at most 255 characters. display_name:"shirt" lists the categories whose name holds the text, case aside.
slugThe category's URL segment: lowercase letters and digits joined by single dashes, at most 120 characters. Derived from display_name when omitted on create. Unique among the category's siblings; a new one rewrites the url_path of the whole subtree.
parent_idThe id of the category this one sits under; absent at the root. Set on create and fixed afterwards — :move changes it, together with the placement of the whole subtree.
pathThe ids of the category's ancestors and its own, from the root: /{root}/.../{own}. Kept by the server; a list in path order is the tree, parents before their children.
url_pathThe slugs from the root down to the category's own, joined by / — unique on the website. Kept by the server.
levelHow deep the category sits: 0 at the root. Kept by the server.
sort_orderThe category's place among its siblings, from 0: a new category comes last, and :move is the only way to change it.
descriptionText about the category, for its page on the storefront. At most 10000 characters.
image_media_idThe id of the media item that pictures the category — one of the website's media library. Deleting the media item clears it.
is_activeWhether the category is in use. true when omitted.
visible_view_idsThe ids of the website's views this is shown on, each once, at most 100. Empty — the default — means every view, not none. An id that is not a view of this website is refused; a view deleted later leaves the list on its own. Replaced whole when sent; null under update_mask empties it. What a view says instead of the master's text is its version under views.
filter_layoutWhat the storefront shows around the category's product grid: NONE — the grid alone, SUBCATEGORIES — a row of tiles of its subcategories that narrows the grid, SIDEBAR — a filter panel beside it. Unset, the category inherits: the nearest ancestor that sets one, else the website setting general.catalog.filters.layout — which wins outright when general.catalog.filters.category_override is off. FILTER_LAYOUT_UNSPECIFIED or null clears it; omitted when unset.
sortingWhether the category's storefront listing offers a sort order to choose: ENABLED or DISABLED. Unset, the category inherits: the nearest ancestor that sets it, else the website setting general.catalog.sort.enabled — which wins outright when general.catalog.sort.category_override is off. SORTING_UNSPECIFIED or null clears it; omitted when unset.
show_in_navigationWhether the category is listed in a menu item's automatic subcategory dropdown; a hidden one takes its subtree with it. Absent counts as on. The category's pages, tiles and search are not affected. null clears it; omitted when unset.
Move (catalog category)
Moves a category, with its subtree, to another place in the tree. {"parent_id": "..."} puts it under that category, {"parent_id": null} at the root, and no parent_id leaves it under its parent; {"after_id": "..."} puts it right after that sibling, and no after_id (or null) first. A parent that is the category itself or below it is refused, and so is one under which a category already has its slug. Answers the moved category with its new path, url_path, level and sort_order; the subtree follows it.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
Move (catalog category) › Request Body optional
Move (catalog category) › Responses
The affected resource, or the method’s own response object (§10).
List catalog category views
What one view says instead of the master category: its name, its text and its URL segment. Each is the master's until overridden claims it. The tree, the picture, is_active, show_in_navigation and visible_view_ids are not overridable — a category has the same parent and siblings on every view.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: none — this collection serves its documented order only.
filterAIP-160 subset (§8). Filterable: none. A field outside the list is INVALID_ARGUMENT.
List catalog category views › Responses
One page of views.
This page of views, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create catalog category view
Adds a category's version for one view, named by ?id={view_id} — a view of this website, else INVALID_ARGUMENT on id; a view that has one already answers ALREADY_EXISTS. Only the fields listed in overridden count. Claiming display_name without a slug derives one from the name, and a slug another category under the same parent holds or serves on the view answers ALREADY_EXISTS on slug.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
Create catalog category view › Request Body
overriddenThe fields this view claims. A field counts only while it is listed here: one left out is taken down the view's fallback chain to the master, whatever value it holds, and a claimed one cleared to null is taken so too. Only the localizable fields of the resource may be listed. Claiming display_name claims slug with it — derived from the name when the version has none — so a translated name gets a translated URL.
display_nameThis view's name for the category. Not blank, at most 255 characters.
descriptionThis view's text about the category, for its storefront page. At most 10000 characters.
slugThis view's URL segment for the category, by the master's rule — so a translated category, and every category below it, gets a translated URL on the view. One another category under the same parent holds, or serves on the view, is ALREADY_EXISTS. Claimed without a value, or not sent while display_name is claimed, it is derived from the name — and then kept when the name changes.
Create catalog category view › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
catalog_category_idThe id of the master this is a version of. Fixed by the URL.
view_idThe view this version is for — the same as id. Fixed by the URL: a version is created with ?id={view_id}.
overriddenThe fields this view claims. A field counts only while it is listed here: one left out is taken down the view's fallback chain to the master, whatever value it holds, and a claimed one cleared to null is taken so too. Only the localizable fields of the resource may be listed. Claiming display_name claims slug with it — derived from the name when the version has none — so a translated name gets a translated URL.
display_nameThis view's name for the category. Not blank, at most 255 characters.
descriptionThis view's text about the category, for its storefront page. At most 10000 characters.
slugThis view's URL segment for the category, by the master's rule — so a translated category, and every category below it, gets a translated URL on the view. One another category under the same parent holds, or serves on the view, is ALREADY_EXISTS. Claimed without a value, or not sent while display_name is claimed, it is derived from the name — and then kept when the name changes.
Get catalog category view
What one view says instead of the master category: its name, its text and its URL segment. Each is the master's until overridden claims it. The tree, the picture, is_active, show_in_navigation and visible_view_ids are not overridable — a category has the same parent and siblings on every view.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
view_idThe view this version is for — the same as id. Fixed by the URL: a version is created with ?id={view_id}.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get catalog category view › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
catalog_category_idThe id of the master this is a version of. Fixed by the URL.
view_idThe view this version is for — the same as id. Fixed by the URL: a version is created with ?id={view_id}.
overriddenThe fields this view claims. A field counts only while it is listed here: one left out is taken down the view's fallback chain to the master, whatever value it holds, and a claimed one cleared to null is taken so too. Only the localizable fields of the resource may be listed. Claiming display_name claims slug with it — derived from the name when the version has none — so a translated name gets a translated URL.
display_nameThis view's name for the category. Not blank, at most 255 characters.
descriptionThis view's text about the category, for its storefront page. At most 10000 characters.
slugThis view's URL segment for the category, by the master's rule — so a translated category, and every category below it, gets a translated URL on the view. One another category under the same parent holds, or serves on the view, is ALREADY_EXISTS. Claimed without a value, or not sent while display_name is claimed, it is derived from the name — and then kept when the name changes.
Delete catalog category view
Deletes a category's version for one view: the view shows the master again.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
view_idThe view this version is for — the same as id. Fixed by the URL: a version is created with ?id={view_id}.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete catalog category view › Responses
Deleted. No body (§7).
Update catalog category view
Changes a category's version for one view. overridden, when sent, replaces the list; a slug the version serves anew is checked as on create, one it serves already is kept.
path Parameters
website_idId of the parent website.
category_idId of the parent category.
view_idThe view this version is for — the same as id. Fixed by the URL: a version is created with ?id={view_id}.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update catalog category view › Request Body
overriddenThe fields this view claims. A field counts only while it is listed here: one left out is taken down the view's fallback chain to the master, whatever value it holds, and a claimed one cleared to null is taken so too. Only the localizable fields of the resource may be listed. Claiming display_name claims slug with it — derived from the name when the version has none — so a translated name gets a translated URL.
display_nameThis view's name for the category. Not blank, at most 255 characters.
descriptionThis view's text about the category, for its storefront page. At most 10000 characters.
slugThis view's URL segment for the category, by the master's rule — so a translated category, and every category below it, gets a translated URL on the view. One another category under the same parent holds, or serves on the view, is ALREADY_EXISTS. Claimed without a value, or not sent while display_name is claimed, it is derived from the name — and then kept when the name changes.
Update catalog category view › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
catalog_category_idThe id of the master this is a version of. Fixed by the URL.
view_idThe view this version is for — the same as id. Fixed by the URL: a version is created with ?id={view_id}.
overriddenThe fields this view claims. A field counts only while it is listed here: one left out is taken down the view's fallback chain to the master, whatever value it holds, and a claimed one cleared to null is taken so too. Only the localizable fields of the resource may be listed. Claiming display_name claims slug with it — derived from the name when the version has none — so a translated name gets a translated URL.
display_nameThis view's name for the category. Not blank, at most 255 characters.
descriptionThis view's text about the category, for its storefront page. At most 10000 characters.
slugThis view's URL segment for the category, by the master's rule — so a translated category, and every category below it, gets a translated URL on the view. One another category under the same parent holds, or serves on the view, is ALREADY_EXISTS. Claimed without a value, or not sent while display_name is claimed, it is derived from the name — and then kept when the name changes.