When you create a new credit card, you must specify a customer or recipient on which to create it.

If the card’s owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should update the customer to have a new default_source.

post/v1/customers/{customer}/cards

Request

  • Base URL: https://api.stripe.com
  • URL: https://api.stripe.com/v1/customers/{customer}/cards
  • Auth: one of:
    • HTTP basic
    • HTTP bearer

Path parameters

customerstring required

Request body application/x-www-form-urlencoded

alipay_accountstring

A token returned by Stripe.js representing the user’s Alipay account details.

expandstring[]

Specifies which fields in the response should be expanded.

metadataobject

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

sourcestring

Please refer to full documentation instead.

Response

Successful response.

OR
OR
OR

Changes

    • warning

      added the new final_payment_failure enum value to the ///////////// response property for the response status

    • warning

      added the new final_payment_failure enum value to the ///////// response property for the response status

    • warning

      added the new first_payment_failure enum value to the ///////////// response property for the response status

    • warning

      added the new first_payment_failure enum value to the ///////// response property for the response status

    • info

      added the optional property ////////// to the response with the status

    • info

      added the optional property ////// to the response with the status

Some revisions have not been checked yet.