Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Plea

Highlighted
New Member
2 0 2
Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API

Set the inventory of each variant while uploading the product. Before today, this POST /admin/api/2020-01/products.json API can be used correctly

2 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @lihuaxin ,

 

As you can see from the warning message, setting the fields of "inventory_quantity" and "inventory_quantity_adjustment" are no longer supported by Shopify. If you want to update the inventory levels of a product using the Shopify API, you need to use the following resources:

In terms of steps:

1 - First create the product as is without setting inventory_quantity. Once the product is created, get the "inventory_item_id" field that is set on the product's variant.

2 - Find the location_id(s) for your store by making the following request ( e.g. GET  admin/api/2020-01/locations.json)
3 - Set the inventory quantity of your product at the specific location it will be stocked at by using the InventoryLevels resource (e.g. POST /admin/api/2020-01/inventory_levels/set.json - pass in the appropriate inventory_item_id, location_id, and available quantity values in the body)

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes