Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

orders/create event not firing

tadmit
Shopify Partner
3 0 0
I used the npm init @Shopify/app@latest command to create a Shopify app and attempted to implement a feature that listens for webhooks triggered whenever a new order is created in the shop.

Thus, I navigate to the shopify.server.js file and include the following code within the webhooks property:

ORDERS_CREATE: {
  deliveryMethod: DeliveryMethod.Http,
  callbackUrl: "/webhooks",
  callback: async (topic, shop, body, webhookId) => {
    console.log("--- Order create ---");
    const payload = JSON.parse(body);
    console.log(payload);
    console.log("--- /Order create ---");
  },
},

And ofcourse, I added to this access scopes inside shopify.app.toml:

[access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = "write_products,read_orders,write_orders"

When I update a product (have a webhook set up for PRODUCTS_UPDATE), I can see the webhook being successfully invoked. However, when I manually create an order in the orders tab of the dashboard, I do not see any corresponding webhook requests. What could be the issue, and how can I address it?


store test link: https://admin.shopify.com/store/tzionhamuztzim
i go to orders => create order => add product => mark as paid => create order. and nothing!

Replies 2 (2)

Liam
Shopify Staff
2626 284 720

Hi Tadmit,

 

Are you still seeing this issue?

Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog

tadmit
Shopify Partner
3 0 0

yes it's still relevant.
orders webhooks not fired, while product update yes.
do i need to do something else? or this configuration is correct?
what access scope needs to be set for orders_create webhook? and what the process should i do to simulate real event? go to admin and create order via dashboard is valid proess?