Shopify Discount API: Public vs. Custom Apps - Unlocking Custom Discounts

Understanding Shopify's Discount API and App Types

Hey everyone! So, I was browsing the Shopify Community forums the other day and stumbled upon a really common question about the Discount API and the different types of apps you need to use to make it work. It seems like a lot of merchants are getting tripped up on the "public app" versus "custom app" requirement, especially when they just want to create some unique discounts for their customers.

The original poster, @Eric-HAN, asked a great question: They wanted to customize a discount type but noticed that Shopify Functions (which power the Discount API) seem to require a public app. They were understandably confused about whether they *actually* needed to publish the app to the Shopify App Store. Let's dive into what the community had to say and break it down in plain English.

Public vs. Custom Apps: The Key to Custom Discounts

Here's the crux of the issue, as explained by @oscprofessional. Shopify Functions, including the ones that let you build custom discount logic, run inside Shopify's infrastructure. Because of this, Shopify has stricter security and permission rules. And that's why you can't use Shopify Functions in a custom app.

Think of it this way:

  • Custom App: Can't use Shopify Functions (no custom discount magic!).
  • Public App (even unlisted): *Can* use Shopify Functions (hello, custom discounts!).

Why the restriction?

It all boils down to security. Public apps, even if they're not listed on the app store (more on that in a sec), undergo a different level of scrutiny than custom apps. This ensures that any code running within Shopify's core systems meets their security standards.

Draft Apps and Production Stores: Are They Compatible?

Now, here's where it gets even more interesting. Eric followed up with another excellent question, asking if a public app with a "draft" listing status is okay for a production store. In other words, can you use your custom discount logic in your live store *without* submitting the app for full App Store review?

Good news! @oscprofessional confirmed that a public app with a draft listing status is:

  • Fully valid for production stores
  • Fully supported for Shopify Functions (Discount API)
  • Not required to be submitted for App Store review

So, you can safely use this configuration in your live store!

How to Set Up Your App for Custom Discounts

Okay, so how do you actually *do* this? Here's a step-by-step breakdown based on the community discussion and my own experience:

  1. Create a Public App: In your Shopify Partner Dashboard, create a new app and make sure to select "Public app."
  2. Don't Submit for Review (Yet): You don't need to submit the app for App Store review right away. This keeps the listing status as "draft."
  3. Develop Your Shopify Function: Now, build your custom discount logic using the Discount API and Shopify Functions. This is where the magic happens!
  4. Install on Your Store: Install the app on your development store first for testing. Once you're happy with it, install it on your live store.

Here's a visual that Eric shared in the forum, showing the app settings:

Shopify App Settings

Key Takeaways

Hopefully, this clears up some of the confusion around using the Shopify Discount API! The key things to remember are:

  • You need a public app (even in draft status) to use Shopify Functions and create custom discounts.
  • You don't need to submit your app for App Store review immediately to use it in your production store.

Big thanks to @oscprofessional for providing such clear and helpful answers in the forum. It's awesome to see community members helping each other out!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools