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.

Not receiving webhook

Not receiving webhook

Matt_Werdean
Shopify Partner
20 0 6

Hello,

I have an endpoint set up that works properly on ngrok but not when I put it on our live app. It has no problem sending api calls and getting information back, but webhooks don't seem to reach it. The app is actually only available to people who access it through our IP address.  I think this may be playing a roll in why we are not receiving any webhooks, but I want to make sure with someone here.  If this is the case would we have to make the app public, or is there a way to whitelist information coming from Shopify? 

Thanks!

Replies 6 (6)

Alex
Shopify Staff
1561 81 343

@Matt_Werdean  Can you provide some more information? Your webhook ID and a time frame in which you would have expected the webhook delivery would help.

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Matt_Werdean
Shopify Partner
20 0 6

Quick question, don't I receive an ID after I receive a webhook? If not how do I find the id?

Alex
Shopify Staff
1561 81 343

Assuming you're referring to webhooks created with the API, you should be getting one or more JSON objects back when hitting /admin/webhooks.json, or when you create a webhook you should be receiving a single JSON object back to show that which you created.

 

Are you saying the ID is not present on this object, or that there is no object at all?

 

If you're not seeing an object at all, then it's likely the webhook you created is not tied to your current access token (webhooks are scoped to those who created them). If you're not seeing an ID, that's strange. Can you share what you get in the response and maybe a request-id?

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Matt_Werdean
Shopify Partner
20 0 6

Ah gotcha. I wasn't originally creating the webhook using the api. I did it manually under the notifications section in settings. I'll try it this way and get back to you with any results.

Matt_Werdean
Shopify Partner
20 0 6

Sorry for the delay. Still having problems. If you're still there, I created a webhook using the API. Here's the object I got back, including  id. 

 

{ webhook:
   { id: 575904972900,
     address: 'https://payment.in.basised.ventures/order_payment1',
     topic: 'orders/create',
     created_at: '2019-03-21T14:30:33-07:00',
     updated_at: '2019-03-21T14:30:33-07:00',
     format: 'json',
     fields: [],
     metafield_namespaces: [] } }

When I created an order manually in my shop, I never received a log from my endpoint. It looks something like this: 

app.post(`/order_payment1`, (req, res) => {
    console.log('Order Information', req.body)
}).catch(err => console.log(err)

Like I said before, these webhooks work fine when using ngrok, but not through my app hosted on our server using IIS. I think it may have to do with how the server is accepting this information, but i'm not sure. 

 

Alex
Shopify Staff
1561 81 343

@Matt_Werdean It looks like we're having trouble establishing a TCP connection to your server (assuming it' still running). I tried a quick curl POST to your server with no luck as well. If your server is still running, I'd recommend continuing to look introspectively.

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog