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_ 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.
{ "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 } ]}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
{ "id": "card_1NGTaT2eZvKYlo2CZWSctn5n", "object": "card", "deleted": true}- Need help? Contact Support.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
- Powered by Markdoc