Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Is it possible to hide variants using API?

Is it possible to hide variants using API?

AndreFonseca
Shopify Partner
7 0 0

Hi,

 

I would like to know if it is possible to hide/show a variant when there's (no) stock of that variant using the API. I searched on the documentation but did not find anything like that.

 

If it is indeed impossible to make such thing, I would like to know if I can delete the variant even if there are active or old purchases. What are the consequences of doing that? Assuming it is possible, I was trying to do some tests retrieving all product so I could delete each one of them without stock. However I have some problems with this approach:

  • I cannot retrieve a product by sku ... I tried but I do receive a lot of results which were not supposed
  • I tried to get products with the "Retrieve a list of products" service but I cannot get all of them. I tried to use parameter "since_id" but I think that it doesn't work. I tried to get 3 results and then used the id of the first has the value for the since_id parameter. I was expecting to receive the 2nd and 3rd result of the first test on the second one but I didn't get that
  • Deleting the variant, will delete its images? What more?

 

Can anyone help me?

 

Thanks in advance!

Replies 0 (0)