Retrieve a card 

You can always see the 10 most recent cards directly on a customer; this method lets you retrieve details about a specific card stored on the customer.

Parameters

No parameters.

Returns

Returns the Card object.

GET /v1/customers/:id/cards/:id
cURL
curl https://api.stripe.com/v1/customers/cus_NhD8HD2bY8dP3V/cards/card_1MvoiELkdIwHu7ixOeFGbN9D \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:"
Response
{
"id": "card_1MvoiELkdIwHu7ixOeFGbN9D",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_NhD8HD2bY8dP3V",
"cvc_check": null,
"dynamic_last4": null,
"exp_month": 4,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"last4": "4242",
"metadata": {},
"name": null,
"tokenization_method": null,
"wallet": null
}

List all cards 

You can see a list of the cards belonging to a customer. Note that the 10 most recent sources are always available on the Customer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional cards.

Parameters

No parameters.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

Returns a list of the cards stored on the customer.

GET /v1/customers/:id/cards
cURL
curl -G https://api.stripe.com/v1/customers/cus_NhD8HD2bY8dP3V/cards \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d limit=3
Response
{
"object": "list",
"url": "/v1/customers/cus_NhD8HD2bY8dP3V/cards",
"has_more": false,
"data": [
{
"id": "card_1MvoiELkdIwHu7ixOeFGbN9D",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_NhD8HD2bY8dP3V",
"cvc_check": null,
"dynamic_last4": null,
"exp_month": 4,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"last4": "4242",
"metadata": {},
"name": null,
"tokenization_method": null,
"wallet": null
}
]
}

Delete a card 

You can delete cards from a customer. If you delete a card that is currently the default source, then the most recently added source will become the new default. If you delete a card that is the last remaining source on the customer, then the default_source attribute will become null.

For recipients: if you delete the default card, then the most recently added card will become the new default. If you delete the last remaining card on a recipient, then the default_card attribute will become null.

Note that for cards belonging to customers, you might want to prevent customers on paid subscriptions from deleting all cards on file, so that there is at least one default card for the next invoice payment attempt.

Parameters

No parameters.

Returns

DELETE /v1/customers/:id/sources/:id
curl -X DELETE https://api.stripe.com/v1/customers/acct_1032D82eZvKYlo2C/sources/card_1NGTaT2eZvKYlo2CZWSctn5n \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:"
Response
{
"id": "card_1NGTaT2eZvKYlo2CZWSctn5n",
"object": "card",
"deleted": true
}

Sources Deprecated

Source objects allow you to accept a variety of payment methods. They represent a customer’s payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe doesn’t recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

Related guides: Sources API and Sources & Customers.

Products 

Products describe the specific goods or services you offer to your customers. For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. They can be used in conjunction with Prices to configure pricing in Payment Links, Checkout, and Subscriptions.

Related guides: Set up a subscription, share a Payment Link, accept payments with Checkout, and more about Products and Prices