Question about /inventory_levels/set.json

Ron21
Shopify Partner
19 0 3

Hi,

Am I able to set the quantity of all variants in a product in one call?

The code sample Shopify gives would only update one variant of the product

 

POST /admin/api/2021-04/inventory_levels/set.json
{
  "location_id": 905684977,
  "inventory_item_id": 808950810,
  "available": 42
}

 

Would it be possible to do something like this:

 

POST /admin/api/2021-04/inventory_levels/set.json
{
  "location_id": 9056849755
  "inventory_item_id": 808950855,
  "available": 22
}
,
{
  "location_id": 905684977,
  "inventory_item_id": 808950877,
  "available": 42
}
,
{
  "location_id": 905684988,
  "inventory_item_id": 808950888,
  "available": 18
}

 

0 Likes