Sample - Stripe API
POST/v1/payment_methods/{payment_method}

Update a PaymentMethod

Updates an existing PaymentMethod that is attached to a customer. Supply only the PaymentMethod properties you want to change, such as billing_details, metadata, or type-specific details. Use allow_redisplay to control whether the method can be shown again in a customer checkout flow.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 7 body fields
payment_methodstringrequired
The unique identifier of the attached PaymentMethod to update. Maximum 5000 characters.

Fields used to update an attached PaymentMethod and control its future redisplay behavior.

allow_redisplaystringoptional
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 to `unspecified`.
Allowed:alwayslimitedunspecified
billing_detailsobjectoptional
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
cardobjectoptional
If this is a `card` PaymentMethod, this hash contains the user's card details.
expandarray<string>optional
Specifies which fields in the response should be expanded.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) 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`.
paytoobjectoptional
If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
us_bank_accountobjectoptional
If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.

2 status codes
200Returns the updated PaymentMethod, including its billing details, type-specific payment details, redisplay setting, and metadata.
acss_debitobjectoptional
affirmobjectoptional
afterpay_clearpayobjectoptional
alipayobjectoptional
allow_redisplaystringoptional
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 to “unspecified”.
Allowed:alwayslimitedunspecified
almaobjectoptional
amazon_payobjectoptional
au_becs_debitobjectoptional
bacs_debitobjectoptional
bancontactobjectoptional
billieobjectoptional
billing_detailsobjectrequired
bizumobjectoptional
blikobjectoptional
boletoobjectoptional
cardobjectoptional
card_presentobjectoptional
cashappobjectoptional
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
cryptoobjectoptional
customobjectoptional
customerstringoptional
The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
customer_accountstringoptional
customer_balanceobjectoptional
epsobjectoptional
fpxobjectoptional
giropayobjectoptional
grabpayobjectoptional
idstringrequired
Unique identifier for the object.
idealobjectoptional
interac_presentobjectoptional
kakao_payobjectoptional
klarnaobjectoptional
konbiniobjectoptional
kr_cardobjectoptional
linkobjectoptional
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
mb_wayobjectoptional
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
mobilepayobjectoptional
multibancoobjectoptional
naver_payobjectoptional
nz_bank_accountobjectoptional
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:payment_method
oxxoobjectoptional
p24objectoptional
pay_by_bankobjectoptional
paycoobjectoptional
paynowobjectoptional
paypalobjectoptional
paytoobjectoptional
pixobjectoptional
promptpayobjectoptional
radar_optionsobjectoptional
Options to configure Radar. See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information.
revolut_payobjectoptional
samsung_payobjectoptional
satispayobjectoptional
scalapayobjectoptional
sepa_debitobjectoptional
sofortobjectoptional
sunbitobjectoptional
swishobjectoptional
twintobjectoptional
typestringrequired
The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
Allowed:acss_debitaffirmafterpay_clearpayalipayalmaamazon_payau_becs_debitbacs_debitbancontactbilliebizumblik
upiobjectoptional
us_bank_accountobjectoptional
wechat_payobjectoptional
zipobjectoptional
defaultError response.
errorobjectrequired

Error handling

payment_method must identify an attached PaymentMethod and must not exceed 5000 characters. allow_redisplay must be one of always, limited, or unspecified, and us_bank_account.account_holder_type and account_type must use one of their defined values.