What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Get Order Data using Order Create Web hook

Get Order Data using Order Create Web hook

mozainarashid
Shopify Partner
5 0 1

Hi, 

    I am trying to get order data whenever an order is placed and dump it to a endpoint. I know we can create web hook through embedded app or admin, but I want to do this through code. As far as I know, first we have to setup web hook handler, register the handler,  process the incoming event. But I don't really know how to do it. I want this functionality to work every time an order is placed in my app? Is this achievable through web hooks only or there is another way around. BTW, I am using Shopify with Laravel back-end. Any leads on how to implement this?

Thank you!

 

Replies 3 (3)

SBD_
Shopify Staff
1831 273 421

Hey @mozainarashid 

 

You can use this endpoint to register a webhook. When the data arrives, don't forget to verify the webhook before trusting the payload. There's a step by step guide here including PHP examples.

Scott | Developer Advocate @ Shopify 

mozainarashid
Shopify Partner
5 0 1

I am creating a webhook "orders/create", but I am getting this error: local.ERROR: REST request failed: "You do not have permission to create webhooks with orders\/create topic. This topic contains protected customer data. 
Now, I have also updated app scope to "read_orders",  filled the form in app->API Access->protected customer. How long will it take to get access. Is there any other way to get access using Admin API 2023-07. 

SBD_
Shopify Staff
1831 273 421

Sounds like you're on the right path! Let me know if you get stuck.

Scott | Developer Advocate @ Shopify