Sample - Stripe API
GET/v1/charges/search

Search charges

Searches previously created charges using the charge Search Query Language. Supply query to define the search and use limit and page to retrieve additional result pages. Search results may lag behind recent charge changes.

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

4 parameters
expandarray<string>optional
Fields to expand in the response.
limitintegeroptional
The number of charges to return, from 1 to 100. Defaults to 10 when omitted.
pagestringoptional
A pagination cursor from a previous response. Omit it on the first request.
querystringrequired
The charge search query using the supported Search Query Language. Maximum 5,000 characters.

2 status codes
200Returns a search result containing matching Charge objects, pagination state, the result URL, and an approximate total count.
dataarray<Charge>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
defaultReturns an error object when the search request cannot be processed.
errorobjectrequired

Error handling

query is required and must be no longer than 5,000 characters. limit must be between 1 and 100 when provided, and page must be a cursor returned by a previous search response.