# Update a SetupIntent

Updates a SetupIntent object.

## 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. createSetupIntent
POST /v1/setup_intents {"automatic_payment_methods":{"enabled":true}}

## Request

```curl
curl https://api.stripe.com/v1/setup_intents/{{SETUP_INTENT_ID}} \
  -u "<<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2025-06-30.preview" \
  -d "metadata[order_id]"=6735
```

### Response

```json
{
  "id": "seti_1Mm8s8LkdIwHu7ix0OXBfTRG",
  "object": "setup_intent",
  "application": null,
  "cancellation_reason": null,
  "client_secret": "seti_1Mm8s8LkdIwHu7ix0OXBfTRG_secret_NXDICkPqPeiBTAFqWmkbff09lRmSVXe",
  "created": 1678942624,
  "customer": null,
  "description": null,
  "flow_directions": null,
  "last_setup_error": null,
  "latest_attempt": null,
  "livemode": false,
  "mandate": null,
  "metadata": {
    "order_id": "6735"
  },
  "next_action": null,
  "on_behalf_of": null,
  "payment_method": null,
  "payment_method_options": {
    "card": {
      "mandate_options": null,
      "network": null,
      "request_three_d_secure": "automatic"
    }
  },
  "payment_method_types": [
    "card"
  ],
  "single_use_mandate": null,
  "status": "requires_payment_method",
  "usage": "off_session"
}
```

## Returns

Returns a SetupIntent object.

## Parameters

- `attach_to_self` (boolean, optional)
  If present, the SetupIntent’s payment method will be attached to the in-context Stripe Account.

  It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

- `customer` (string, optional)
  ID of the Customer this SetupIntent belongs to, if one exists.

  If present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

- `customer_account` (string, optional)
  ID of the Account this SetupIntent belongs to, if one exists.

  If present, the SetupIntent’s payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent.

- `description` (string, optional)
  An arbitrary string attached to the object. Often useful for displaying to users.

- `flow_directions` (array of enums, optional)
  Indicates the directions of money movement for which this payment method is intended to be used.

  Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
Possible enum values:
  - `inbound`
    Set up an inbound flow

  - `outbound`
    Set up an outbound flow

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

- `payment_method` (string, optional)
  ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. To unset this field to null, pass in an empty string.

- `payment_method_configuration` (string, optional)
  The ID of the [payment method configuration](https://docs.stripe.com/docs/api/payment_method_configurations.md) to use with this SetupIntent.

- [`payment_method_data`](https://docs.stripe.com/api/setup_intents/update.md?query=payment_method_data) (object, optional)
  When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/docs/api/setup_intents/object.md#setup_intent_object-payment_method) value in the SetupIntent.

- [`payment_method_options`](https://docs.stripe.com/api/setup_intents/update.md?query=payment_method_options) (object, optional)
  Payment method-specific configuration for this SetupIntent.

- `payment_method_types` (array of strings, optional)
  The list of payment method types (for example, card) that this SetupIntent can set up. If you don’t provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object.md#payment_method_object-type).
