How can I create webhook through rest api in NODE js ?

1 0 0

How can I create webhook throush rest api in NODE js ? I found this solution on docs'URL', (requestresponse=> {
    "webhook": {


Can anyone please teach me how to implement this on shopify node app and to what URL should I make POST request throush REST api?

Replies 3 (3)

Shopify Staff
1561 81 341

You would POST to, this is clearly outlined in the documentation.


You could do this a number of ways when using Node:


I'm not a JS developer myself, so you probably don't want any specific code examples I would share, but the above should be adequate for finding your own way.


Cheers and good luck.

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

Shopify Partner
4 0 0

what should come in the header of this api call? access token ?

Shopify Partner
16 0 1

I'm trying to create a webhook with nodejs, but receiving this error:


getaddrinfo EAI_FAIL https://api_key:pass@url_store
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) {
errno: 'EAI_FAIL',
code: 'EAI_FAIL',
syscall: 'getaddrinfo',
hostname: 'https://api_key:pass@url_store'



this is my request code


var postData = querystring.stringify(body);
    var options = {
      hostname: url,
      port: 443,
      path: path,
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Content-Length': postData.length
    var req = https.request(options, (res=> {
      res.on('data', (d=> {

    req.on('error', (e=> {