Send Discount Codes to New Shopify Customers for Repeat Sales

Create Unique Discount Codes for New Shopify Customers

13 min setup
No coding required
Runs automatically

Build customer loyalty and boost repeat sales with automated discount codes for new Shopify customers. This MESA workflow generates a unique 20% off code for first-time buyers and sends it via SMS, valid for 14 days. Welcoming new customers with a tailored incentive helps boost conversions and keeps them coming back to your store.

How it works

8 steps to send unique discount codes to new Shopify customers automatically

Customer Created

App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)

Why this matters: This trigger captures new customer signups the moment accounts are created, enabling immediate discount delivery that capitalizes on peak engagement and conversion intent.

When a customer is created in Shopify (through account signup, first purchase checkout, admin creation, or API), this trigger activates the workflow and captures customer data including customer ID, phone number, email, and name.

Create Price Rule

App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 3 minutes

Why this matters: Establishes the discount parameters and customer-specific restrictions that ensure each code is unique, single-use, and valid only for the intended recipient.

This step creates a Shopify price rule with configurable parameters.

Configuration: You must set three key values during setup:

  1. Discount value: Default is -20. Enter as negative number for discounts.
  2. Value type: Choose "percentage" or "fixed_amount" to define discount type.
  3. Expiration: Default is 14 days from creation.

The price rule includes:

  1. title: Formatted as "NEWCUSTOMER [customer_id] [timestamp]" for tracking
  2. allocation_method: "across"
  3. target_type: "line_item"
  4. customer_selection: "prerequisite"
  5. prerequisite_customer_ids: Contains the new customer's ID
  6. once_per_customer: "true"
  7. starts_at: Effective immediately
  8. prerequisite_subtotal_range: Minimum cart value of $1.00

Retrieve Price Rule

App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)

Why this matters: Fetches the complete price rule details after creation to ensure all parameters were set correctly before generating the discount code.

Create Price Rule Discount Code

App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 2 minutes

Why this matters: Generates the actual customer-facing discount code that combines uniqueness with memorability.

Customer Add Tag

App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)

Why this matters: Tags the customer profile with their unique discount code, creating an easily searchable reference for customer service.

Retrieve Shop

App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)

Why this matters: Fetches your store name to personalize the SMS message.

Filter (Phone Number Check)

App connector: [Filter](/content/apps/filter/integrate "View Filter integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)

Why this matters: Acts as a safety check that only allows SMS sending when customers provided phone numbers during signup.

Send Message

App connector: [SMS](/content/apps/sms/integrate "View SMS integration page"/index.html)• Time to complete: 3 minutes

Why this matters: Delivers the unique discount code directly to the customer's phone with clear instructions.

Frequently asked questions

What happens if a customer signs up without a phone number?

The discount code is still created and tagged to their customer profile, but no SMS is sent.

Can customers share these codes with others?

No, the price rule is restricted to the specific customer ID.

How do I change the discount from 20% to a fixed dollar amount?

In the "Create Price Rule" step, change the value field from -20 to your desired dollar amount.