Setting up shipping discount function in production Shopify store

I built a Shopify app that handles shipping discounts and got it working on my development environment. The guide I followed showed me how to test everything using the GraphQL endpoint that shows up when running the dev command locally.

Now I’m stuck trying to get this working on my actual store. When I go to the Discounts section in my admin panel and try to create a new discount using my app’s type, it just redirects me back to my app’s main page.

What’s the proper way to set up discounts in a production environment? Do I need to build some kind of interface in my app for creating discounts? Or should I still be using GraphQL somehow? If so, how do I access the GraphQL interface for my live store?

I’ve already installed my app on the store, but I can’t figure out how to actually configure the discount settings. The admin interface doesn’t seem to work the same way as it did during development.

You’re encountering this issue because production apps operate differently than development environments. In production, there’s no GraphQL playground available, which means you’ll need to create your own interface for handling shipping discounts. Specifically, you’ll want to develop an admin interface that can gather the necessary discount settings, such as minimum order amounts and discount percentages, and then use the Admin API to create the discounts. Avoid relying on Shopify’s admin interface; instead, implement the entire process using GraphQL mutations from your backend. When I faced a similar challenge with my first discount app, I resolved it by building a form that collected discount settings and executed a discountAutomaticAppCreate mutation against Shopify’s API. Just ensure that you have the appropriate scopes for managing discounts and are properly handling webhook responses. That redirect you’re experiencing is expected behavior, as Shopify intends for your app to manage the discount setup, not their admin panel.