How to get collection products sorted by position ?

Highlighted
New Member
3 0 0

Hi, 

I am using rest admin api .

endpoint: admin/api/{version}/product_listings.json?collection_id={collectionId}

Is there a way to get the products sorted by position ?

Is there maybe an "order" property i can sort by myself ?

 

 

0 Likes
Highlighted
New Member
3 0 0

Found the solution for this.

In order to get products position you have to do an additional call to /collects.json?collection_id={collection_id} then use this info to sort out the response you get from /products.json?collection_id={collection_id}

0 Likes
Highlighted
Shopify Partner
8 0 0

@Just_A_Q Can you confirm how you did this?

0 Likes