A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
If I use GET https://mcs-nordic-denmark.myshopify.com/admin/api/2023-01/inventory_levels.json?inventory_item_ids=...
X-Request-ID: 44b8155d-31a0-4f21-968f-17a5edd4dc10
It works fine and I get:
Solved! Go to the solution
This is an accepted solution.
I finally found a solution, it turns out, that our customer created the shop using this url:
mcs-nordic.myshopify.com
But later they added another: mcs-nordic-denmark.myshopify.com
The last url redirected to the first url. This works for GET, but failed if using POST.
My code works after changing to the first url:
POST:
Hi Kent,
Please refer to the documentation on how to set the inventory level.
https://shopify.dev/docs/api/admin-rest/2023-01/resources/inventorylevel#post-inventory-levels-set
It give a very specific example of what the post body should look like.
e.g.
{
"location_id": 655441491,
"inventory_item_id": 808950810,
"available": 42
}
I believe its expecting json in the post body and not URL parameters.
Cheers,
Gary
Hi, Gary
I have tried with body in the Post, but it gives the same error.
which scopes do you have for the shop where its not working?
I do not know, it is our customer who has made the setup of the shop.
Our Customer writes that we should be allowed to edit all data.
Hi Kent,
make a get request to
Hi Gary,
I get this, so I guess that it is not the problem.
{
"handle": "write_inventory"
},
{
"handle": "read_inventory"
},
This is an accepted solution.
I finally found a solution, it turns out, that our customer created the shop using this url:
mcs-nordic.myshopify.com
But later they added another: mcs-nordic-denmark.myshopify.com
The last url redirected to the first url. This works for GET, but failed if using POST.
My code works after changing to the first url:
POST: