How to exclude specific customer from discount code

Topic summary

Core request: Exclude a specific customer (the code owner) from redeeming a discount/referral code tied to them, so their code works for others but not themselves.

Scenarios raised:

  • Referral program with unique coupons per person (User A’s code usable by anyone except User A; same for User B).
  • Discounts applied via draft orders for troubleshooting; prevent that same customer from reusing the discount on future orders.
  • Friend-invite codes with purchase benefits, ensuring the inviter cannot self-redeem.

Requested guidance:

  • Whether Shopify supports excluding a customer by ID from a discount code.
  • How to implement this via the Shopify API, if possible.

Status: No solutions or official Shopify responses provided in the thread. The question remains open with multiple users requesting confirmation on feasibility and API implementation details.

Summarized with AI on January 9. AI used: gpt-5.

We are running a referral program and will provide a unique referral coupon for each person. So, we want to restrict users to not using their own referral coupons.

E.g: User A’s referral coupon can be used by anyone except User A.

User B’s referral coupon can be used by anyone except User B.

Please suggest how we can achieve this.

Thanks In advance,

3 Likes

I also have the same question. Thanks for any suggestion

1 Like

Same here. When using a discount, e.g. in a draft order because customers have issues on the site and the discount won’t work, I want to prevent that customer from using it again later for new orders. Olaf

I too am interested in knowing if this is possible (exclude customer ID from using a discount code), or how it might be done. We generate discount codes that are used to invite friends with a purchase benefit, but we don’t want the customer that owns one of these discount codes to use it themselves.

Could someone from Shopify let us know:

  • If this is possible

  • How we can do this via the API