read_all_orders scope private app

Solved

read_all_orders scope private app

admin-gh
New Member
4 0 0

Hi all,

 

I see the read_all_orders scope in the documentation in your partner section i just want all the order data extracted with my private app. Is this possible? Because if i query the orders api with the created_at_min and created_at_max for the first month I had an order I get 0 results.

 

Accepted Solution (1)
csam
Shopify Staff (Retired)
267 40 51

This is an accepted solution.

Hi @admin-gh 

 

Can you try using financial_status=paid instead? The status filter works with open, closed and any, and isn't related to payment state. You'll also need to set the status parameter to any, as only open orders are retrieved by default. The full request URL would be {storename}.myshopify.com/admin/api/2022-01/orders.json?status=any&financial_status=paid&limit=250

 

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 8 (8)

csam
Shopify Staff (Retired)
267 40 51

Hi @admin-gh 

 

Your private apps should automatically have access to all orders on the shop. The order query by default will only return orders that have an open status. If you include status=any as a parameter on your query, you should see all orders returned. Hope this helps!

To learn more visit the Shopify Help Center or the Community Blog.

admin-gh
New Member
4 0 0

Hi @csam ,

 

Thank you for your reply. Yes that was what i was thinking. I have set the return limit to 250. But i should have a "link" property in the headers according to this documentation. But there is non...

 

URL: https://{{store_name}}.myshopify.com/admin/api/{{api_version}}/orders.json?status=paid&limit=250

 

Headers:

 

 

{
    "Date": "Tue, 22 Feb 2022 10:05:42 GMT",
    "Content-Type": "application/json; charset=utf-8",
    "Transfer-Encoding": "chunked",
    "Connection": "keep-alive",
    "X-Sorting-Hat-PodId": "59",
    "X-Sorting-Hat-ShopId": "111111111",
    "Vary": "Accept-Encoding",
    "Referrer-Policy": "origin-when-cross-origin",
    "X-Frame-Options": "DENY",
    "X-ShopId": "111111111",
    "X-ShardId": "59",
    "X-Stats-UserId": "",
    "X-Stats-ApiClientId": "22222222",
    "X-Stats-ApiPermissionId": "333333333",
    "X-Shopify-API-Terms": "By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms",
    "HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT": "1/40",
    "X-Shopify-Shop-Api-Call-Limit": "1/40",
    "X-Shopify-API-Version": "2022-01",
    "X-Shopify-API-Deprecated-Reason": "https://shopify.dev/changelog/property-deprecations-in-the-rest-admin-api-order-resource",
    "Strict-Transport-Security": "max-age=7889238",
    "X-Shopify-Stage": "production",
    "Content-Security-Policy": "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Forders&source%5Bsection%5D=admin_api&source%5Buuid%5D=46052da0-44c2-449a-848d-ecee48a31af9",
    "X-Content-Type-Options": "nosniff",
    "X-Download-Options": "noopen",
    "X-Permitted-Cross-Domain-Policies": "none",
    "X-XSS-Protection": "1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Forders&source%5Bsection%5D=admin_api&source%5Buuid%5D=46052da0-44c2-449a-848d-ecee48a31af9",
    "X-Dc": "gcp-europe-west1,gcp-us-central1,gcp-us-central1",
    "X-Request-ID": "46052da0-44c2-449a-848d-ecee48a31af9",
    "CF-Cache-Status": "DYNAMIC",
    "Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
    "Server": "cloudflare",
    "CF-RAY": "6e1765c07c321e7d-AMS",
    "Content-Encoding": "br",
    "alt-svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"
}

 

 

 

csam
Shopify Staff (Retired)
267 40 51

Hi @admin-gh 

 

Thanks for including the X-Request-ID! How many orders are being returned in the initial response? 

 

Regards,

To learn more visit the Shopify Help Center or the Community Blog.

admin-gh
New Member
4 0 0

Hi @csam 

 

Just 131 orders. Where my YTD orders is above the 1000. So there would be a link header.

 

csam
Shopify Staff (Retired)
267 40 51

This is an accepted solution.

Hi @admin-gh 

 

Can you try using financial_status=paid instead? The status filter works with open, closed and any, and isn't related to payment state. You'll also need to set the status parameter to any, as only open orders are retrieved by default. The full request URL would be {storename}.myshopify.com/admin/api/2022-01/orders.json?status=any&financial_status=paid&limit=250

 

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.

admin-gh
New Member
4 0 0

Hi @csam ,

 

Thank you for the solution. This worked!

edmundas80
Shopify Partner
3 0 0

Hello, with the solution proposed, does that mean that read_all_orders scope is automatically granted to private Shopify apps once the read_orders scope is requested? 

 

Thanks

kps_analytics
Shopify Partner
2 0 0

Hello 🙂

 

Can I suggest adding this requirement to the API docs? It wasn't immediately obvious to me that I needed to add the `?status=any` modifier