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.

Custom Shopify app

mattfrat
Shopify Partner
7 0 0

Hello everyone! I am trying to develop a custom app on Node js with the Shopify CLI. The purpose of the app is that of extracting orders daily from the Shopify store, transferring them into a PostgreSQL database. I am currently trying to write code in order to do so but, due to my inexperience in app development, I am finding it hard to understand the whole of it. I am therefore asking you whether you may have any suggestions or advice for setting it up. I already set up the app on a development store (with ngrok etc.) for testing and read the following articles and forum discussions to get some further information: https://shopify.dev/api/admin-graphql/2022-07/objects/order , https://community.shopify.com/c/shopify-apis-and-sdks/api-for-order-export/td-p/842164, however, as of now, I have not managed to achieve much. Could you please help me with that?

Replies 8 (8)

CloudlabSam
Shopify Partner
512 41 81

Have you been able to make any successful API calls using the token you've received from the OAuth flow yet?

mattfrat
Shopify Partner
7 0 0

Yes, I could. I followed a tutorial on how to select products using the app and everything worked properly. I am wondering how could I use the api to retrieve orders daily. What could I use for making it possible?

CloudlabSam
Shopify Partner
512 41 81

Are you using GraphQL or REST API? Is there a reason you aren't using Webhooks instead?

 

What is your goal once you have the orders and put them into PostgreSQL?

mattfrat
Shopify Partner
7 0 0

I am using GraphQL and my goal is that of joining the Shopify order data to external order data (from a company software) in order to have better statistics on all of them on a whole

CloudlabSam
Shopify Partner
512 41 81

If you only want to get orders moving forward, using Webhooks will probably be easier for you. If you need to go back to get order history you can use the Order object to get orders for any period of time. For example, you may call once a day to get orders for the past 24 hours.

 

https://shopify.dev/api/admin-graphql/2022-07/objects/order

mattfrat
Shopify Partner
7 0 0

Thanks. I tkink that would work. Are webhooks easy to implement and how could I implement one? I am now struggling a little with requests in general too. It is my first project on this matter.

CloudlabSam
Shopify Partner
512 41 81

Yes, Webhooks are pretty straightforward. Best resource is here - https://shopify.dev/api/admin-rest/2022-04/resources/webhook

upserve
Shopify Partner
28 0 0

Yes, webhooks are working here like in Wordpress:

- first you have registered event

- when event happened you can hook it it and call what you need

 

For example once the order is created than you can call the hook method. 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on https://ua.linkedin.com/in/yanchuga regarding any help
Shopify Partner | Telegram : https://t.me/yanwinner