Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Webhooks doesn't work for untracked products

Webhooks doesn't work for untracked products

Mete
Shopify Partner
134 0 40

Hi there,

If a product is not tracked, we can change its quantity on edit product page without making it tracked. This basically changes variant's inventory_quantity but it doesn't trigger any webhook for product-update or inventory level update topic. How can we be notified for a change like that? What is the expected webhook behavior for products which haven't their quantity tracked?

Co-Founder / Developer at: merchbees
Merchbees Low Stock Alert - Keep track of your low stock items by email and slack
Merchbees Inventory Value - Know your inventory value and quantity in real-time
Push Down & Hide Out of Stock - Move out of stock products to the bottom of the collection to improve SEO & hide/ unhide automatically
Replies 3 (3)

hassain
Shopify Staff (Retired)
624 104 189

Hey @Mete ,

 

I am not sure if I fully understand this question. If you turn off the ability for Shopify to track quantity on a Product or Product Variant, you lose the ability to edit the quantity of the product and/or product variant from the Admin -> Products -> Inventory page. And since Shopify is no longer tracking the inventory of this product and/or product variant, it will no longer be aware of inventory changes for these resources and therefore not be able to send any webhook notifications about this. The best way to get inventory information in this case would be to just use the Admin API to pull the "inventory_quantity" field of the Product Variant / Inventory Item.

 

 

To learn more visit the Shopify Help Center or the Community Blog.

Mete
Shopify Partner
134 0 40

@hassain wrote:

Hey @Mete ,

 

I am not sure if I fully understand this question. If you turn off the ability for Shopify to track quantity on a Product or Product Variant, you lose the ability to edit the quantity of the product and/or product variant from the Admin -> Products -> Inventory page.

@hassain I was expecting the same. But there is one case that you can change quantity while variant is untracked.

Here are the steps to reproduce:

1- Make a variant untracked.

1.png

 

2- Click on tracked button but don't save it. Notice Save button at the topbar.2.png

 

3- When you click on Track Quantity, You will be able to change quantities on locations. But variant is still untracked because we didn't click on save button at the topbar yet.

3.PNG

 

4- Adjust quantity will make an Ajax call and change the quantity on location. Variant is still untracked but shopify allows us to change the quantity.

4.PNG

 

5- Quantity has changed. Deselect track quantity checkbox. So we could change the quantity to 54 although we didn't change variant's state from untracked to tracked at any stage.

 

5.PNG

And since Shopify is no longer tracking the inventory of this product and/or product variant, it will no longer be aware of inventory changes for these resources and therefore not be able to send any webhook notifications about this. The best way to get inventory information in this case would be to just use the Admin API to pull the "inventory_quantity" field of the Product Variant / Inventory Item.

 

 


Actually shopify is tracking the inventory of this product/variant although its untracked but doesn't notify us at all when its untracked. I would expect at least a product update webhook to be triggered because the variant-> inventory_quantity field changes in database. Similarly quantity on a specific location changes as well which should trigger an inventory-level update webhook.

Co-Founder / Developer at: merchbees
Merchbees Low Stock Alert - Keep track of your low stock items by email and slack
Merchbees Inventory Value - Know your inventory value and quantity in real-time
Push Down & Hide Out of Stock - Move out of stock products to the bottom of the collection to improve SEO & hide/ unhide automatically
Mete
Shopify Partner
134 0 40

It has been more than 2 years. Shopify still has this bug. Can someone from the team look at it please?

Co-Founder / Developer at: merchbees
Merchbees Low Stock Alert - Keep track of your low stock items by email and slack
Merchbees Inventory Value - Know your inventory value and quantity in real-time
Push Down & Hide Out of Stock - Move out of stock products to the bottom of the collection to improve SEO & hide/ unhide automatically