Currently, the query API does not support direct email or phone filtering, even though the default search matches those fields.
In our use case, merchants create customer segments from abandoned checkouts and send personalized emails to those customers. Because of that, a more explicit and reliable way to filter by email or phone should be provided. Otherwise, in rare cases, the default search can return unrelated users.
For example, if the customer’s email is john.doe@tushy.com, searching for john.doe@tushy.co with the default filter can still return AbandonedCheckout objects belonging to john.doe@tushy.com.
Hey @bakikucukcakiroglu,
As you’ve noticed the abandonedCheckouts GraphQL query currently supports a query parameter for general text search, but doesn’t have dedicated email: or phone: filter fields like the customers query does. The available filters are limited to default (general search), created_at, email_state, id, recovery_state, status, and updated_at.
The issue you’re describing with partial matches (e.g. john.doe@tushy.co matching john.doe@tushy.com) is a real problem for use cases like targeted re-engagement emails. The general default search does tokenized matching, so it won’t guarantee exact results.
A couple of workarounds:
- Client-side filtering: Query with the email as the
query string, then filter results in your app by checking the email field on the returned AbandonedCheckout objects for an exact match. Not ideal for performance, but ensures accuracy.
- Go through the customer: If you already have the customer, you can use the
customers query (which does support exact email matching with quoted phrases like email:"john.doe@tushy.com") and then cross-reference with abandoned checkouts via the abandonmentByAbandonedCheckoutId query or the customer’s data.
That said, your request for explicit email/phone filters on abandonedCheckouts is valid. I’ll log this as feedback.
1 Like