Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
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?
Hi @phillipr
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.
Any ideas?
@2BDigital I also have read write permissions active for inventory and products.
What's the HTTP response code of the call?
You're definitely not being hit by this?
Setting an inventory item to a fulfillment service without"disconnect_if_necessary": truefails with a 422 error
For the sake of argument as well - let's give write access to Locations as well then retry?
For the sake of argument as well - let's give write access to Locations as well then retry?
We can't put write access on locations, just checked.
What's the HTTP response code of the call?
Getting a status 200
And there's no message about "disconnect_if_necessary".
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.
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By