Manage Customer Cards on File

Applies to: Cards API | Payments API

Learn how to use the Cards API to retrieve a credit card, list the cards saved for a customer, and discard a card.

Link to section

Overview

The Cards API provides a set of endpoints for you to manage cards on file. You can retrieve card information using the RetrieveCard endpoint, list cards on file using the ListCards endpoint, and disable a card using the DisableCard endpoint.

Link to section

Get a card

If your application has a card ID, it calls the RetrieveCard endpoint to get information about the associated card.

Retrieve card

The Cards API returns a response like the following example:

Link to section

List cards saved for a customer

Call the ListCards endpoint to get a paginated list of information about the cards on file for the Square account associated with the access token provided in the request.

Your application can get all saved cards in a seller account or limit the response to cards for a customer, the state of a card, or both. Regardless of whether you filter by a customer ID, you can set a page size for the response pages.

The following request lists all the enabled cards for a given customer:

List cards

The Cards API returns a response like the following example:

Link to section

Disable a card

If your application has a card ID, it calls the DisableCard endpoint to disable a card on file. After a card is disabled, any request to the CreatePayment endpoint that references the disabled card returns an error.

Disable card

The Cards API returns a response like the following example:

Link to section

See also