Retrieving sources
Learn how to retrieve a single Source as well as all the Source objects attached to a Customer.
Last updated
Learn how to retrieve a single Source as well as all the Source objects attached to a Customer.
Last updated
The following request retrieves a source by supplying its unique identifier as a path parameter.
The response returns a if a valid identifier and API key are provided in the request. The following sample response shows a Source in a .
Only the last four digits of credit card numbers are returned by a GET
Source request.
The following GET /customers/{id}
request supplies the identifier as a path parameter:
The data contained in the sources
array can display a customer's saved payment methods on your website or app. To do this, parse the response and extract the values in the creditCard
, owner
, and address
hash tables. You can then use these values to present the card's brand name, last four digits, expiration date, and the customer's billing information.
You can retrieve the associated with a Customer by making a request and then parsing the sources
array contained in the response.
In the response, each element of the sources
array consists of a attached to the Customer. In this particular response, the array contains two elements, which means the customer has two saved payment methods, both and .