Set Inventory levels of multiple items in one POST command

HI,

I have more than 200 products in the store. most of the products have variants.

I want to update the qty of all products daily in sync with my Warehouse

I am trying to use this - https://shopify.dev/api/examples/product-inventory#set-inventory-levels-to-a-certain-amount However looks like I can only set qty of one item in one POST command

Is it possible to update qty of multiple inventory items in one Post command?

Thanks and Regards,
Sid

Hey @sidpuri7 ,

This is a task that would be better managed by GraphQL over REST. We wrote a blog post with some great info on this topic around the time that GraphQL was introduced on the platform: BLOG POST

Hi @GrahamS ,

My company currently doesn’t use GraphQL. I understand the advantages. Without GraphQL is it possible to update inventory levels for multiple inventory_item_ids in one call or no?

Thank you!

Alexa

+1 I need an answer on this as well please. Can this be done without the need for GraphQL. It seems odd that we cannot supply multiple IDs in one transaction.

https://www.cirklestudio.co/

Hi All I got the above developers to create a custom app for me to handle this. Hopefully they can assist.

That’s great. I’ll take a look. Thanks for your help.

A duplicate/similar post which remains unanswered can also be found here…

Fastest way to update inventory levels post multi-location - Shopify Community

EDIT: Unfortunately, this is something chargeable. It is the responsibility of Shopify Developers to fix this issue which is causing a detrimentally high volume of transaction traffic against their own servers. No matter what the app is or where it comes from, it would still be constrained by the limitations of the REST ADMIN API service.

Hey, I have been working myself on getting this working and created a solution on Shopify Flow if you still need it?

What I needed from this was to iterate through every product and check that it had a metafield filled out (in my case it was key="web_enabled_inventory). In that metafield is that item’s stock level, which is synced daily by our PIM. This was a limitation of our PIM not being able to directly sync with Shopify’s Inventory Levels system so instead they had to be housed in a metafield. So then I’m overwriting the “available” number stored in that product with the number that is housed in the metafield since that is the accurate inventory level from our warehouse (accounts for lost/damaged goods, returns, etc.).

Above is my workflow in Shopify Flow with the {store name} crossed out. You would enter your store’s name there. And below is the body of my HTTP request with some varibles you would replace bolded:

{% for metafields_item in productsForeachitem.metafields %}{% if metafields_item.key == ‘web_available_inventory’ %}{% for variants_item in productsForeachitem.variants %}{“location_id”: [your location_id here],“inventory_item_id”: {{variants_item.inventoryItem.id | split: “/” | last}},“available”:{{metafields_item.value}}}{% endfor %}{% endif %}{% endfor %}

Hope this information helps in any way, should you still need this!