Restock webhook to detect all restocks

There are several different ways items can be restocked, but it’s not possible to detect them all correctly as some of them trigger similar topics at different moments in the return/restock process.

An orders/restock webhook topic would be very awesome to have. Maybe with a similar payload as the deduction part of the orders/edited webhook.

You can look at the the refunds/created webhook, but you can also restock an item without sending a refund, so in that case the refunds webhook is not triggered. If you look at the orders/edited, orders/updated, orders/cancelled and returns webhook there is one piece missing and that’s a generic way to detect the restock itself. You can look at the inventory_levels/updated webhook, but you can’t see if that was because of a restock or another inventory change because the inventory_levels/updated payload doesn’t contain a trigger/reason.

Adding a reason to the inventory_levels/updated webhook would be an even better alternative if a orders/restocked topic is not possible.

Anyone at Shopify that can help solve this missing piece?

I’m having the same challenge right now. We have a third party that is the source of truth for the inventory and need to communicate whenever there’s a restock from an order.

Right now from my tests it seems that most of the scenarios causes a refund:

  • Edit with remove/exchange item causes a refund and it has the restock field to true if you check “restock”
  • Refund creates a refund (Duh! :sweat_smile:) and restock is true if you checked restock.
  • Return → restock → refund, creates a refund with the restock to true.

Where I noticed a problem is all the other scenario where you start with a return:

  • Return → refund → restock. You get a refund webhook but restock is false. For the restock I noticed you get the webhook returns/close, but this webhook doesn’t seem reliable as you can close a return without restocking and it won’t tell you if restock was done or not. (Or maybe I just didn’t find how to know if restock was done)
  • If you return a free item or if you return and there is no money left on the order, you won’t have the refund option. When you do restock you’ll get the returns/close webhook which doesn’t help.

On POS all return/exchange/refund options seem to create a refund (even if you set the amount to $0) so no problem there.

In my opinion in the return scenario, the refund should create a refund with only a transaction (with the amount refunded) and restock should create a refund with only the item and no transaction.

Inventory webhooks is not an option as we don’t want Shopify inventory to update the third party inventory, only orders should do that.

Not sure if I missed other scenarios where we don’t receive the restock in webhooks.