Sample - Stripe API
GET/v1/customers/{customer}/sources

List a customer's payment sources

Lists the payment sources attached to a customer. Use object to filter source types and starting_after or ending_before to navigate through the paginated results.

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

6 parameters
customerstringrequired
The customer identifier whose payment sources you want to list.
ending_beforestringoptional
An object ID cursor that marks the end of the previous page when retrieving an earlier page.
expandarray<string>optional
Fields to expand in the response; each value must be no longer than 5000 characters.
limitintegeroptional
The maximum number of sources to return; must be between 1 and 100 and defaults to 10 when omitted.
objectstringoptional
Filters sources by a particular object type.
starting_afterstringoptional
An object ID cursor that marks the end of the current page when retrieving the next page.

2 status codes
200Returns a paginated source list containing source objects, a `has_more` indicator, the list object type, and the list URL.
dataarray<Polymorphic>required
Details about each object.
has_morebooleanrequired
True if this list has another page of items after this one that can be fetched.
objectstringrequired
String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
Allowed:list
urlstringrequired
The URL where this list can be accessed.
defaultError response.
errorobjectrequired

Error handling

customer must be a string no longer than 5000 characters identifying the customer. limit must be between 1 and 100 and defaults to 10 when omitted; each cursor and object value must be supplied as a string.