Sending customer details to my database when order is created?

Wesley_Hamburge
Shopify Partner
3 0 0

Hi,

We are an on-demand delivery service looking to integrate ourselves into a store. We would like to dispatch order details to our DB when the user selects our shipping option and makes an order. However I am unsure whether I need to use an App, or the API and overall direction.

So question is whether or not I can do this, and what the event would be for such a transaction to take place? 

If it is possible where could I start?

Thanks in advance,

Wes

0 Likes
Cian_H
Shopify Staff (Retired)
Shopify Staff (Retired)
78 0 7

Hi Wesley,

Cian here from Shopify. Great question!

You could set this up via Shopify's API. You would need to set up a webhook to track new orders being created. You could then use a custom app that you created to run a GET request on your orders to get that information. Check out the following link for more information on using Shopify's API for GET requests: https://help.shopify.com/api/reference/order#index

Another useful resource that you could explore using is our API & Technology forum: https://ecommerce.shopify.com/c/shopify-apis-and-technology

Hope that helps!

All the best.

Cian

0 Likes

Wes,

Another option is to create a webhook in your store that points to a web application that has access to your database. The application doesn't have to be a Shopify app, it would just recieve the webhook data (JSON), parse out the order details, and update your database.

To create a webhook:

  1. Go into your Shopify admin
  2. Settings
  3. Notifications
  4. Scroll to the bottom to find the webhooks
  5. Create a new webhook for Order creation with the url to your app
  6. (optional) You might want one for Order update if you want details about order changes too

If you wanted to create a custom Shopify app, you'd do almost the same thing though the webhook setup process is done in code instead of in the admin interface.

One useful resource I use for this is http://requestb.in/. You can create urls in it that Shopfiy's webhooks can send data to. Then you can inspect the data. It's like a webhook data debugger.

 

Eric Davis | Little Stream Software | Shopify apps to increase your repeat customers | http://www.littlestreamsoftware.com/apps/
0 Likes
Javier_Quintero
New Member
2 0 0

Eric,

I have a Shopify webhook created already. I am receiving a JSON response locally using a tunnel service. I have created an entry point in my application but I don’t know exactly how to have that JSON response available in the application. I appreciate if you could give me an idea/example of how to do it would be great.

Thanks

0 Likes
mmahjoub
New Member
1 0 0

So, my question is, can we create a web-hook for specific products? 

And my second question is, once we add our end point, can we control what is sent? I want to send the product and customer information to my end point? Do I need to add this manually or does Shopify does it for me? Please let me know. 

 

Thank you very much, and have a wonderful day. 

 

Mo, 

0 Likes
temifyapps
New Member
4 0 0

Hi cian i am using laravel to create a shopify app , i am getting customers and orders details but i want to know customers order detail in  a single response 

/admin/api/2020-10/orders.json
/admin/api/2020-10/customers.json
 
but i want to merge these queries into one i need customers with discount they use , and other fields with customers  can you help me ...?
0 Likes