Issue Installing Shopify Discount Function App – write_discounts Scope Not Applied on Live Store

Topic summary

A developer is encountering a permissions error when deploying a Shopify Product Discount Function app from development to a live store.

The Problem:

  • The app works correctly in the development environment
  • After installing via distribution link on a live store, creating automatic discounts fails with an “Access denied” error
  • The error indicates missing write_discounts scope

Steps Already Attempted:

  • Added write_discounts to shopify.app.toml scopes
  • Redeployed the app
  • Installed using distribution link
  • Verified via API that write_discounts scope is missing from installed app
  • Opening the app from “Apps and sales channels” does not trigger scope reauthorization prompt

Current Status:

  • The issue remains unresolved
  • One user suggested creating a new install link or redirect to re-auth, but the original poster is unclear on how to do this
  • At least one other developer reports experiencing the identical problem

The core issue appears to be that updated scopes are not being properly granted or reauthorized when using distribution install links.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hi Shopify Community :waving_hand: ,

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 :folded_hands:

Thanks in advance!

Hi,

Hope this will work

  • Add write_discounts in shopify.app.toml
  • Redeploy app
  • Create a new install link or redirect to re-auth
  • Test mutation again

Hi, How can I create a new installation Link and reauth?

I’m doing the same thing and running into the same error / problem. Did you figure out a solution?