I am trying the extended variants preview. When I create a product with three options and multiple variants, the system creates multiple inventory_items
, products
, and inventory_levels
as expected. However, strangely, it sends an inventory_levels/disconnect
webhook for an inventory_item
that does not exist in the system. Following this, we receive an inventory_items/delete
webhook for the same inventory_item_id
.
Why do we receive delete
and disconnect
webhooks for an item for which we did not receive any creation webhook?
I think this has to do with how the products are created at an API level. To create a product with multiple variants Shopify uses multiple API calls, the first one creates a product with a stand alone variant, and then there a separate API call that creates the real variants for the product and removes that temporary placeholder variant.
My guess is that the inventory item ID you’re seeing might be related to this temporary placeholder variant that just exists for a split second between those two API calls?
@Daniel_Ablestar, I thought the same. However, if this is the case, I would still expect consistency.
Either send the creation webhook for the inventory item and inventory level (for the default product) or don’t send deletions at all.
It feels like the developer completed only half the task and released it.