Sample - Stripe API
GET/v1/customers/search

Search customers

Searches customers using the customer search query language. Provide query to filter the customer collection, and use page with the returned next_page value to retrieve subsequent result pages. Search results may lag behind recent customer changes and are not suitable for strict read-after-write flows.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 parameters
expandarray<string>optional
Fields to expand in the response.
limitintegeroptional
The number of customers to return. Must range from 1 to 100 and defaults to 10 when omitted.
pagestringoptional
A pagination cursor from a previous response's `next_page` value; omit it on the first request.
querystringrequired
The customer search query written in the supported search query language; maximum 5,000 characters.

2 status codes
200Returns a search result object containing matching customer objects in `data`, a `has_more` flag, a `next_page` cursor, the `search_result` object type, a total count accurate up to 10,000, and the result URL.
dataarray<Customer>required
has_morebooleanrequired
next_pagestringoptional
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:search_result
total_countintegeroptional
The total number of objects that match the query, only accurate up to 10,000.
urlstringrequired
defaultError response.
errorobjectrequired

Error handling

query is required and must be a search query string of no more than 5,000 characters. limit must range from 1 to 100 and defaults to 10 when omitted, while page must be a cursor returned by a previous search response when used.