Can you automate unique discount code creation after purchase?

Topic summary

A user asks whether Shopify Flow can automatically generate unique discount codes after a customer purchases a specific product. The desired format would include the buyer’s name plus random characters (e.g., “123-MIKE-456”).

Key Findings:

  • Shopify Flow limitation: Native Flow cannot create discount codes directly.
  • Third-party solutions offered:
    • Mesa app: Can create unique discount codes per order using automation templates. A specific template link is provided for generating codes tied to new customer orders.
    • Regios Automatic Discounts app: Suggests using customer tags (e.g., “BoughtProductX”) combined with Flow to trigger automatic discounts. However, this approach does not generate unique codes—it applies a blanket discount to tagged customers.

Trade-offs:

  • Unique codes provide one-time use control but may clutter the backend.
  • Tag-based automatic discounts are simpler but lack uniqueness and usage limits (customers receive the discount on all future purchases unless the tag is removed).
  • One participant suggests removing tags after first use to prevent repeated discounting.

Status: The conversation remains open, with the original poster seeking true code uniqueness, which the automatic discount solution does not fully address.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

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:

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:

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.