# Update a PaymentMethod

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

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. createPaymentMethod
POST /v1/payment_methods {"type":"us_bank_account","us_bank_account":{"account_holder_type":"individual","account_number":"000123456789","routing_number":"110000000"},"billing_details":{"name":"John Doe"}}

## Request

```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": {}
  }
}
```

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

- [`billing_details`](https://docs.stripe.com/api/payment_methods/update.md?query=billing_details) (object, optional)
  Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

- [`card`](https://docs.stripe.com/api/payment_methods/update.md?query=card) (object, optional)
  If this is a `card` PaymentMethod, this hash contains the user’s card details.

- `metadata` (map, optional)
  Set of [key-value pairs](https://docs.stripe.com/api/metadata.md) 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`.

- [`payto`](https://docs.stripe.com/api/payment_methods/update.md?query=payto) (object, optional)
  If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.

- [`us_bank_account`](https://docs.stripe.com/api/payment_methods/update.md?query=us_bank_account) (object, optional)
  If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
