# How to Automate Shopify Sales Reports using the API

- Tool: API Automations
- Difficulty: Intermediate
- Fix time: 30-60 minutes
- Compatibility: Shopify Standard plan; custom app with scopes: read_orders, read_analytics (Plus/Advanced for shopifyqlQuery)
- Last updated: May 2026

## TL;DR

Automate Shopify sales reports using the GraphQL `orders` query with date filters or, for stores with 1,000+ orders, the `bulkOperationRunQuery` mutation which returns a JSONL file and bypasses rate limits entirely. On Basic plans, use paginated `orders` queries; on higher plans, use `shopifyqlQuery` for analytics-level aggregations. The 1,000-point GraphQL bucket limits non-bulk fetching to ~5-10 pages/second on Standard plans.

## Best practices

- For stores with >1,000 orders/period, use bulkOperationRunQuery — it has no rate-limit cost and is orders of magnitude faster than paginating.
- Always filter for `financial_status:paid` unless you specifically want pending or refunded orders in your numbers.
- Subscribe to the BULK_OPERATIONS_FINISH webhook rather than polling — it's one-time setup vs repeated API calls.
- Store report snapshots in a database for historical trend analysis — don't re-query Shopify for last month's data when you already have it.
- Compare bulk result URLs against expected order counts (`objectCount`) before processing — a JSONL with fewer lines than orders indicates a partial failure.
- For real-time dashboards, use paginated queries; for scheduled reports, use bulk operations.
- Bulk operation result URLs are valid for 7 days — download and process promptly.
- Use ShopifyQL (`shopifyqlQuery`) on Standard/Advanced/Plus plans for pre-aggregated analytics data — it's faster than computing aggregations yourself.

## Frequently asked questions

### What is the difference between ShopifyQL and regular GraphQL orders queries?

Regular GraphQL `orders` queries return raw order records that you aggregate yourself. ShopifyQL (`shopifyqlQuery`) is Shopify's analytics query language that runs against pre-aggregated analytics tables — it returns already-computed metrics like 'total sales by product this month' without you having to process individual orders. ShopifyQL is available on Shopify Standard and above and is much faster for period summaries. However, it has less granularity than raw order data.

### When should I use bulkOperationRunQuery vs regular paginated queries?

Use paginated queries for up to ~1,000 orders — it's simpler and responds synchronously. Switch to bulkOperationRunQuery when you have more than 1,000 orders in your date range, need a full historical export, or are running out of GraphQL budget. Bulk operations have no rate-limit cost, run asynchronously, and return JSONL files that can contain millions of records.

### How long do bulk operation result files stay available?

Shopify bulk operation result files are valid for 7 days after the operation completes. Download and process the JSONL file promptly — don't rely on the URL being available a week later. The file is publicly accessible by URL (no auth required) so treat it as sensitive and don't share the URL.

### Can I get ShopifyQL analytics data on a Basic plan?

ShopifyQL access varies by plan. Basic plan has limited analytics access — many reporting tables are only available on Shopify Standard, Advanced, and Plus plans. If you're on Basic and need analytics-level aggregations, you'll need to compute them yourself from raw orders data via the GraphQL `orders` query.

### What happens when I hit the GraphQL rate limit while generating reports?

Shopify returns HTTP 429 or throttling data in `extensions.cost.throttleStatus`. On Standard plans: 1,000-point bucket, restores at 50 pts/sec. A paginated orders query with 250 records and lineItems can cost 100-200 points. If you're regularly hitting the limit on report days, switch to `bulkOperationRunQuery` which completely bypasses the rate-limit system.

### Is the Shopify API free?

The Admin API is free for apps installed on Shopify stores. There are no per-call fees. Your Shopify plan determines the GraphQL rate limit bucket size (Standard: 1,000 pts; Plus: 10,000 pts). Third-party infrastructure (server, cron, Slack) is your own cost.

### Can RapidDev help build a custom Shopify reporting system?

Yes. RapidDev has built 600+ apps including Shopify analytics dashboards with real-time P&L tracking, multi-store aggregation, and Google Sheets integrations. We can connect Shopify's bulk export API to your existing BI tools. Book a free consultation at rapidevelopers.com.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-shopify-sales-reports-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-shopify-sales-reports-using-the-api
