Channels delete webhooks

Our application is tracking the channel information and channel definition data via the GraphQL Order object. Tracking these objects via the Order object allows our application to create and update this information in the DB however I have not found a way to track a channel information or channel definition deletion. These objects should not change very often and I suspect they potentially cannot be deleted but I noticed there is a channels/delete webhook.

Does anyone know in what scenario this webhook should be used and to what type of channel object this refers to?

In GraphQL I can see 3 channel object;

  • Channel - Which is being deprecated as far as I understand
  • ChannelInformation - Associated to each store and potentially replacing Channel
  • ChannelDefinition - Global Channel definition
1 Like

Hey @Mathieu_Nunez :waving_hand:

The CHANNELS_DELETE webhook fires when a sales channel is removed from a store. I confirmed this by testing on my end. When I uninstalled the Shopify Inbox app, the webhook fired as expected. The webhook refers to the Channel object specifically, not ChannelInformation or ChannelDefinition.

Since many Channel fields are deprecated, you’ll want to use the publications query instead of the channels query for ongoing operations. The channel ID and Publication ID are the same, so for example, when you receive a CHANNELS_DELETE webhook with ID 71886340118, you can query publication(id: "gid://shopify/Publication/71886340118") to get current channel details. This should give you the cleanup detection you need.

1 Like

@KyleG-Shopify thank you for the quick reply. I did a test on one of my test store and the id returned matched the Channel ID and the Channel Information ID. The interesting part is although I deleted the sales channel on the store when querying the existing orders on the deleted channel the Channel Information object was still populated. Given this I don’t think we will need to track the channels/delete webhook.

I did check the publication query and it does return null once the sales channel is deleted but returns a value once the sales channel is available.

1 Like

Thanks for confirming that Mathieu! Glad to have helped clear that up.