Product Categories API Routes
Products can be categorized into categories.
These API routes allow customers to browse categories and their products.
GET /store/product-categories#
List Product Categories
Retrieve a list of product categories. The product categories can be filtered by fields such as id. The product categories can also be sorted or paginated.
Authentication: none.
Header parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.offsetnumberOptionallimitnumberOptionalorderstringOptional-.qstringOptionalidstring | string[]Optionaldescriptionstring | string[]Optionalq query parameter instead.handlestring | string[]Optionalparent_category_idstring | string[]Optionalinclude_ancestors_treebooleanOptionalfields query parameter parent_category to set the parent of a category in this field. You can either pass *parent_category to retreieve the fields of all parent categories, or select specific fields to make the response size smaller. For example, fields=parent_category.id,parent_category.name.include_descendants_treebooleanOptionalfields query parameter category_children to set the child of a category in this field. You can either pass *category_children to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, fields=category_children.id,category_children.name.created_atobjectOptionalupdated_atobjectOptional$andobject[]Optional$orobject[]Optionalnamestring | string[]Optionalwith_deletedbooleanOptionallocalestringOptionalen-USexternal_idstring | string[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberproduct_categoriesobject[]The list of product categories.
product_categoriesobject[]estimate_countnumberOptional400, 401, 404, 409, 422, 500: an error response is returned.
GET /store/product-categories/{id}#
Get a Product Category
Retrieve a product category by its ID. You can expand the product category's relations or select the fields that should be returned.
Authentication: none.
Path parameters
idstringHeader parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.include_ancestors_treebooleanOptionalfields query parameter parent_category to set the parent of a category in this field. You can either pass *parent_category to retreieve the fields of all parent categories, or select specific fields to make the response size smaller. For example, fields=parent_category.id,parent_category.name.include_descendants_treebooleanOptionalfields query parameter category_children to set the children of a category in this field. You can either pass *category_children to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, fields=category_children.id,category_children.name.localestringOptionalen-USRequest examples
Responses
200 OK
product_categoryobjectThe category's details.
product_categoryobject400, 401, 404, 409, 422, 500: an error response is returned.