Headless commerce and custom storefronts with Shopify APIs and SDKs
Hi,
guys i have a simple react app and i want to access the last 5 best selling product through json request without using the admin api , after researching i found this enpoint https://example.net/products.json it gave me the last product, the question is how can i sort it by best selling or by price .
thank you
I don't know if you can do it with just /products.json but the Storefront API can do it:
{
products(first: 5, sortKey: BEST_SELLING) {
edges {
node {
title
}
}
}
}
ProductSortKeys docs.
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023