Applies to: Cards API
Learn how to use the Cards API to retrieve a stored card, list the cards on file for a customer, and disable a card.
The Cards API
Note
For information about how to save cards on file using the CreateCard
endpoint, see How the API works
To get information about a card on file, call RetrieveCard
Retrieve card
To get a customer's cards on file, call ListCards
The following example request uses the customer_id
query parameter to get the cards on file for a specified customer. The access token you provide in the request identifies the Square account where the cards are stored.
List cards
By default, only enabled cards are returned in the response. To also retrieve disabled cards, include the is_disabled
query parameter in the request.
The response returns up to 25 cards. If there are more cards to retrieve, the response includes a cursor. Use this cursor in the cursor
field of your next ListCards
request to retrieve the next page of results.
To disable a card on file, call DisableCard
Disable card
After a card is disabled, new CreatePayment
By default, only enabled cards are returned in a ListCards
response. To also retrieve disabled cards, include the is_disabled
query parameter in the request.