Unable to generate report via private app

Highlighted
New Member
1 0 0

Attempting to generate a custom report via a private app, and although the response appears successful, it does not appear the report is actually generated. I have PLUS. 

Code to generate report:

 

 

 

import requests 


shop = shop
api_version = '2020-07'
api_key = api_key
api_password = api_password


#POST 
shopify_ql = """{
  "report": {
    "name": "dv_sales",
    "shopify_ql": "SHOW orders, gross_sales, discounts,
    refunds, net_sales, shipping, taxes, total_sales
    OVER day(happened_at) as day
    FROM sales SINCE -1d UNTIL today"
  }
}"""
api_url = f'https://{api_key}:{api_password}@{shop}.myshopify.com/admin/api/{api_version}/reports.json {shopify_ql}'
post_response = requests.post(api_url)

 

 

The above returns a 200 status code, and appears to run without error. 

Retrieving all reports on same shop: 

 

api_url = f'https://{api_key}:{api_password}@{shop}.myshopify.com/admin/api/{api_version}/reports.json'
params = {'limit': '250'}

response = requests.get(api_url,params=params).json()

 

 

The above returns:   {'reports':[]}

 

Is there something else I should be doing to generate reports? 

 

 

0 Likes