product - JS SDK Store Reference
This documentation provides a reference to the sdk.store.product
set of methods used to send requests to Medusa's Store API routes.
list#
This method retrieves a list of products. It sends a request to the List Products API route.
Related guides:
Example#
To retrieve the list of products:
To configure the pagination, pass the limit
and offset
query parameters.
For example, to retrieve only 10 items and skip 10 items:
Using the fields
query parameter, you can specify the fields and relations to retrieve
in each product:
Learn more about the fields
property in the API reference.
Parameters#
Filters and pagination configurations.
Headers to pass in the request.
Returns#
Promise
Promise<StoreProductListResponse>The paginated list of products.
Promise
Promise<StoreProductListResponse>retrieve#
This method is used to retrieve a product by its ID. It sends a request to the Get Product API route.
Related guides:
- How to retrieve a product in the storefront.
- How to retrieve a product variant's prices in the storefront
Example#
To retrieve a product by its ID:
To specify the fields and relations to retrieve:
Learn more about the fields
property in the API reference.
Parameters#
id
stringConfigure the fields to retrieve in the product.
Headers to pass in the request
Returns#
Promise
Promise<StoreProductResponse>The product.
Promise
Promise<StoreProductResponse>