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.

Webhook subscribtion

Webhook subscribtion

RomanIvanov
Visitor
1 0 0
Hi all!
I develop an app for shopify stores. In my app I'm making a subscription on 'domain/change' webhook.
So I had installed the app to my store. The app had sent request
'axios.post(
  `https://${shop}/admin/api/2021-01/webhooks.json`,
  {
    'webhook': {
      'topic': 'domains/update',
      'address': `https://2c9302fe2bd2.ngrok.io`,
      'format': 'json'
    }
  },
  {
    'headers': { 'X-Shopify-Access-Token': accessToken }
  }
)'

And I received:
{
  status: 201,
  statusText: 'Created',
  config: {
    data: '{"webhook":{"topic":"domains/update","address":"https://2c9302fe2bd2.ngrok.io","format":"json"}}'
  }
}
Looks like I've subscribed successfully. But when I had changed the primary domain through Shopify admin
RomanIvanov_0-1616421605589.png

 

I didn't receive the webhook response on https://2c9302fe2bd2.ngrok.io .
Could you help me, please? Did I miss something? What could I'm doing wrong?
Reply 1 (1)

Gregarican
Shopify Partner
1033 86 293

Wouldn't the webhook fire for domains/create for that scenario? You aren't editing a domain that's already defined in the Shopify web admin. You are replacing an already-defined domain name with a new one. Maybe subscribe to that webhook and see what happens...