Skip to main content
Scopes: read_products to read, write_products to change (it includes read_products), the same as products.

The category

name, slug and thumb are required on create. A product lists its categories in category_ids: set them on the product with Update a product.

The HTML content is not part of the API

A category can have HTML content that the merchant writes in the dashboard. Apps can neither read nor write it: it is in no answer, and sending content or is_advanced_content answers 400 invalid_request. A category you create starts with none, as in the dashboard, and an update leaves what the merchant wrote.

Subcategories

  • parent_id must be a category of the store. It cannot be the category itself, nor one of its own subcategories (422, rule parent). A PATCH with parent_id: null makes the category a top-level one.
  • List categories lists every level. Filter it with filter=parent_id||$isnull for the top level, or filter=parent_id||$eq||<id> for one category’s subcategories.
  • Get a category adds subcategories as children with join=children, up to three levels (children.children.children). One read joins at most 100 subcategories over all levels (422 join_too_large); list them instead.

Deleting

Delete a category removes it from lists and reads (404), and products stop listing it in category_ids. It cannot be restored through the API. A category that still has subcategories answers 409 category_has_children: delete them or move them first.

Changes

The storefront shows a change right away. Category changes send no events.