# The SetupIntent object

### The SetupIntent object

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

## Attributes

- `id` (string)
  Unique identifier for the object.

- `object` (string)
  String representing the object’s type. Objects of the same type share the same value.

- `application` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  ID of the Connect application that created the SetupIntent.

- `attach_to_self` (boolean, nullable)
  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.

- [`automatic_payment_methods`](https://docs.stripe.com/api/setup_intents/object.md?query=automatic_payment_methods) (object, nullable)
  Settings for dynamic payment methods compatible with this Setup Intent

- `cancellation_reason` (enum, nullable)
  Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
Possible enum values:
  - `abandoned`
  - `duplicate`
  - `requested_by_customer`

- `client_secret` (string, nullable)
  The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

  The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

- `created` (timestamp)
  Time at which the object was created. Measured in seconds since the Unix epoch.

- `customer` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  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, nullable)
  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, nullable)
  An arbitrary string attached to the object. Often useful for displaying to users.

- `flow_directions` (array of enums, nullable)
  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`
  - `outbound`

- [`last_setup_error`](https://docs.stripe.com/api/setup_intents/object.md?query=last_setup_error) (object, nullable)
  The error encountered in the previous SetupIntent confirmation.

- `latest_attempt` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  The most recent SetupAttempt for this SetupIntent.

- `livemode` (boolean)
  Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.

- `mandate` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  ID of the multi use Mandate generated by the SetupIntent.

- `metadata` (object, nullable)
  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.

- [`next_action`](https://docs.stripe.com/api/setup_intents/object.md?query=next_action) (object, nullable)
  If present, this property tells you what actions you need to take in order for your customer to continue payment setup.

- `on_behalf_of` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  The account (if any) for which the setup is intended.

- `payment_method` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn’t a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object.md#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead.

- [`payment_method_configuration_details`](https://docs.stripe.com/api/setup_intents/object.md?query=payment_method_configuration_details) (object, nullable)
  Information about the [payment method configuration](https://docs.stripe.com/docs/api/payment_method_configurations.md) used for this Setup Intent.

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

- `payment_method_types` (array of strings)
  The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object.md#payment_method_object-type).

- `single_use_mandate` (string, nullable, expandable (can be expanded into an object with the `expand` request parameter))
  ID of the single_use Mandate generated by the SetupIntent.

- `status` (enum)
  [Status](https://docs.stripe.com/docs/payments/intents.md#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
Possible enum values:
  - `canceled`
  - `processing`
  - `requires_action`
  - `requires_confirmation`
  - `requires_payment_method`
  - `succeeded`

- `usage` (string)
  Indicates how the payment method is intended to be used in the future.

  Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.
