Skip to main content

Collection

Represents the Collection entity of your store. Collections are organized in a tree structure (hierarchical) and are used to navigate the catalog and group products.

Collection Definition

PropertyTypeDescription
idstring (UUID)Unique identifier of the collection.
namestringName of the collection.
slugstringPart of the URL used to navigate to the collection (SEO-friendly).
parentIdstring | nullID of the parent collection (null if it is a root collection).
positionnumberDisplay order relative to other collections at the same level.
visiblebooleanIndicates whether the collection should be shown on the front-end.
filterIdsstring[]Array of filter IDs pre-applied to this collection.
childrenCollection[]Recursive: Array of child collections contained within this collection.

Recursive Structure

The Collection entity is designed to support unlimited depth. The children property contains an array of objects that follow the same Collection interface, allowing you to map the entire catalog tree (e.g., Men > Shoes > Sneakers).

Object Example

{
"id": "ee91d632-ca63-400e-b93d-4369c080da4e",
"name": "Apparel",
"slug": "apparel",
"parentId": null,
"position": 0,
"visible": true,
"filterIds": [
"7d88d702-0684-411f-89ba-5ab13c06fa51"
],
"children": [
{
"id": "ae087773-3708-4c61-b72e-426a7580cc90",
"name": "T-Shirts",
"slug": "t-shirts",
"parentId": "ee91d632-ca63-400e-b93d-4369c080da4e",
"position": 0,
"visible": true,
"filterIds": [],
"children": []
}
]
}
Navigation

You can use the utilities in wr.shop to change the catalog context, such as wr.shop.navigateToCollection(collectionId)