What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Variants Deleted when Updating Quantities via Admin API

Solved

Variants Deleted when Updating Quantities via Admin API

Zap1798
Visitor
3 0 2

I am using Power Automate to automatically update products, including variants via a SQL DB. However, when I perform the action of passing all the products that need to be updated with their location id, inventory item id and available quantity using a PUT request to the url ending with

/admin/api/2022-01/inventory_levels/set.json and according to these instructions: Manage product inventory with the Admin API (shopify.dev)

every variant that is associated with a product, gets deleted. For example, before updating quantities, Variant A will have a quantity of 8, Variant B will have a quantity of 18, and Variant C will have a quantity of 4. After running the workflow to set each quantity to 5, Variant A will have a quantity of 5 but Variant B and C will not exist. I have seen threads of this happening to people before but am looking for a more updated solution as those threads are quite old. Any help is appreciated!

Accepted Solution (1)

curious_dev
Shopify Partner
3 2 2

This is an accepted solution.

Hi Zap,

did you manage to solve the issue or had any reply from shopify?

I suspect a similar thing is happening to my store with an external partner updating stock information: sometimes variants get wiped for (apparently) no reason.

 

Thanks for any additional information you provide!

 

I'm not a robot, it's just my username!

View solution in original post

Reply 1 (1)

curious_dev
Shopify Partner
3 2 2

This is an accepted solution.

Hi Zap,

did you manage to solve the issue or had any reply from shopify?

I suspect a similar thing is happening to my store with an external partner updating stock information: sometimes variants get wiped for (apparently) no reason.

 

Thanks for any additional information you provide!

 

I'm not a robot, it's just my username!