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.

Re: Get Sales Data Programmatically

Get Sales Data Programmatically

jitendra2896
Visitor
3 0 0

We are trying to create an application that fetches the sales data from Shopify and uploads to the target system(Algolia)

 

We need to use the sales data i.e. top products sold last month or last three months and use that information on the Shopify front end to sort the products. We are using Algolia as an index and so we need to save the data points in Algolia after calculating it from Shopify. This we need to do on an hourly basis.

 

Is there a way we can get this sales information programmatically (by hitting any API or by some other means that doesn’t require manual intervention)?

Replies 8 (8)

JustinNg
Shopify Partner
21 3 0

Hi Jitendra2896,

 

You should create a private Shopify app. This app can access to Shopify API (include: order API) and work as a bridge between Shopify and Algolia.

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website
jitendra2896
Visitor
3 0 0

Hi @JustinNg ,

We do have a private Node App running

Could you let us know which Shopify API can support this or if there is a GraphQL Bulk Query to get all the sales data we need which will provide the JSONL response.

JustinNg
Shopify Partner
21 3 0

Did you try this API https://shopify.dev/api/admin-rest/2022-01/resources/order ? But actually, you can't get all the data in one API.

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website

Mandelbrotian
Shopify Partner
140 1 23

Hi Jitendra2896,

 

I've just finished setting up something like this for someone else. I used AWS to automatically refresh sales data every few hours via the Shopify API, then fed the data into a table using Kinesis for further processing. It's for a high throughput situation though so you might be better off just hitting the API and pushing the data straight to Algolia. Hit me up if you need a hand.

 

Cheers,

Elliott

Feeling a bit lost? Contact elliott@mandelbrotian.com for help with theme setup, alterations, custom functionality, and app development.
jitendra2896
Visitor
3 0 0

Hi @Mandelbrotian ,

Which API to exactly hit in your case that can give us this sales data

We tried with Shopify Reports API but that gives us the Report information but not the actual data inside of the report

We do get a shopify ql attribute there. Can you let us know how we can execute that query to get the information?

Or is there other API exposed by Shopify that gives us this information in JSON or some other format?

CloudlabSam
Shopify Partner
611 49 106

As mentioned by others, this is possible but you can't do it all via one API call. You might be able to do something with a bulk query in GraphQL, but you will likely hit some rate limiting issues.

 

Our Report Toaster app can provide all of this information and a lot more. If you want to message me we could discuss how this could be automated for you. 

Mandelbrotian
Shopify Partner
140 1 23

@jitendra2896

 

Justins link to the orders API is probably the best place to start. There are multiple node packages out there that will streamline your connection to the Shopify API. Sounds like a good read of the documentation would be your best bet on progression.

 

Cheers,

Elliott

Feeling a bit lost? Contact elliott@mandelbrotian.com for help with theme setup, alterations, custom functionality, and app development.
EwingLiang
Visitor
1 0 0

Hi @Mandelbrotian , we have the same requirement. Are you able to provide service to set this up for us? How to contact you? thank you!