how to register orders create webhooks to new shopify cli app

Shopify Partner
9 0 3

this is my OrderWebhookHandlers.js



import { DeliveryMethod } from "@shopify/shopify-api";

export default {
    deliveryMethod: DeliveryMethod.Http,
    callbackUrl: "/api/webhooks",
    callback: async (topic, shop, body, webhookId) => {
      const payload = JSON.parse(body);



and this is my index.js


import GDPRWebhookHandlers from "./gdpr.js";
import OrderWebhookHandlers from "./OrderWebhookHandlers.js";
  shopify.processWebhooks({ webhookHandlers: GDPRWebhookHandlers }),
  shopify.api.webhooks.register({ webhookHandlers: OrderWebhookHandlers})


the ORDERS_CREATE is not registering. what am I doing wrong? any solution?

Replies 4 (4)

Shopify Partner
5 1 2


If I'm not sure about the steps that you are giving... but I'll tell you what works for me:


I've added my Webhook definition inside the GDPRWebhookHandlers (for now, is not the most elegant but works)


When the server start, the processWebhooks will add all the webhook handlers to the library registry; but it will not register them with Shopify.

This is done when the method register is called. And this is done by:

app.get(shopify.config.auth.callbackPath, shopify.auth.callback(),shopify.redirectToShopifyOrAppRoot() );
the shopify.auth.callback() of shopify-app-express will take care of that.


The last you need is to force this callback. The easy way is to edit the configuration of the scopes in the  file and restart the server. This will force the re-auth in the admin and will call the callback path.


I hope this helps you!





Shopify Partner
6 0 3

Hi, did you find a solution, I'm using the same official boilertemplate as you and it doesn't register this webhook.



Shopify Partner
12 0 3

There was a similarish post I found and answered there.


There is an "official" way to register webhooks after installation.

Shopify Partner
12 0 3