skip to Main Content

I want to use a recent API version (at least 2020-07) to retrieve the positions of products in smartCollections.

When I directly query the collect endpoint with the oldest supported stable API:

/admin/collects.json?collection_id=1234567

I receive the collect entities as one would expect.

When I run it against a newer version of the API:

/admin/api/2020-07/collects.json?collection_id=1234567

I get a 404 error: Cannot load Collects belonging to a SmartCollection.

So my question is: how do I get the positions of products in a smartCollection using a current API version.

2

Answers


  1. Chosen as BEST ANSWER

    Querying the products of a smartCollection will return the products in the order that you can see them in the shopify backend. So there is no need at all to use the collects to get the positions:

    /admin/api/2020-07/collection/1234567/products.json
    

  2. I don’t think you get positions in a Smart Collection as it triggers off of rules. So if you were to manually place items in position, it would make sense as a rule change would inject or remove products ruining the positioning. I think collect positions only matter to manual collections.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search