Updating InventoryLevels via /admin/inventory_levels/set.json redirects to login

Highlighted
Shopify Partner
2 0 0

Hello,

We have a private app attempting to use the InventoryLevels endpoint to set available quantities. We can send GET requests to /admin/inventory_levels.json and retrieve inventory but attempting to send POST requests to /admin/inventory_levels/set.json appears to redirect us to a login page (note I've masked private info here, we clearly aren't trying to send <user>:<password> as part of the URL or update <item id>):

POST /admin/inventory_levels/set.json HTTP/1.1
Host: <user>:<password>@<samplehost>.myshopify.com
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: <token>

{
    "inventory_item_id": <item id>,
    "location_id": <location id>,
    "available": 91
}

We receive back an HTTP 200 with an html page asking us to login. 

The x-request-id →19fa49f9-b031-43a7-aa58-6b93db4fc8a2

Is there something in Shopify we need to enable to use this endpoint?

0 Likes
Tourist
40 0 3

I know I needed to enable read/write to the inventory API key. 

 

 

0 Likes
Shopify Expert
36 0 3

Later today you should automatically get access to the inventory scopes when you got access to the product scope before today. 

0 Likes
Shopify Staff
Shopify Staff
277 0 51

Related to this. Try using your API password as the value for your X-Shopify-Access-Token header or removing cookies using Postman. 

0 Likes