Retrieve a Category's Products in Storefront
In this guide, you'll learn how to retrieve a category's products in the storefront.
In your storefront, you may want to allow customers to browse products by category. To do so, you can retrieve the products that belong to a category and display them in your storefront.
To retrieve a category's products in the storefront, send a request to the List Products API route passing it the category_id
query parameter:
In this example, you retrieve the products that belong to a category by passing the category's ID as a query parameter to the List Products API route. You can also pass other query parameters to filter or paginate the products, such as limit
and offset
.
The response has a products
field, which is an array of products.
To learn more about displaying the products and their variants, refer to the following guides:
- Show Products in Storefront
- Show Product Variant's Price
- Show Product Variant's Inventory
- Select Product Variants