Hoping someone can shed some light on this:
I’m trying to call the GET orders API for my public app that as I understand, is supposed to return up to 60 days worth of orders. I just want to know the average order amount for paid orders.
Here’s the endpoint I am calling:
/admin/api/2023-07/orders.json?fields=total-price&financial_status=paid
Here’s the Shopify API doc I am following:
https://shopify.dev/docs/api/admin-rest/2023-07/resources/order#get-orders?status=any
I am passing my installed app’s access token (received from the Shopify OAuth flow on installation authorization by the merchant) as the header X-Shopify-Access-Token
and I get a 400 HTTP error with the following response message:
“order”:“Required parameter missing or invalid”
The scopes on my installed app are:
write_discounts, read_discounts, read_price_rules, write_price_rules, read_orders, write_orders, write_script_tags
So per the Shopify API docs, I should be able to get a successful response to the API query.
The issue does not seem to be with the access token as I tried using an incorrect token and get this error, which is different from the one above:
“errors”:“[API] Invalid API key or access token (unrecognized login or wrong password)”
I have used the app’s access token with other Shopify API that use the X-Shopify-Access-Token header successfully.
I also have the “Protected customer data access” section checked in the Shopify Partners admin section for my app.
Any advice on this would be greatly appreciated.