FROM CACHE - en_header

Bulk Inventory Update

Kishor_Kumar_Ma
Shopify Partner
2 0 2

Hi,

Is it possible to update inventory in bulk in a single API call?

https://shopify.dev/docs/admin-api/rest/reference/inventory/inventoryitem

I found the API that allows the single item in the single call but we have a large number of products so it takes me too much time to update all, so if possible to update in bulk by 100 or thousands or all variants of single products?

 

Thanks in advance.

Replies 5 (5)
Greg_Kujawa
Shopify Partner
1024 84 272

As far as I'm aware the only API bulk operation exists in the GraphQL API. But for pulling records, as opposed to updating records. Shopify's API call limits aren't terribly restrictive, compared to other API service providers. For example, REST operations weigh GET, PUT, POST, etc. requests all the same. And allow 2 requests per second. So for example, if you are updating 1,000 records then iterating through them in code to perform the API requests should take around 8-9 minutes. 

For my own use cases, I typically run into mass update requirements for an initial data conversion. That mass update can take awhile, but then when it comes to syncing records over a small delta timespan those updates aren't terribly time-consuming. So even issuing one API request at a time for those completes in just well under a minute. 

This is all based on the assumption you are aware that the Shopify web admin has functions for importing product and inventory CSV's to mass update things --> https://help.shopify.com/en/manual/products/import-export/import-products and https://help.shopify.com/en/manual/products/inventory/inventory-csv

zenerry
Shopify Partner
9 1 0

Hello,

did you find any solution?

I've 4000 variants in over 700 products and it takes almos 65 minutes to update all of them.

Really disgusting that way...

zenerry
Shopify Partner
9 1 0

Hello again,

are you aware if with the new API is this method updated?

I think i've read something about it but I'm not sure if it refers exactly to this.

 

tolgapaksoy
Shopify Partner
94 7 59

I use a Fulfillment Service with inventory management enabled.

Using this, Shopify will fetch a stock update from your app every hour on a fetch_stock.json endpoint that you configure.

Read more about this here: https://shopify.dev/api/admin-rest/2021-07/resources/fulfillmentservice