Update a PaymentMethod 

Payment Methods
Payment Methods
Update a PaymentMethod

Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.

Parameters

  • billing_detailsobject

    Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

    • billing_details.addressobject

      Billing address.

      • billing_details.address.citystring

        City, district, suburb, town, or village.

      • billing_details.address.countrystring

        Two-letter country code (ISO 3166-1 alpha-2).

      • billing_details.address.line1string

        Address line 1 (e.g., street, PO Box, or company name).

      • billing_details.address.line2string

        Address line 2 (e.g., apartment, suite, unit, or building).

      • billing_details.address.postal_codestring

        ZIP or postal code.

      • billing_details.address.statestring

        State, county, province, or region.

    • billing_details.emailstring

      Email address.

    • billing_details.namestring

      Full name.

    • billing_details.phonestring

      Billing phone number (including extension).

  • 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.

More parameters

  • allow_redisplayenum

    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.

    Possible enum values
    always

    Use always to indicate that this payment method can always be shown to a customer in a checkout flow.

    limited

    Use limited to 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.

    unspecified

    This is the default value for payment methods where allow_redisplay wasn’t set.

  • cardobject

    If this is a card PaymentMethod, this hash contains the user’s card details.

    • card.exp_monthinteger

      Two-digit number representing the card’s expiration month.

    • card.exp_yearinteger

      Four-digit number representing the card’s expiration year.

    • card.networksobject

      Contains information about card networks used to process the payment.

      • card.networks.preferredenum

        The customer’s preferred card network for co-branded cards. Supports cartes_bancaires, mastercard, or visa. Selection of a network that does not apply to the card will be stored as invalid_preference on the card.

  • linkobject

    If this is an Link PaymentMethod, this hash contains details about the Link payment method.

  • naver_payobject

    If this is a naver_pay PaymentMethod, this hash contains details about the Naver Pay payment method.

    • naver_pay.fundingenum

      Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to card.

      Possible enum values
      card

      Use a card to fund this transaction.

      points

      Use Naver Pay points to fund this transaction.

  • us_bank_accountobject

    If this is an us_bank_account PaymentMethod, this hash contains details about the US bank account payment method.

    • us_bank_account.account_holder_typeenum

      Bank account holder type.

      Possible enum values
      company

      Account belongs to a company

      individual

      Account belongs to an individual

    • us_bank_account.account_typeenum

      Bank account type.

      Possible enum values
      checking

      Bank account type is checking

      savings

      Bank account type is savings

Returns

Returns a PaymentMethod object.

POST /v1/payment_methods/:id
curl https://api.stripe.com/v1/payment_methods/pm_1Q0PsIJvEtkwdCNYMSaVuRz6 \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d "metadata[order_id]"=6735
Response
{
"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": {}
}
}