The documentation shows how to search for a specific email - how can we return all customers that have an email, but not customers without an email?
With SearchCustomers you can query for the exact
match of a customers email which will only return customer profiles with the email you passed in.
{
"query": {
"filter": {
"email_address": {
"exact": "{{[email protected]}}"
}
}
}
}
@numberforty1 sorry for miss understanding the question. To query for all customer profiles that have an email you can use the following:
"query": {
"filter": {
"email_address": {
"fuzzy": ""
}
}
}
@Bryan-Square Thank you, is there a way to query only for customers that have either an email OR a phone number?
@Bryan-Square unfortunately this seems incorrect, below still returns customers without email an address:
@numberforty1 Apologies for the confusion. You’re right and we don’t have a way to filter for customers who have any email (or phone). I had passed along the snippet to @Bryan-Square before extensive testing.
I’m the PM for Customers API, and we’ll add this request to the backlog.