CollectionsResource
This class is used to send requests to Store Product Collection API Routes. All its method
are available in the JS Client under the medusa.collections
property.
A product collection is used to organize products for different purposes such as marketing or discount purposes. For example, you can create a Summer Collection. Using the methods in this class, you can list or retrieve a collection's details and products.
Methods
retrieve
Retrieve a product collection's details.
Example
Parameters
id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: {}
Returns
ResponsePromise
ResponsePromise<StoreCollectionsRes>RequiredResolves to the collection's details.
ResponsePromise
ResponsePromise<StoreCollectionsRes>Requiredlist
Retrieve a list of product collections. The product collections can be filtered by fields such as handle
or created_at
passed in the query
parameter.
The product collections can also be paginated.
Example
To list product collections:
By default, only the first 10
records are retrieved. You can control pagination by specifying the limit
and offset
properties:
Parameters
customHeaders
Record<string, any>RequiredDefault: {}
Filters and pagination configurations to apply on the retrieved product collections.
Returns
ResponsePromise
ResponsePromise<StoreCollectionsListRes>RequiredResolves to the list of product collections with pagination fields.
ResponsePromise
ResponsePromise<StoreCollectionsListRes>Required