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

Hey Kyle,

I’m running into the same issue, I setup an app on the weekend that worked absolutely fine without requesting any customer data access.

Yet I just started another today and it’s blocking me. Does the distribution of the app have an impact at all?

Hey Luke, yes the distribution can matter. If you’re building the app through your partner organization (custom, public or undecided) you likely need to still select the fields you need (although you don’t need to submit for review. Docs on that here

To access customer data in development, select the data and fields you’re using in the Partner Dashboard. You don’t need to submit a request for review for apps that are installed only on development stores.

If your app is for testing or installed only on a development store, you can access customer data in development after Step 5. You don’t need to submit for review.

If you are seeing different, can you share the store type that the app is installed on and the distribution type? My guess is if the above doesn’t help, that there may be something with the permissions between the 2 types. I can look in to that further if so.

So it seems I was getting this because no distribution was selected at all. I selected Custom and that was it, nothing else was done.

It might be worth updating the docs on this if possible!

Hey @Luke,

Thanks for sharing the fix. Good to know selecting a distribution type resolves it.

I’ve passed along the docs feedback.

1 Like

Hey Luke, closing the loop here, the docs are updated noting selecting a distribution type is required

1 Like