API reference
Test mode. Use your secret key on your server; live processing is currently disabled.
https://api.knoxapi.comSend form-encoded requests with Authorization: Bearer sk_test_....
Complete OpenAPI specification · Integration guide
Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.
List all SetupIntents
Returns a list of SetupIntents.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
attach_to_self | query | boolean | 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. |
created | query | one of multiple schemas | A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. |
customer | query | string | Only return SetupIntents for the customer specified by this customer ID. |
customer_account | query | string | Only return SetupIntents for the account specified by this customer ID. |
ending_before | query | string | A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. |
expand | query | array of string | Specifies which fields in the response should be expanded. |
limit | query | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
payment_method | query | string | Only return SetupIntents that associate with the specified payment method. |
starting_after | query | string | A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. |
object. See the OpenAPI specification for the complete schema.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
data required | array of setup_intent | |
has_more required | boolean | True if this list has another page of items after this one that can be fetched. |
object required | string | String representing the object's type. Objects of the same type share the same value. Always has the value `list`. |
url required | string | The URL where this list can be accessed. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Create a SetupIntent
Creates a SetupIntent object. After you create the SetupIntent, attach a payment method and confirm it to collect any required permissions to charge the payment method later.
Request parameters
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). |
attach_to_self | boolean | 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 | object | When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. |
confirm | boolean | Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. |
confirmation_token | string | ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. |
customer | string | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | array of string | The list of payment method types to exclude from use with this SetupIntent. |
expand | array of string | Specifies which fields in the response should be expanded. |
flow_directions | array of string | 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. |
mandate_data | one of multiple schemas | This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/setup_intents/create#create_setup_intent-confirm). |
metadata | object | 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`. |
on_behalf_of | string | The Stripe account ID created for this SetupIntent. |
payment_method | string | ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. |
payment_method_configuration | string | The ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent. |
payment_method_data | object | When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. |
payment_method_options | object | Payment method-specific configuration for this SetupIntent. |
payment_method_types | array of string | The list of payment method types (for example, card) that this SetupIntent can use. 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#payment_method_object-type). |
return_url | string | The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/setup_intents/create#create_setup_intent-confirm). |
single_use | object | If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`. |
usage | string | Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. |
use_stripe_sdk | boolean | Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. |
application | one of multiple schemas | ID of the Connect application that created the SetupIntent. |
attach_to_self | boolean | 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 | one of multiple schemas | Settings for dynamic payment methods compatible with this Setup Intent |
cancellation_reason | string | Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. |
client_secret | string | 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 required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
customer | one of multiple schemas | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | array of string | Payment method types that are excluded from this SetupIntent. |
flow_directions | array of string | 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. |
id required | string | Unique identifier for the object. |
last_setup_error | one of multiple schemas | The error encountered in the previous SetupIntent confirmation. |
latest_attempt | one of multiple schemas | The most recent SetupAttempt for this SetupIntent. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | |
mandate | one of multiple schemas | ID of the multi use Mandate generated by the SetupIntent. |
metadata | object | 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. |
next_action | one of multiple schemas | If present, this property tells you what actions you need to take in order for your customer to continue payment setup. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account (if any) for which the setup is intended. |
payment_method | one of multiple schemas | 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#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 | one of multiple schemas | Information about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent. |
payment_method_options | one of multiple schemas | Payment method-specific configuration for this SetupIntent. |
payment_method_types required | array of string | 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#payment_method_object-type). |
single_use_mandate | one of multiple schemas | ID of the single_use Mandate generated by the SetupIntent. |
status required | string | [Status](https://docs.stripe.com/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. |
usage required | 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`. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Retrieve a SetupIntent
Retrieves the details of a SetupIntent that has previously been created. Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the SetupIntent object reference for more details.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
client_secret | query | string | The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent. |
expand | query | array of string | Specifies which fields in the response should be expanded. |
intent | path | string |
object. See the OpenAPI specification for the complete schema.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. |
application | one of multiple schemas | ID of the Connect application that created the SetupIntent. |
attach_to_self | boolean | 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 | one of multiple schemas | Settings for dynamic payment methods compatible with this Setup Intent |
cancellation_reason | string | Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. |
client_secret | string | 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 required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
customer | one of multiple schemas | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | array of string | Payment method types that are excluded from this SetupIntent. |
flow_directions | array of string | 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. |
id required | string | Unique identifier for the object. |
last_setup_error | one of multiple schemas | The error encountered in the previous SetupIntent confirmation. |
latest_attempt | one of multiple schemas | The most recent SetupAttempt for this SetupIntent. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | |
mandate | one of multiple schemas | ID of the multi use Mandate generated by the SetupIntent. |
metadata | object | 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. |
next_action | one of multiple schemas | If present, this property tells you what actions you need to take in order for your customer to continue payment setup. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account (if any) for which the setup is intended. |
payment_method | one of multiple schemas | 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#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 | one of multiple schemas | Information about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent. |
payment_method_options | one of multiple schemas | Payment method-specific configuration for this SetupIntent. |
payment_method_types required | array of string | 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#payment_method_object-type). |
single_use_mandate | one of multiple schemas | ID of the single_use Mandate generated by the SetupIntent. |
status required | string | [Status](https://docs.stripe.com/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. |
usage required | 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`. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Update a SetupIntent
Updates a SetupIntent object.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
intent | path | string |
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | one of multiple schemas | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). |
attach_to_self | boolean | 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 | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | one of multiple schemas | The list of payment method types to exclude from use with this SetupIntent. |
expand | array of string | Specifies which fields in the response should be expanded. |
flow_directions | array of string | 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. |
metadata | one of multiple schemas | 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`. |
payment_method | string | 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 | The ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent. |
payment_method_data | object | When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. |
payment_method_options | object | Payment method-specific configuration for this SetupIntent. |
payment_method_types | array of string | 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#payment_method_object-type). |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. |
application | one of multiple schemas | ID of the Connect application that created the SetupIntent. |
attach_to_self | boolean | 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 | one of multiple schemas | Settings for dynamic payment methods compatible with this Setup Intent |
cancellation_reason | string | Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. |
client_secret | string | 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 required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
customer | one of multiple schemas | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | array of string | Payment method types that are excluded from this SetupIntent. |
flow_directions | array of string | 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. |
id required | string | Unique identifier for the object. |
last_setup_error | one of multiple schemas | The error encountered in the previous SetupIntent confirmation. |
latest_attempt | one of multiple schemas | The most recent SetupAttempt for this SetupIntent. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | |
mandate | one of multiple schemas | ID of the multi use Mandate generated by the SetupIntent. |
metadata | object | 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. |
next_action | one of multiple schemas | If present, this property tells you what actions you need to take in order for your customer to continue payment setup. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account (if any) for which the setup is intended. |
payment_method | one of multiple schemas | 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#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 | one of multiple schemas | Information about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent. |
payment_method_options | one of multiple schemas | Payment method-specific configuration for this SetupIntent. |
payment_method_types required | array of string | 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#payment_method_object-type). |
single_use_mandate | one of multiple schemas | ID of the single_use Mandate generated by the SetupIntent. |
status required | string | [Status](https://docs.stripe.com/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. |
usage required | 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`. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Cancel a SetupIntent
You can cancel a SetupIntent object when it’s in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can’t cancel the SetupIntent for a Checkout Session. Expire the Checkout Session instead.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
intent | path | string |
| Field | Type | Description |
|---|---|---|
cancellation_reason | string | Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate` |
expand | array of string | Specifies which fields in the response should be expanded. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. |
application | one of multiple schemas | ID of the Connect application that created the SetupIntent. |
attach_to_self | boolean | 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 | one of multiple schemas | Settings for dynamic payment methods compatible with this Setup Intent |
cancellation_reason | string | Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. |
client_secret | string | 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 required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
customer | one of multiple schemas | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | array of string | Payment method types that are excluded from this SetupIntent. |
flow_directions | array of string | 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. |
id required | string | Unique identifier for the object. |
last_setup_error | one of multiple schemas | The error encountered in the previous SetupIntent confirmation. |
latest_attempt | one of multiple schemas | The most recent SetupAttempt for this SetupIntent. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | |
mandate | one of multiple schemas | ID of the multi use Mandate generated by the SetupIntent. |
metadata | object | 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. |
next_action | one of multiple schemas | If present, this property tells you what actions you need to take in order for your customer to continue payment setup. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account (if any) for which the setup is intended. |
payment_method | one of multiple schemas | 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#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 | one of multiple schemas | Information about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent. |
payment_method_options | one of multiple schemas | Payment method-specific configuration for this SetupIntent. |
payment_method_types required | array of string | 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#payment_method_object-type). |
single_use_mandate | one of multiple schemas | ID of the single_use Mandate generated by the SetupIntent. |
status required | string | [Status](https://docs.stripe.com/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. |
usage required | 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`. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Confirm a SetupIntent
Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
intent | path | string |
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). |
client_secret | string | The client secret of the SetupIntent. |
confirmation_token | string | ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. |
expand | array of string | Specifies which fields in the response should be expanded. |
mandate_data | one of multiple schemas | |
payment_method | string | ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. |
payment_method_data | object | When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. |
payment_method_options | object | Payment method-specific configuration for this SetupIntent. |
return_url | string | The URL to redirect your customer back to after they authenticate on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. |
use_stripe_sdk | boolean | Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
allowed_payment_method_types | array of string | The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. |
application | one of multiple schemas | ID of the Connect application that created the SetupIntent. |
attach_to_self | boolean | 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 | one of multiple schemas | Settings for dynamic payment methods compatible with this Setup Intent |
cancellation_reason | string | Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. |
client_secret | string | 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 required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
customer | one of multiple schemas | 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 | 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 | An arbitrary string attached to the object. Often useful for displaying to users. |
excluded_payment_method_types | array of string | Payment method types that are excluded from this SetupIntent. |
flow_directions | array of string | 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. |
id required | string | Unique identifier for the object. |
last_setup_error | one of multiple schemas | The error encountered in the previous SetupIntent confirmation. |
latest_attempt | one of multiple schemas | The most recent SetupAttempt for this SetupIntent. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | |
mandate | one of multiple schemas | ID of the multi use Mandate generated by the SetupIntent. |
metadata | object | 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. |
next_action | one of multiple schemas | If present, this property tells you what actions you need to take in order for your customer to continue payment setup. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account (if any) for which the setup is intended. |
payment_method | one of multiple schemas | 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#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 | one of multiple schemas | Information about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent. |
payment_method_options | one of multiple schemas | Payment method-specific configuration for this SetupIntent. |
payment_method_types required | array of string | 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#payment_method_object-type). |
single_use_mandate | one of multiple schemas | ID of the single_use Mandate generated by the SetupIntent. |
status required | string | [Status](https://docs.stripe.com/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. |
usage required | 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`. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |