webhooks details

Highlighted
New Member
11 0 0

1. What is the purpose of webhooks in merchants side (Store Settings -> Notifications -> Webhooks)

2. If merchants can configure the webhooks, how merchants are able to know the webhooks that are created in the app.(For eg: The URL in the below screenshot)

webhookmerchant.PNG

3. In the registering of below webhook , why do we need topic and address. What is the relevance?

 

  const registration = await registerWebhook({
         address: `${HOST}/orderWebhook`,
         topic: 'ORDERS_CANCELLED',
            accessToken,
            shop,
            apiVersion: ApiVersion.April20
           });

 

0 Likes
Highlighted
Explorer
76 0 12

Hi,

 

So, as I understand it, webhooks are predominantly for apps. There's more info here

"Webhooks are a useful tool for apps that want to stay in sync with Shopify or execute code after a specific event".

 

For example, our app receives notifications when our merchants add new products to their store. Our app can then automatically execute some code internally to account for that.

I'm not aware of an easy way for merchants to use webhooks. That said, it wouldn't surprise me if someone has built an app for that. 

 

In terms of the address and topic:

Address: A URL suffix from the app developer, they are setup to receive the information/request at this address.

Subject: I think this is just an arbitrary name that their app developers set up. It's been a while since I configured ours though.

 

Cheers,

 

Oli

 

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

0 Likes
Highlighted

Hi @NithinUser ,

 

A use case would be taking customer information into a CRM when a new order comes in. Allowing the merchant to create a webhook caters for this. This section of admin is not really relevant to an app - rather the events that can happen in the store.

 

In the second point, this is relevant to an app. The app needs to tell Shopify the address where it will receive the webhook (the end point on your server). The topic allows your webhook controller to know what action it is dealing with. For example, an App Uninstall webhook would be registered by an app so that when the merchant deletes the app, a webhook would be sent to the app server after the fact allowing for cleanup of data, etc. In your example, when an order is cancelled you would receive a message allowing you to act on that information in your app.

 

Hope this helps, GMKnight.

Store owner and app developer.
0 Likes
Highlighted
New Member
11 0 0

Thanks. "In the second point, this is relevant to an app" - I think you are talking about the third point. Please correct me if i am wrong. Any guess about point number 2 

0 Likes
Highlighted

Hi @NithinUser 

 

You are right - didn't have my coffee yet....

 

Ok. Second point. They don't. These webhooks are only relevant if a merchant wants to create a webhook to an external system using the events in the dropdown.

 

If you are an app developer and you register a webhook through your software then you are creating it for your software to be notified when an event occurs (it's secret sauce). The merchant won't know anything about this.

 

GMKnight.

 

Store owner and app developer.
0 Likes