New Shopify Certification now available: Liquid Storefronts for Theme Developers

Get Order Data using Order Create Web hook

mozainarashid
Shopify Partner
5 0 0

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
Shopify Staff
1671 235 346

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 0

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
Shopify Staff
1671 235 346

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

Scott | Developer Advocate @ Shopify