OAuth error: invalid_scope when setting up Price Rules for Shopify app

Hi everyone,

I’m currently developing an app using Shopify’s API and facing an issue when attempting to generate discount codes via OAuth. Here’s the setup and error I’m encountering:

Background

  1. App Setup: I created the app directly through the Shopify Partner Dashboard, under Apps, and selected a development store for testing.
  2. App Installation: Installed the app on the dev store and successfully obtained the API Key and API Secret.
  3. OAuth Setup: I’m following Shopify’s OAuth process to request an access token with the write_discount_codes scope so I can create price rules and discount codes.

Issue

When I initiate the OAuth flow, I receive this error:

OAuth error invalid_scope: The access scope is invalid: write_discount_codes

Details

  • Store Plan: I’m using a development store, not a Shopify Plus or paid version.
  • Scope Configuration: I couldn’t find any options to configure the scopes directly in the Partner Dashboard for my app.
  • OAuth Scopes in Request: The request URL includes the write_discount_codes scope, which I believe is needed for managing discounts.

Questions

  1. Is the write_discount_codes scope available only on Shopify Plus or paid stores?
  2. How can I configure or verify the scopes for a Partner Dashboard-created app?
  3. Any recommendations on how to test discount code generation functionality in a development store setup?

Any guidance on resolving this would be greatly appreciated! Thank you!

Hi Ninja,

I think it should be write_discounts and not write_discount_codes. There doesn’t seem to be a write_discount_codes scope which is likely why you’re seeing this error.