Categories
Categories form a product navigation hierarchy. Use them for durable paths such as departments, product families, or browse trees.
Hierarchy and navigation
A category can have a parentId, which creates a tree. Use categories for stable browsing paths such as Home → Lighting → Table lamps. Root categories omit parentId.
Category slugs are storefront-facing identifiers. Supply a stable slug when other systems or URLs depend on it; otherwise Thor can generate one from the name during creation.
Avoid making the tree unnecessarily deep. A product can be assigned where it is most useful for discovery; storefronts can decide whether to show parent, child, or breadcrumb context.
Product association and order
Products carry category associations, and categories expose ordered products. Use categoryReorderProducts to express merchandising order after membership is set through product updates. Fetch current membership before reordering so concurrent catalog jobs do not operate from stale positions.
A product can belong to multiple categories. Storefront product search also accepts the API-owned category_id filter, allowing a category page to combine membership with price, availability, and attribute filters.
Worked tree
Create Home without a parent, Lighting with the Home ID, and both leaf categories with the Lighting ID. Associate a lamp product with the most useful browse nodes for the storefront. Do not infer ancestor membership unless the returned API data explicitly includes it.
Storefront discovery
The Storefront API exposes category and collection queries as well as category_id and collection_id filters on product search. Use a direct category or collection query to render navigation metadata, and product search to combine membership with price, availability, attribute, or metafield filters.
Collections
Use collections for flat, curated groups such as campaigns or seasonal edits. Categories remain the hierarchy; collections remain independent ordered sets.