Hello Shopify community. I need help with an issue I'm having regarding setting variants quantity to 0. I have an AWS lambda function setup that is called from a webhook from Shopify which is trying to set the variants to 0.
I am following this documentation here: https://shopify.dev/docs/admin-api/rest/reference/inventory/inventorylevel#set-2020-07
For some reason, I am not able to set the inventory level to 0. I tried doing this directly inside of my Node.js server and with Postman. Both options give me failing results. In my node.js server I'm using this library: https://github.com/MONEI/Shopify-api-node to interface with the admin API. The library works great, but when I try to set the inventory level to 0, nothing happens.
So, I tried to do the same thing in Postman but when I tried to login it keeps showing me this error:
Any idea's why it's so difficult to update the variant quantity via the Admin API? My API key and password are working fine, I am making several other Admin API requests BEFORE trying to set the variants to 0. Any ideas?
Can you send us the body you're sending and the exact endpoint you're hitting?
I usually try and get it to work in Postman first so I know that the call is formatted correctly before moving on to anything else.
Can you GET the inventory level endpoints without any trouble?
Hi @2BDigital , thanks for the response. Yes, I am 100% able to GET inventory level endpoints without any trouble.
Here, I'm making a GET request for all inventory levels for a specific location. We only have one location, no plans for multi-locations. Works perfectly.
And then here is my request trying to set the available to 1 using the exact data from the previous GET request. It sends me the href link, and I open it in chrome and it says "Something went wrong", as seen above in the original post.
Hmm - how strange.
According to this thread there might be some issues with cookies in Postman?
Can you try removing any cookies and trying the post again?
Sorry I am clutching at straws a bit here but anything's worth trying at this point!
I don't see anything wrong with the request or permission levels.