Discount code validation by phone number instead of email (first purchase only)

Topic summary

Goal: enforce one-time “first purchase” discounts by phone number (or phone+email) to prevent abuse via new emails.

Key facts:

  • Shopify natively tracks one-time discount usage by customer/email only. Phone-based or combined email+phone validation is not supported.
  • Shopify Flow (automation tool) is limited for this use case; it can tag or block customers but often fails when the customer record isn’t created yet at checkout.
  • Workarounds: use third-party apps that add extra validation at checkout, or—on Shopify Plus (enterprise tier)—implement custom discount logic to more strictly verify customer data.

Status/outcome:

  • No native Shopify solution for phone-based validation. Email-based validation remains the only reliable built-in option.
  • Practical next steps: evaluate checkout validation apps or consider Shopify Plus for custom logic. Discussion effectively resolved with guidance.
Summarized with AI on January 25. AI used: gpt-5.

We created a discount code for first-time purchases with a limit of one use per customer. However, Shopify validates discount usage mainly by email, which can be easily misused by creating new email addresses.

Is there any way to validate discount usage by phone number, or email + phone number, or even phone number only? We tried implementing this with Shopify Flow but encountered errors. Are there any native Shopify options, apps, or recommended workarounds for this? Thanks.

1 Like

Hey @biblionepal

There’s no native way to validate by phone number or a combination of email and phone number at the point of discount application.

Shopify Flow alone can’t prevent the discount from being applied in real-time at checkout based on a phone number because it triggers after the order is created or updated. You could use Flow to detect duplicate phone numbers (if collected in the checkout form) on new orders and then tag them for manual review, or even automatically cancel/refund, but that’s a post-purchase reaction, not a pre-purchase prevention.

For real-time validation at checkout, you’d typically need a custom solution, especially if you’re on Shopify Plus. A checkout UI extension could be built to capture the phone number, query your customer database (or an external service) for previous usage associated with that number, and then dynamically prevent the discount from applying or even hide the discount field if the number is deemed ineligible.

Without Plus, your options are more limited. You might find a third-party app that specializes in advanced discount validation or fraud prevention, but they often work by adding an extra step to the checkout process or by integrating with customer accounts. Most apps that manage discounts are still bound by Shopify’s core discount logic at checkout.

P.S. I’m building a gamified discount app called Game Gophers. Looking for beta testers if you’re interested.

1 Like

If you want to do a phone-based lookup on a discount code, it could get pretty complex. In theory, you can use the Shopify Functions API to create a discount code based on customer.numberOfOrders that also uses network access to search your existing customer base for the phone number before granting/denying access to the discount. Network access in Functions can only be used in custom apps, though, and you have to be on Shopify Plus.