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?