Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: How to automate discount code creation?

Can you automate unique discount code creation after purchase?

Kjankko-US
Shopify Partner
242 4 42
Hi,
 
Is there a possibility to create a Shopify-flow-automation that creates a unique discount code for the client?
 
Example:
 
1. Customer buys product X
2. Flow creates -10% discount code (after buying)
3. With unique metric ie. buyer's name's first 3 letters + discount percent
 
The customer called Mike buys product X -> He receive discount code "MIK10" (sent to Him after buying)
 
Is that possible?
 
(We don't have a Shopify Plus plan)
Replies 7 (7)

Kalen_Jordan
Shopify Partner
779 36 141

Looks like it may not be possible to create discounts in flow. I could build out an automation template for you to do this using our app mesa if you're interested in that?

Kjankko-US
Shopify Partner
242 4 42

Hi @Kalen_Jordan . I asked for that from support also and it's not possible with Shopify Flow.

So does the MESA create the unique discount codes for each order?

Kalen_Jordan
Shopify Partner
779 36 141

tobebuilds
Shopify Partner
476 34 128

Hi Kjankko,

 

Instead of creating a unique discount code per client (which can potentially clutter your backend if you have many), you can use automatic discounts.

 

For example, here's how you can give Mike a 10% discount by combining Shopify Flow with my app, Regios Automatic Discounts:

 

First, create a workflow in Shopify Flow that adds a specific tag (ex. "BoughtProductX") to a customer, if the order line items contain a specific product. Here's a screenshot of a demo workflow:

tobebuilds_0-1697948684569.png

 

Then, in Regios Automatic Discounts, use the "Customers with specific tags" option to give a 10% discount to all customers who have the "BoughtProductX" tag. Here's a screenshot of what it looks like to create a discount based on a tag:

tobebuilds_0-1697949109332.png

 

Once you've turned on your workflow and saved your discount, any customer who buys Product X, will automatically receive a discount on the products you specify.

 

If you don't want to use an app, you can create your own discount using Shopify Functions.

 

If you have any questions, just reply, and I'll be happy to help you out in this thread.

 

Founder, Regios Discounts app (4.9 stars, 68 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
Kjankko-US
Shopify Partner
242 4 42

Hi @tobebuilds & thank you.

This is a good way, but the only problem is that the discount code isn't unique.

The discount code should be i.e: Random digits + first name + random digits:

123-MIKE-456

Do you have a solution for uniqueness? 

tobebuilds
Shopify Partner
476 34 128

Hi,

 

We don't have a solution for uniqueness, as our app doesn't require you to create multiple discount codes.

 

The tag "BoughtProductX" in the example is on the customer's individual profile, so it will only ever apply to accounts you have tagged (whether manually, or via Shopify Flow).

 

That being said, the solution I outlined will result in customers with the "BoughtProductX" tag getting 10% off all future purchases.

 

If you need to limit the number of times a customer can use the discount, then unfortunately that's not possible right now.

 

There are some other apps that can generate discount codes in bulk, though.

Founder, Regios Discounts app (4.9 stars, 68 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
KieranDibor
Excursionist
15 2 4

You could build the flow to remove the tag after the user uses that discount to stop it being used more than once?