Bulk update inventory via API

jungfine
New Member
2 0 0

Hi all,

Is it possible to bulk update item inventory to absolute qty?

We checked "inventoryBulkAdjustQuantityAtLocation" method, but we need to send an absolute quantity, not an increase and decrease of qty.

Can anyone advise me?

 

Thanks in advance.

Replies 5 (5)
GrahamS
Shopify Staff
Shopify Staff
193 35 48

Hey @jungfine ,

 

Have you considered using the productVariantUpdate mutation in an admin bulk query?

Using the following method OUTLINED HERE, you can use the productVariantUpdate mutation in bulk, which would allow you to set absolute values for inventory levels/locations via inventorylevelinput on the inventoryQuantities field

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jahnni
New Member
2 0 0

hi @GrahamS looks like  ProductVariantInput inventoryQuantities is a "Create only field", i guess it means you can set quantities only when creating variants, am I wrong ?

https://shopify.dev/api/admin-graphql/2022-01/input-objects/InventoryLevelInput

tnx

G

 

zenerry
Shopify Partner
8 1 0

Hi, did you find any solution?

Thanks.

jahnni
New Member
2 0 0

hi, what i did was to "bulk" download shopify inventory, compare it to "my warehouse" inventory and use the inventoryBulkAdjustQuantityAtLocation to set inventory adjustments

zenerry
Shopify Partner
8 1 0

Hi,

I thought about this kind of solution but I had my code really advanced in the other way so changing to this would ran out of time.

May be I woult need to implement it in a near future.

Thanks