shopifyqlQuery API, support for "ORGANIZATION" keyword?

Hi there,

We have a data export app and use the shopifyqlQuery API to allow merchants to automate the Analytics Reports export.

It seems the “ORGANIZATION” keyword is not allowed currently and returns the message:

“Organization permissions are required: You don’t have permissions to use the ORGANIZATION keyword.”

One of our customers is a Shopify Plus store with multiple stores and the query works in their Shopify Admin, but returns this error via the API.

The API docs only mentions the read_reports permission and I don’t see any other permission/access scope mentioned related to this.

It does seem to make sense that this will be blocked for security reasons since the merchant only explicitly authorized the read_reports access scope for 1 store, so the app shouldn’t be able to access data from other stores via the API.

I’m curious, however, if there’s a separate access scope that may not be documented that allows this?

@NickP-Shopify any insights?

Hi @Jonathan-HA

There are additional scopes that you might need to add to access specific data, but I can’t see one that would be relevant to organisations a store is part of. It’s possible this can only be queried from within the admin - can you share the query you’re trying, removing any sensitive info?

Hey @Liam-Shopify ,

The error is specific to the new shopifyqlQuery API (it’s not a standard access scope/permission error):

So the API appears to validate the query before processing and won’t process it if the “organization” keyword exists in the query string.

We already have the necessary scopes that’s documented enabled (read_reports and customer info-related scopes) and the merchant can query those just fine only for the store where the app is installed.

The ORGANIZATION keyword in ShopifyQL is somewhat special and allowed only for stores on the Plus/Enterprise plans. It can query data from other stores when used in the Shopify Admin:

However, that keyword appears to be disabled via the API.

The merchant is on Shopify Plus and they confirmed the query works fine in the Shopify Admin, but the same query is blocked via the API.

Maybe someone from the Analytics team can provide insights? It makes sense to me why this would be blocked on the API side, but just want to know if there’s a possible workaround before I tell the merchant it’s not possible.

Hey @Jonathan-HA

We currently have a limitation at the API level to expose organization data because we don’t have granular-enough permissions unlike what we see in the admin. This is on our list but I can’t provide any ETA unfortunately.

Thanks!

/N

Thanks for confirming that Nicolas!