I really hope someone can help as this has been driving me crazy for weeks.
I am Trying to update inventory levels for items.
using the following url
https://{store}.myshopify.com/admin/api/inventory_levels/set.json
I am sending
{"location_id":484343866,"inventory_item_id":34697005105188,"available":10}
This fails - all I get is status code 406
Please any help would be good, I cannot see where I am going wrong.
I am getting the ID 34697005105188 by using admin/products.json with the product ID
Hello @Allspoke1
Tested this few times. Looks like IDs and construction is correct otherwise it would return 404 or 400.
From what I can see 406 is returned if using incorrect method. You should be using POST, but you might be calling PUT, could you make sure that correct method is called for this update?
Hi Renars
Thanks for your assistance. I checked the code and the call being made is
loResp = loHttp.PText("POST",lcUrl,loJsonRequestBody.Emit(),"utf-8","application/json",0,0) so it is using POST. I am creating item and downloading orders, just this one (very important) function left.
Any ideas at all?
Mark
And have you checked the access scope permissions to see that this function is allowed for your API credentials?
https://shopify.dev/docs/admin-api/access-scopes
Although looking at the URL in your OP I think it's incorrect. As @ellitt pointed out.
User | Count |
---|---|
14 | |
12 | |
10 | |
8 | |
7 |