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
idstringRequiredcustomHeadersRecord<string, any>RequiredDefault: {}
Returns
ResponsePromiseResponsePromise<StoreCollectionsRes>RequiredResolves to the collection's details.
ResponsePromiseResponsePromise<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
customHeadersRecord<string, any>RequiredDefault: {}
Filters and pagination configurations to apply on the retrieved product collections.
Returns
ResponsePromiseResponsePromise<StoreCollectionsListRes>RequiredResolves to the list of product collections with pagination fields.
ResponsePromiseResponsePromise<StoreCollectionsListRes>Required