Pagination question for customer API

Hi,

  1. I need to search for customers (using the exact email). Will I need pagination if I ask the API for one email address only?

I’m thinking: if the store has 10000 customers, but in the API call I ask for a specific email address, will the API return that customer ID if it finds it? or will I need pagination?

  1. In case there is no customer with that email, which error does Square reply with? I’d like to be able to identify that error message to know when to create a customer.

thank you :blush:

It really depends on how your searching for the customer. If your using exact match then it will only return customers with that email profile. If you have it set to fuzzy then it will return customer profiles whose email_address field value has a token-wise partial match against the filtering expression in the query. For example, with Steven gmail provided in a search query, the search returns customers whose email address is [email protected] or [email protected] .

In the case there isn’t any customer profiles we will return a blank { }. The API request will succeed however no response results will be in the body cause there wasn’t any results to return. :slightly_smiling_face:

1 Like