I'm trying to use ShopifyAPI::Report endpoint via Rails/Ruby shopify_api gem. Other endpoints like ShopifyAPI::Order work fine.
But ShopifyAPI::Report returns an empty result. But it works via browsers. See screenshots
Any idea what might be going on?
Solved! Go to the solution
I've done some investigation into the behaviour you're experiencing and would like to share the context I gathered with you.
The following are some of the behaviours to take into consideration:
Hopefully the above clarifies the behaviour you're seeing. However, if you created a report with your app credentials and you still are getting an empty result set when you query please do get back to me and I'd look into the issue further.
So even "common reports" or "default reports" that exist in Shopify Admin by default, are not accessible via this ShopifyAPI::Report? If so which "app" cretaed those reports?
The main reason i want access to them is to use them as a template/example for customizing our own internal reports. Documentation on the topic is sparse, and I learn best by example
This is an accepted solution.
The default reports are created by Shopify and aren't accessible via API to the best of my knowledge. The ShopifyAPI is a wrapper around our Admin API and you would still need to use credentials from an app (private, custom, or public) on your store to access any data from your store.
If you're interested in the the ShopifyQL that generates the default reports, what you can do is to save a copy of the report (you can make customisations as well) through the Admin. Doing this would save the report as a custom report, making it accessible via the
/report.json using the browser, and you'll be able to see the ShopifyQL that generated the report of interest. Once you have the query, you can use that to create a report via the API.
Let me know if this helps, or if you have any more questions regarding this.