Inventory Level Webhook is not firing events

Solved
blessykpalatty
Shopify Partner
4 0 0

I have subscribed  all Inventory webhook events for my store. And I  updated inventory of some product in

admin->Products->Inventory page . But I didn't get any event. Looks like no event was sent  on an update on inventory.  I use same subscription url for other Webhooks like Product/Update,Checkout etc. and I'm getting payloads successfully  for those events. Can some one tell me what is going wrong in here.

Thanks,

Blessy Palatty

Accepted Solution (1)

Accepted Solutions
Josh
Shopify Staff
Shopify Staff
1134 82 213

This is an accepted solution.

Hello again, 

 

If an accurate inventory level is what you're after, then I would suggest using inventory_levels/update as opposed to products/update. But you'll likely find both webhooks firing at the same time, yes - there shouldn't be much of a delay in them firing either, perhaps a second or two but I wouldn't expect more than that. 

 

With regards to product ID 2390984753216 that you had mentioned, I see it was updated at 11:06:56AM EDT, and both an inventory_levels/update and products/update webhook were triggered in the exact same second and sent to https://xfnuumjh39.execute-api.us-east-2.amazonaws.com. These jobs completed OK, which means that a 200OK response was sent when they arrived.

 

Inventory_quantity and old_inventory_quantity are deprecated now, but they used to be for updating product inventory levels. Currently inventory_quantity is still useful though, and we have kept it on products because it provides an aggregate count of all inventory across all of a shop's locations (if they have multiple). 

 

There's no specific webhook event for price changes, you'd want to use products/update for price updates. And there's also no way to add any fields like user credentials to a webhook, unfortunately. 

 

Hope that helps, but let me know if you need anything else! 

Josh | 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 the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 6 (6)
Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey there, 

 

I haven't been able to replicate this behaviour, updating inventory via the Products>Inventory page should be firing an `inventory_levels_update` webhook. Would you mind posting your shop URL (or even a product ID), a timeframe during which you were making these updates, and the URL you expected the webhooks to arrive to? I could check our logs and see if there were any issues with sending them to you.

Josh | 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 the Shopify Help Center or the Shopify Blog

blessykpalatty
Shopify Partner
4 0 0

Thank you so much Josh .IT would be very helpful if you could check the logs . I did changes for Product ID- 2390984753216 ,2391000842304  and for the site https://companystore4u.myshopify.com during 2019-01-18 9:20 AM - 11:00 AM  EDT.Is there any time lag for webhooks to be active for a subscription?

Looks like I got events after 11:00AM on topic 'inventory_levels/update'.

Thanks again for  looking into it.

blessykpalatty
Shopify Partner
4 0 0

Couple more questions regarding this.

 Does an Inventory_Level/Update always trigger a Product/update event as well? I see inventory_quantity and old_inventory_quantity same. What does those fields mean then?

Just like Inventory id there any specific event for Price changes? Or Should I depend on Prodcut/Update for Price change and maintain a Product state table  to find out if its a price change?

Is there any way I can add user credentials in webhook request header, so that I can implement basic authentication for my api ?

Thanks much in advance,

Blessy

Josh
Shopify Staff
Shopify Staff
1134 82 213

This is an accepted solution.

Hello again, 

 

If an accurate inventory level is what you're after, then I would suggest using inventory_levels/update as opposed to products/update. But you'll likely find both webhooks firing at the same time, yes - there shouldn't be much of a delay in them firing either, perhaps a second or two but I wouldn't expect more than that. 

 

With regards to product ID 2390984753216 that you had mentioned, I see it was updated at 11:06:56AM EDT, and both an inventory_levels/update and products/update webhook were triggered in the exact same second and sent to https://xfnuumjh39.execute-api.us-east-2.amazonaws.com. These jobs completed OK, which means that a 200OK response was sent when they arrived.

 

Inventory_quantity and old_inventory_quantity are deprecated now, but they used to be for updating product inventory levels. Currently inventory_quantity is still useful though, and we have kept it on products because it provides an aggregate count of all inventory across all of a shop's locations (if they have multiple). 

 

There's no specific webhook event for price changes, you'd want to use products/update for price updates. And there's also no way to add any fields like user credentials to a webhook, unfortunately. 

 

Hope that helps, but let me know if you need anything else! 

Josh | 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 the Shopify Help Center or the Shopify Blog

blessykpalatty
Shopify Partner
4 0 0

Thanks a lot Josh.This absolutely helps.I am trying out different stuff in Shopify.  Will come back to you if I get stuck on anything again. Thanks .

liosha
Shopify Partner
2 0 0

Hi Josh
I have a question. i want that when a product update webhook comes, i know that this update belongs to which location? (with multiple location enabled)
i this possible without subscribe InventoryLevel webhook? and just from product update webhook and inventorylevel Resource find that?
and if i shuold subscribe InventoryLevel webhook, should i everytime compare inventory_item_id to find related variant?
thanks for you guides.
best regards.