How to register orders create webhooks to new shopify cli app

Topic summary

Issue: ORDERS_CREATE webhook won’t register in a new Shopify CLI app using the boilerplate.

Context: Code defines a webhook handler (DeliveryMethod.Http, callbackUrl “/api/webhooks”) and attempts to set up both GDPR handlers (processWebhooks) and order handlers (api.webhooks.register) on the same webhooks path. Code snippets are central to understanding the setup.

Confirmation: Another developer reports the same problem with the official template.

Guidance: A responder points to the “official” approach for registering webhooks after app installation, referencing Shopify’s shopify-api-js webhook guide.

Most recent update: The documentation link changed; a corrected URL to the updated webhooks guide was provided.

Implication/next steps: Follow the updated guide to ensure webhooks are registered post-install using the recommended API patterns, aligning with the latest package docs path.

Status: Unresolved in-thread; no concrete code fix posted, but authoritative docs provided for proper registration flow.

Summarized with AI on January 13. AI used: gpt-5.

this is my OrderWebhookHandlers.js

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

export default {
  ORDERS_CREATE: {
    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";

app.post(
  shopify.config.webhooks.path,
  shopify.processWebhooks({ webhookHandlers: GDPRWebhookHandlers }),
);

app.post(
  shopify.config.webhooks.path,
  shopify.api.webhooks.register({ webhookHandlers: OrderWebhookHandlers})
);

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

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

Ty

There was a similarish post I found and answered there.

https://community.shopify.com/post/2124324

There is an “official” way to register webhooks after installation.

https://github.com/Shopify/shopify-api-js/blob/main/docs/guides/webhooks.md

2 Likes

The docs changed here is the new webhooks link

https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/guides/webhooks.md