Skip to content

Shopify tutorials for the person running the store. Orders, discounts, fulfilment, returns.

Limit a discount code to a customer segment in Shopify

A customer segment groups shoppers by a rule, so the list keeps itself up to date. This tutorial limits LOYAL10, worth 10% off, to the Repeat buyers segment, with one use per customer, running 11 to 30 November 2026.

Written · Shopify admin, desktop steps · 4 minutes read

The worked example

CodeLOYAL10
Value10% off the order
EligibilityRepeat buyers segment
Usage limitOne per customer
Active11 to 30 November 2026
$120.00 order$12.00 off, pays $108.00
$55.00 order$5.50 off, pays $49.50

Download the planner: loyal-segment-example-orders.csv (191 bytes).

The worked example orders for members of the Repeat buyers segment. Names are examples; the segment itself decides who is a member.

1Open Discounts and start a new discount

From your Shopify admin, go to Discounts, then click Create discount. From the discount type menu, click Amount off orders. An amount off orders discount applies to the whole order.

2Choose the code method

Under Method, select Discount code. Then enter the code name in the Discount code section, or click Generate code for a random one. This tutorial uses LOYAL10.

3Set the value to 10%

In the Value section, select Percentage and enter 10. The other choice is Fixed amount, a dollar value off instead of a percent. An amount off discount does not apply to shipping costs.

4Pick the segment

In the Eligibility section, select Customer segments, then select the segment you want to assign the discount to and click Add. This tutorial uses the Repeat buyers segment. Only customers in the segment can use the code: a first-time buyer typing LOYAL10 at checkout gets no discount.

5Limit it to one use per customer

In the Maximum discount uses section, check Limit to one per customer. Shopify tracks a customer's email address or phone number to enforce the limit.

6Set the dates

In the Active dates section, set the start date to 11 November 2026 and click Set end date to set the end date to 30 November 2026. If you do not set an end date, the code does not expire. Start and end times follow the time zone set in your Shopify admin.

7Save the code

Click Save. The code appears on the Discounts page and is ready to use. The segment decides membership, so a customer who joins the segment later becomes eligible without any change to the code.

The arithmetic

The discount applies to the order total before tax and shipping.

Order10% offCustomer pays
$120.00$12.00$108.00
$200.00$20.00$180.00
$55.00$5.50$49.50

A customer outside the segment gets no discount at all, whatever the order total. The one-per-customer limit is enforced by email address or phone number.

Held at the counter

The code is only as narrow as the segment. A broad segment, such as everyone who has ever bought, makes the code nearly public. Read the segment's membership before launch: if it covers most of your customers, the code is a store-wide sale in disguise.

The per-customer limit is tracked by email or phone. A customer who used the code once and checks out again as a guest with a different email will not be stopped.

The code still needs an end date. Without one, LOYAL10 runs until you stop it. A segment offer saved without an expiry keeps applying to every member's order.

Sources

  • Amount off discounts — Shopify's help pages: the Eligibility section for customer segments, and the usage-limit rule that tracks email address or phone number.