ShopifyAPI::Report returns an empty result

Solved
stellahealth
Tourist
4 0 1

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?

  1. I double-checked my access permissions for this app (Admin -> Apps -> Private App -> Permissions), and it does have access to "reports".
  2. Talked to Shopify Support Guru, who redirected me here

Screen Shot 2021-01-14 at 16.47.09.png

Screen Shot 2021-01-14 at 16.48.24.png

 

 

  

0 Likes
syf_
Shopify Staff
Shopify Staff
54 11 9

Hi @stellahealth,

I've done some investigation into the behaviour you're experiencing and would like to share the context I gathered with you.

The behaviour you see currently is the expected behaviour of the Report API within our platform per the docs as the image below shows.

21-01-qdmxj-57p2x

 

 

 

The following are some of the behaviours to take into consideration:

  • Currently apps are only able to access reports that they created.
  • Reports created via custom reports in the Admin belong to the custom_reports category.
  • Reports created via an app belong to the custom_app_reports category.
  • Using the browser, you're logged in to the store and you have access to all the reports in the store, reason you're able to see all the reports.

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.

Best,
Seth.

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

stellahealth
Tourist
4 0 1

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 

0 Likes
syf_
Shopify Staff
Shopify Staff
54 11 9

This is an accepted solution.

Hi @stellahealth,

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.

Best,
Seth.

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

stellahealth
Tourist
4 0 1

Thank  you. I tried it just now and this workaround works for my purposes. Thanks!

0 Likes