MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 278 forks source link

Cannot get `collects` filtered by product or by collection #470

Closed samjross closed 3 years ago

samjross commented 3 years ago

Been trying to use your api and there's something that I haven't been able to figure out how to do.

On this page, it illustrates a few ways to get the collects -- the mappings between products and the collections that they're in.

The two ways I'm most interested in are GET /admin/api/2021-01/collects.json?product_id=632910392 and GET /admin/api/2021-01/collects.json?collection_id=841564295.

I've tried shopifyApi.collect.list({collection_id: ... }), and the same thing for product_id, and those didn't work.

Are these ways of filtering supported by this api wrapper?

samjross commented 3 years ago

I'm sorry, the shopifyApi.collect.list({product_id: ... }) actually works. the collection_id one doesn't though.

lpinca commented 3 years ago

If it works with product_id it should also work with collection_id, there is no special parameters handling in the library. Did you try to specify an api version? Also try with a different HTTP client like curl and see if you get the same result.

samjross commented 3 years ago

I found out it's because the new version of the api doesn't actually have collects for smart collections @lpinca . This has put me in a quite difficult situation in regards to an app that I needed to upgrade off the old api to the new one. yikes

lpinca commented 3 years ago

I does not seem to be a bug in the library. I'm closing this.