Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
Parameters
- querystringRequired
The search query string. See search query language and the list of supported query fields for customers.
- limitinteger
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
- pagestring
A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
Returns
A dictionary with a data
property that contains an array of up to limit
customers. If no objects match the query, the resulting array will be empty. See the related guide on expanding properties in lists.
{ "object": "search_result", "url": "/v1/customers/search", "has_more": false, "data": [ { "id": "cus_NeGfPRiPKxeBi1", "object": "customer", "address": null, "balance": 0, "created": 1680569616, "currency": null, "default_source": null, "delinquent": false, "description": null, "email": null, "invoice_prefix": "47D37F8F", "invoice_settings": { "custom_fields": null, "default_payment_method": "pm_1Msy7wLkdIwHu7ixsxmFvcz7", "footer": null, "rendering_options": null }, "livemode": false, "metadata": { "foo": "bar" }, "name": "Jane Doe", "next_invoice_sequence": 1, "phone": null, "preferred_locales": [], "shipping": null, "tax_exempt": "none", "test_clock": null } ]}
A Customer Session allows you to grant Stripe’s frontend SDKs (like Stripe.js) client-side access control over a Customer.
Related guides: Customer Session with the Payment Element, Customer Session with the Pricing Table, Customer Session with the Buy Button.
A dispute occurs when a customer questions your charge with their card issuer. When this happens, you have the opportunity to respond to the dispute with evidence that shows that the charge is legitimate.
Related guide: Disputes and fraud
Snapshot events allow you to track and react to activity in your Stripe integration. When the state of another API resource changes, Stripe creates an Event
object that contains all the relevant information associated with that action, including the affected API resource. For example, a successful payment triggers a charge.
event, which contains the Charge
in the event’s data property. Some actions trigger multiple events. For example, if you create a new subscription for a customer, it triggers both a customer.
event and a charge.
event.
Configure an event destination in your account to listen for events that represent actions your integration needs to respond to. Additionally, you can retrieve an individual event or a list of events from the API.
Connect platforms can also receive event notifications that occur in their connected accounts. These events include an account attribute that identifies the relevant connected account.
You can access events through the Retrieve Event API for 30 days.
Events v2
Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate thin events which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. Retrieve the event object for additional data about the event. Use the related object ID in the event payload to fetch the API resource of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.