-
Notifications
You must be signed in to change notification settings - Fork 386
Shopify.Billing.check is useless for staff accounts #564
Comments
I'm using my own app and just ran into this problem, depending on the staff user permission, this query won't return any data:
Shopify is not clear about what permissions are needed to run this query, I tested on several shops that we have different degrees of access, some of them just return "access denied" I'm going to try to use offline tokens, but we'll still have to create an extra screen warning the staff user that doesn't have permission to approve subscriptions and that he needs to contact the store owner to approve it. But I'm not even sure if that's really the problem, so instead of risking a bad user experience, I've chosen not to throw an error if that happens and run the risk of losing some money. |
I decided to log every time that query returned an error and just ran into a weird situation now: on our partner dashboard this store has an active subscription with our app, but their store has an inactive Shopify plan. When we run the query using their access token, we get access denied 😂 |
This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days. |
We are closing this issue because it has been inactive for a few months. If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines Thank you! |
This is still an active issue I'm facing. Can this be re-opened? |
Issue summary
It's nice to have a billing check built in to the library, but it's currently insufficient as
Shopify.Billing.check
has no support for (all) staff accounts.Depending on the permissions set on the staff account, responses from the GraphQL api range from working as expected, to "access denied".
Only with these excessive permissions does

check()
work:These permssions result in

check()
throwing "access denied": (but a similar query is allowed via the REST api)In the 2nd scenario, even though disallowed via Grapqhl the staff account user has access to similar information via the
recurring_application_charges
REST endpoint.When "Manage and install apps..." is not checked, neither method works. Even with the per-app permission enabled.
Expected behavior
At the very least, the affect of staff account permissions on
check()
should be outlined in the docs.If the session indicates user is not a store owner, perhaps
check()
should use the REST api to query subscription status. Unfortunately, this seemingly only works if "Manage and install apps..." is enabled.It's strange that an app can procure a valid authentication session for a user and yet lack access to basic crucial information like billing status.
Actual behavior
As a staff account user without "Approve app charges" permission, the response from
check()
is:The text was updated successfully, but these errors were encountered: