Hi Shopify Community
,
I’m building a Shopify Product Discount Function app and ran into an issue when deploying it to a live store.
Everything worked fine in my development store. But after generating the distribution install link and installing the app on a live store, I ran into a permissions issue when trying to create an automatic discount via the Shopify GraphiQL app.
Here’s the mutation I’m using:
mutation { discountAutomaticAppCreate( automaticAppDiscount: { title: “Cart line discount” functionId: “My_Function_Id” discountClasses: [PRODUCT] startsAt: “2025-01-01T00:00:00” } ) { automaticAppDiscount { discountId } userErrors { field message } } }
And the error returned is:
{ “message”: “Access denied for discountAutomaticAppCreate field. Required access: write_discounts access scope.”, … }
What I’ve tried:- Added write_discounts to the app’s shopify.app.toml scopes.
-
Deployed the updated app.
-
Installed using the distribution install link.
-
Checked installed scopes via API – write_discounts was missing.
-
Opening the app from “Apps and sales channels” did not prompt for additional access scopes.
It seems like the updated scopes aren’t being granted or reauthorized.
Has anyone experienced this with Shopify Functions or scope reauthorization in distribution mode? Any ideas or tips would be appreciated ![]()
Thanks in advance!