Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

API call to set manual product sort order within a collection?

Shopify Expert
28 2 7


can I set the manual sort order within a collection programmatically?



Replies 3 (3)

Shopify Staff (Retired)
267 40 51

Hi @Denizthemenace 

You can add products to a manual collection via the API and specify the sort order with the position and sort_value fields. You should be able to have an app programatically add the products to a collection as long as you have them listed in the desired order on your end.

Here's a link to the relevant documentation - Collect is the endpoint that adds products to collections -

To learn more visit the Shopify Help Center or the Community Blog.

Shopify Partner
26 0 6

Hi, can you provide me some examples?

I am trying but doesn't work


curl -d '{"collect":{"product_id":5015268524165,"collection_id":263249199237,"sort_value":"14"}}' -X POST "" -H "X-Shopify-Access-Token: shppa_380de19cc965XXXXXXaba" -H "Content-Type: application/json"


Shopify Partner
8 0 11

Did you ever figure this out?  This does not work on my end either,