ShopifyQL Python SDK - Level 2 PII Access Required? + Available Datasets Question

Hi everyone,

I’m testing the new ShopifyQL Python SDK and I have some questions about the requirements and available features.

The Error I’m Getting:

Access denied for shopifyqlQuery field. Required access: `read_reports` access scope.

Also: Level 2 access to Customer data including name, address, phone, and email fields.

My Questions:

  1. Why is Level 2 PII access required?

I’m only trying to run simple analytics queries like:

FROM sales SHOW total_sales SINCE -30d UNTIL today

This query doesn’t request any customer PII data (no names, emails, addresses, or phone numbers). Why does the SDK require Level 2 Protected Customer Data access for basic sales metrics?

  1. Which datasets are available via the Python SDK?

I tested several datasets and found:

  • sales - Works (total_sales, gross_sales, net_sales, orders, etc.)

  • sessions - Works (sessions count, referrer_source)

  • payments - Works (gross_payments, net_payments)

  • orders - Returns “Invalid dataset in FROM clause”

  • products - Returns “Invalid dataset in FROM clause”

  • customers - Dataset exists but columns not found

Is this expected? The documentation mentions orders and customers datasets but they don’t seem to work via the API.

  1. Development stores and test data

Should ShopifyQL return data from development stores? I have test orders in my dev store but the sales dataset returns total_sales: 0. Is this because test orders are excluded from ShopifyQL analytics?

My Setup:

  • ShopifyQL Python SDK (latest version)

  • API version: 2025-10

  • Store type: Development store

  • Scopes: read_reports, read_orders, read_products, read_customers

Documentation Reference:

Any clarification would be helpful. Thanks!

1 Like

Hey @Marco_Langer,

The Level 2 PII requirement applies to all shopifyqlQuery calls, even when your query doesn’t touch customer data.

For troubleshooting the problematic queries, I’d recommend checking the ShopifyQL syntax reference and segment query language reference to verify available columns and query patterns.

As for the zero sales on your dev store, test orders are excluded from analytics by design. The sales reports documentation confirms that test orders placed with Shopify Payments in test mode don’t appear in reports. To see real data, you’d need orders placed with live payment methods.

2 Likes