A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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)?
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.
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.
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.
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
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?
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.
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
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!