Out now! Check out the Poll results: Do you have a Shopify store?
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.

Getting the previous quantity or delta change in IventoryLevel webhook

Getting the previous quantity or delta change in IventoryLevel webhook

David_Db
Excursionist
21 0 11

Hi,

We have a tricky problem with an app we develop.

We are setting up an inventory structure so that for example "Battery 100-pack" consists of 10x"Battery 10-pack".

Lets say that the shop have 10x"Battery 100-pack" in inventory. That means that the shop have 100x"Battery 10-pack".

So if 1x"Battery 10-pack" is sold (inventory adjusted), then the shop has 9x"Battery 100-pack" and 99x"Battery 10-pack".

So far so good. But if the shops orders 2x"Battery 100-pack" and adds this to the inventory, then the calculation will be wrong because they already have a left-over of 9x"Battery 10-pack".

We were thinking about using the InventoryLevel webhook to update this structure. But since we have no way (that we can see) of knowing what the inventory was before the change, we cannot update the structure because it will be wrong. It will then think we have 11x"Battery 100-pack" = 110x"Battery 10-pack" when it should be 119x"Battery 10-pack" (the left-overs from the previous sale).

Any ideas of how this can be solved ?

This is extra strange because Shopify itself are using delta changes. So the perfect solution would be to get the delta changes in inventory, or new and old inventory (even better).

Replies 2 (2)

StickyMallrat
Shopify Partner
1 0 0

Hi, same problem here...trying to sync inventory between multiple store and I need the delta of inventory changes. Did you find any solution to this?

_Tang
Shopify Partner
2 0 0

It's so difficult for the Shopify team to add a delta value field  🙂