Knox Docs Sign in

API reference

Test mode. Use your secret key on your server; live processing is currently disabled.

https://api.knoxapi.com

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

GET /v1/setup_intents

List all SetupIntents

Returns a list of SetupIntents.

Request parameters

ParameterLocationTypeDescription
attach_to_selfquerybooleanIf 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.
createdqueryone of multiple schemasA 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.
customerquerystringOnly return SetupIntents for the customer specified by this customer ID.
customer_accountquerystringOnly return SetupIntents for the account specified by this customer ID.
ending_beforequerystringA 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.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
payment_methodquerystringOnly return SetupIntents that associate with the specified payment method.
starting_afterquerystringA 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.
FieldTypeDescription
data requiredarray of setup_intent
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/setup_intents

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

FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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_selfbooleanIf 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_methodsobjectWhen you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
confirmbooleanSet 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_tokenstringID 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.
customerstringID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesarray of stringThe list of payment method types to exclude from use with this SetupIntent.
expandarray of stringSpecifies which fields in the response should be expanded.
flow_directionsarray of stringIndicates 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_dataone of multiple schemasThis 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).
metadataobjectSet 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_ofstringThe Stripe account ID created for this SetupIntent.
payment_methodstringID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
payment_method_configurationstringThe ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent.
payment_method_dataobjectWhen 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_optionsobjectPayment method-specific configuration for this SetupIntent.
payment_method_typesarray of stringThe 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_urlstringThe 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_useobjectIf 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`.
usagestringIndicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`.
use_stripe_sdkbooleanSet 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.
FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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.
applicationone of multiple schemasID of the Connect application that created the SetupIntent.
attach_to_selfbooleanIf 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_methodsone of multiple schemasSettings for dynamic payment methods compatible with this Setup Intent
cancellation_reasonstringReason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
client_secretstringThe 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 requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesarray of stringPayment method types that are excluded from this SetupIntent.
flow_directionsarray of stringIndicates 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 requiredstringUnique identifier for the object.
last_setup_errorone of multiple schemasThe error encountered in the previous SetupIntent confirmation.
latest_attemptone of multiple schemasThe most recent SetupAttempt for this SetupIntent.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemas
mandateone of multiple schemasID of the multi use Mandate generated by the SetupIntent.
metadataobjectSet 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_actionone of multiple schemasIf present, this property tells you what actions you need to take in order for your customer to continue payment setup.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) for which the setup is intended.
payment_methodone of multiple schemasID 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_detailsone of multiple schemasInformation about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent.
payment_method_optionsone of multiple schemasPayment method-specific configuration for this SetupIntent.
payment_method_types requiredarray of stringThe 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_mandateone of multiple schemasID of the single_use Mandate generated by the SetupIntent.
status requiredstring[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 requiredstringIndicates 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.
FieldTypeDescription
error requiredapi_errors
GET /v1/setup_intents/{intent}

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

ParameterLocationTypeDescription
client_secretquerystringThe client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
intentpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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.
applicationone of multiple schemasID of the Connect application that created the SetupIntent.
attach_to_selfbooleanIf 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_methodsone of multiple schemasSettings for dynamic payment methods compatible with this Setup Intent
cancellation_reasonstringReason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
client_secretstringThe 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 requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesarray of stringPayment method types that are excluded from this SetupIntent.
flow_directionsarray of stringIndicates 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 requiredstringUnique identifier for the object.
last_setup_errorone of multiple schemasThe error encountered in the previous SetupIntent confirmation.
latest_attemptone of multiple schemasThe most recent SetupAttempt for this SetupIntent.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemas
mandateone of multiple schemasID of the multi use Mandate generated by the SetupIntent.
metadataobjectSet 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_actionone of multiple schemasIf present, this property tells you what actions you need to take in order for your customer to continue payment setup.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) for which the setup is intended.
payment_methodone of multiple schemasID 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_detailsone of multiple schemasInformation about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent.
payment_method_optionsone of multiple schemasPayment method-specific configuration for this SetupIntent.
payment_method_types requiredarray of stringThe 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_mandateone of multiple schemasID of the single_use Mandate generated by the SetupIntent.
status requiredstring[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 requiredstringIndicates 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.
FieldTypeDescription
error requiredapi_errors
POST /v1/setup_intents/{intent}

Update a SetupIntent

Updates a SetupIntent object.

Request parameters

ParameterLocationTypeDescription
intentpathstring
FieldTypeDescription
allowed_payment_method_typesone of multiple schemasThe 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_selfbooleanIf 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.
customerstringID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesone of multiple schemasThe list of payment method types to exclude from use with this SetupIntent.
expandarray of stringSpecifies which fields in the response should be expanded.
flow_directionsarray of stringIndicates 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.
metadataone of multiple schemasSet 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_methodstringID 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_configurationstringThe ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent.
payment_method_dataobjectWhen 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_optionsobjectPayment method-specific configuration for this SetupIntent.
payment_method_typesarray of stringThe 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.
FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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.
applicationone of multiple schemasID of the Connect application that created the SetupIntent.
attach_to_selfbooleanIf 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_methodsone of multiple schemasSettings for dynamic payment methods compatible with this Setup Intent
cancellation_reasonstringReason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
client_secretstringThe 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 requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesarray of stringPayment method types that are excluded from this SetupIntent.
flow_directionsarray of stringIndicates 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 requiredstringUnique identifier for the object.
last_setup_errorone of multiple schemasThe error encountered in the previous SetupIntent confirmation.
latest_attemptone of multiple schemasThe most recent SetupAttempt for this SetupIntent.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemas
mandateone of multiple schemasID of the multi use Mandate generated by the SetupIntent.
metadataobjectSet 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_actionone of multiple schemasIf present, this property tells you what actions you need to take in order for your customer to continue payment setup.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) for which the setup is intended.
payment_methodone of multiple schemasID 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_detailsone of multiple schemasInformation about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent.
payment_method_optionsone of multiple schemasPayment method-specific configuration for this SetupIntent.
payment_method_types requiredarray of stringThe 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_mandateone of multiple schemasID of the single_use Mandate generated by the SetupIntent.
status requiredstring[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 requiredstringIndicates 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.
FieldTypeDescription
error requiredapi_errors
POST /v1/setup_intents/{intent}/cancel

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

ParameterLocationTypeDescription
intentpathstring
FieldTypeDescription
cancellation_reasonstringReason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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.
applicationone of multiple schemasID of the Connect application that created the SetupIntent.
attach_to_selfbooleanIf 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_methodsone of multiple schemasSettings for dynamic payment methods compatible with this Setup Intent
cancellation_reasonstringReason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
client_secretstringThe 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 requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesarray of stringPayment method types that are excluded from this SetupIntent.
flow_directionsarray of stringIndicates 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 requiredstringUnique identifier for the object.
last_setup_errorone of multiple schemasThe error encountered in the previous SetupIntent confirmation.
latest_attemptone of multiple schemasThe most recent SetupAttempt for this SetupIntent.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemas
mandateone of multiple schemasID of the multi use Mandate generated by the SetupIntent.
metadataobjectSet 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_actionone of multiple schemasIf present, this property tells you what actions you need to take in order for your customer to continue payment setup.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) for which the setup is intended.
payment_methodone of multiple schemasID 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_detailsone of multiple schemasInformation about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent.
payment_method_optionsone of multiple schemasPayment method-specific configuration for this SetupIntent.
payment_method_types requiredarray of stringThe 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_mandateone of multiple schemasID of the single_use Mandate generated by the SetupIntent.
status requiredstring[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 requiredstringIndicates 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.
FieldTypeDescription
error requiredapi_errors
POST /v1/setup_intents/{intent}/confirm

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

ParameterLocationTypeDescription
intentpathstring
FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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_secretstringThe client secret of the SetupIntent.
confirmation_tokenstringID 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.
expandarray of stringSpecifies which fields in the response should be expanded.
mandate_dataone of multiple schemas
payment_methodstringID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
payment_method_dataobjectWhen 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_optionsobjectPayment method-specific configuration for this SetupIntent.
return_urlstringThe 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_sdkbooleanSet 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.
FieldTypeDescription
allowed_payment_method_typesarray of stringThe 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.
applicationone of multiple schemasID of the Connect application that created the SetupIntent.
attach_to_selfbooleanIf 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_methodsone of multiple schemasSettings for dynamic payment methods compatible with this Setup Intent
cancellation_reasonstringReason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
client_secretstringThe 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 requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customerone of multiple schemasID 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_accountstringID 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.
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
excluded_payment_method_typesarray of stringPayment method types that are excluded from this SetupIntent.
flow_directionsarray of stringIndicates 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 requiredstringUnique identifier for the object.
last_setup_errorone of multiple schemasThe error encountered in the previous SetupIntent confirmation.
latest_attemptone of multiple schemasThe most recent SetupAttempt for this SetupIntent.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
managed_paymentsone of multiple schemas
mandateone of multiple schemasID of the multi use Mandate generated by the SetupIntent.
metadataobjectSet 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_actionone of multiple schemasIf present, this property tells you what actions you need to take in order for your customer to continue payment setup.
object requiredstringString representing the object's type. Objects of the same type share the same value.
on_behalf_ofone of multiple schemasThe account (if any) for which the setup is intended.
payment_methodone of multiple schemasID 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_detailsone of multiple schemasInformation about the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) used for this Setup Intent.
payment_method_optionsone of multiple schemasPayment method-specific configuration for this SetupIntent.
payment_method_types requiredarray of stringThe 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_mandateone of multiple schemasID of the single_use Mandate generated by the SetupIntent.
status requiredstring[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 requiredstringIndicates 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.
FieldTypeDescription
error requiredapi_errors