# Search for Customers With Phone Numbers

**URL:** <https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432>\
**Category:** Questions\
**Created:** [July 30, 2025, 4:07pm UTC](https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432 "2025-07-30T16:07:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanW](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DanW](https://developer.squareup.com/forums/u/DanW)\
**Post date:** [July 30, 2025, 4:07pm UTC](https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432/1 "2025-07-30T16:07:14Z")

</div>

I’m trying to put something together that will enroll any customer in the directory with a phone number into the loyalty program. Unfortunately, the customer sign-up page that collects e-mail and phone doesn’t automatically enroll into loyalty.

So, I need to build a query that gets all the users that are:

1. Not a member of our loyalty program
2. Have a phone number

Once I have that I can use another function to enroll them into loyalty. Then I can figure out how to run that every 5 minutes. Seems bizarre I’d have to do this but it is what it is.

But with Search Customers I can do an exact or fuzzy match but no way to get anyone WITHOUT a phone number.

Am I missing something?

Thanks

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 30, 2025, 4:07pm UTC](https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432/2 "2025-07-30T16:07:26Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Enroll a Buyer in a Loyalty Program (Walkthrough 1)](https://developer.squareup.com/docs/loyalty-api/walkthrough1/enroll-buyer)**
>
> To enroll a buyer in a loyalty program, you create a loyalty account and provide the program ID and buyer's phone number.

> **[Enroll a Buyer in a Loyalty Program (Walkthrough 2)](https://developer.squareup.com/docs/loyalty-api/walkthrough2-enroll-buyer)**
>
> Enroll a buyer in the Square loyalty program as part of the Loyalty Walkthrough 2.

> **Additional Documentation**
>
> [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts)  
> [Set up a Loyalty Program (Walkthrough 1)](https://developer.squareup.com/docs/loyalty-api/walkthrough1/setup-loyalty-program)  
> [Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 30, 2025, 4:31pm UTC](https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432/3 "2025-07-30T16:31:37Z")

</div>

The `SearchCustomers` endpoint will has a time range filter that you can use to pull in customer profiles. Then you can parse the results for profiles with phone numbers and from there determine whether or not you’ll enroll them in the loyalty program. 🙂

---

<div class="post-metadata">

**Author:** ![DanW](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DanW](https://developer.squareup.com/forums/u/DanW)\
**Post date:** [July 30, 2025, 4:42pm UTC](https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432/4 "2025-07-30T16:42:35Z")

</div>

Thanks, Bryan - guess that makes sense. Get all the data, then pare it down on my end. I’m right on the edge of knowing what I’m doing with curl and json so was hoping to keep it as simple as possible but that will probably work.

Unless you can think of some other way to accomplish my high level goal of collecting an email and a phone number and automatically enrolling them into the loyalty program. I feel like I’m swimming upstream to do something simple here.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 30, 2025, 5:06pm UTC](https://developer.squareup.com/forums/t/search-for-customers-with-phone-numbers/23432/5 "2025-07-30T17:06:35Z")

</div>

At this time this is the best way to go about this with the data you have. Will you also be collecting the customer information? 🙂
