Update a PaymentMethod ​
Updates a PaymentMethod object. A PaymentMethod must be attached to a customer to be updated.
Returns ​
Returns a PaymentMethod object.
Parameters ​
allow_redisplay(enum, optional) This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults tounspecified. Possible enum values:alwaysUsealwaysto indicate that this payment method can always be shown to a customer in a checkout flow.limitedUselimitedto indicate that this payment method can’t always be shown to a customer in a checkout flow. For example, it can only be shown in the context of a specific subscription.unspecifiedThis is the default value for payment methods whereallow_redisplaywasn’t set.
billing_details(object, optional) Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.billing_details.address(object, optional) Billing address.billing_details.address.city(string, optional) City, district, suburb, town, or village.billing_details.address.country(string, optional) Two-letter country code (ISO 3166-1 alpha-2).billing_details.address.line1(string, optional) Address line 1, such as the street, PO Box, or company name.billing_details.address.line2(string, optional) Address line 2, such as the apartment, suite, unit, or building.billing_details.address.postal_code(string, optional) ZIP or postal code.billing_details.address.state(string, optional) State, county, province, or region (ISO 3166-2).
billing_details.email(string, optional) Email address.The maximum length is 800 characters.
billing_details.name(string, optional) Full name.billing_details.phone(string, optional) Billing phone number (including extension).billing_details.tax_id(string, optional) Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
card(object, optional) If this is acardPaymentMethod, this hash contains the user’s card details.card.exp_month(integer, optional) Two-digit number representing the card’s expiration month.card.exp_year(integer, optional) Four-digit number representing the card’s expiration year.card.networks(object, optional) Contains information about card networks used to process the payment.card.networks.preferred(enum, optional) The customer’s preferred card network for co-branded cards. Supportscartes_bancaires,mastercard, orvisa. Selection of a network that does not apply to the card will be stored asinvalid_preferenceon the card.
metadata(object, optional) 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 tometadata.payto(object, optional) If this is apaytoPaymentMethod, this hash contains details about the PayTo payment method.payto.account_number(string, optional) The account number for the bank account.payto.bsb_number(string, optional) Bank-State-Branch number of the bank account.payto.pay_id(string, optional) The PayID alias for the bank account.
us_bank_account(object, optional) If this is anus_bank_accountPaymentMethod, this hash contains details about the US bank account payment method.us_bank_account.account_holder_type(enum, optional) Bank account holder type. Possible enum values:companyAccount belongs to a companyindividualAccount belongs to an individual
us_bank_account.account_type(enum, optional) Bank account type. Possible enum values:checkingBank account type is checkingsavingsBank account type is savings
curl
curl https://api.stripe.com/v1/payment_methods/{{PAYMENT_METHOD_ID}} \
-u "<<YOUR_SECRET_KEY>>" \
-d "metadata[order_id]=6735"Response ​
json
{
"id": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"object": "payment_method",
"allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": "John Doe",
"phone": null
},
"created": 1726673582,
"customer": null,
"livemode": false,
"metadata": {
"order_id": "6735"
},
"type": "us_bank_account",
"us_bank_account": {
"account_holder_type": "individual",
"account_type": "checking",
"bank_name": "STRIPE TEST BANK",
"financial_connections_account": null,
"fingerprint": "LstWJFsCK7P349Bg",
"last4": "6789",
"networks": {
"preferred": "ach",
"supported": [
"ach"
]
},
"routing_number": "110000000",
"status_details": {}
}
}