Attributes
- idstringretrievable with publishable key
Unique identifier for the object.
- automatic_
payment_ nullable objectmethods Settings for dynamic payment methods compatible with this Setup Intent
- client_
secret nullable stringretrievable with publishable keyThe 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.
- customernullable stringExpandable
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.
- descriptionnullable stringretrievable with publishable key
An arbitrary string attached to the object. Often useful for displaying to users.
- last_
setup_ nullable objectretrievable with publishable keyerror The error encountered in the previous SetupIntent confirmation.
- metadatanullable object
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- next_
action nullable objectretrievable with publishable keyIf present, this property tells you what actions you need to take in order for your customer to continue payment setup.
- payment_
method nullable stringExpandableretrievable with publishable keyID of the payment method used with this SetupIntent. If the payment method is
card_
and isn’t a digital wallet, then the generated_card associated with thepresent latest_
is attached to the Customer instead.attempt - statusenumretrievable with publishable key
Status of this SetupIntent, one of
requires_
,payment_ method requires_
,confirmation requires_
,action processing
,canceled
, orsucceeded
.Possible enum valuescanceled
processing
requires_
action requires_
confirmation requires_
payment_ method succeeded
- usagestringretrievable with publishable key
Indicates how the payment method is intended to be used in the future.
Use
on_
if you intend to only reuse the payment method when the customer is in your checkout flow. Usesession off_
if your customer may or may not be in your checkout flow. If not provided, this value defaults tosession off_
.session
More attributes
- objectstringretrievable with publishable key
- applicationnullable stringExpandableConnect only
- attach_
to_ nullable booleanself - cancellation_
reason nullable enumretrievable with publishable key - createdtimestampretrievable with publishable key
- flow_
directions nullable array of enums - latest_
attempt nullable stringExpandable - livemodebooleanretrievable with publishable key
- mandatenullable stringExpandable
- on_
behalf_ nullable stringExpandableConnect onlyof - payment_
method_ nullable objectconfiguration_ details - payment_
method_ nullable objectoptions - payment_
method_ array of stringsretrievable with publishable keytypes - single_
use_ nullable stringExpandablemandate
{ "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"}
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.
Parameters
- automatic_
payment_ objectmethods When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
- confirmboolean
Set to
true
to attempt to confirm this SetupIntent immediately. This parameter defaults tofalse
. If a card is the attached payment method, you can provide areturn_
in case further authentication is necessary.url - customerstring
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.
- descriptionstring
An arbitrary string attached to the object. Often useful for displaying to users.
- metadataobject
Set of key-value pairs 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 stringID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
- usageenum
Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to
off_
.session Possible enum valuesoff_
session Use
off_
if your customer may or may not be in your checkout flow.session on_
session Use
on_
if you intend to only reuse the payment method when the customer is in your checkout flow.session
More parameters
- attach_
to_ booleanself - confirmation_
token stringonly when confirm=true - flow_
directions array of enums - mandate_
data objectonly when confirm=true - on_
behalf_ stringConnect onlyof - payment_
method_ stringconfiguration - payment_
method_ objectdata - payment_
method_ objectoptions - payment_
method_ array of stringstypes - return_
url stringonly when confirm=true - single_
use object - use_
stripe_ booleansdk
Returns
Returns a SetupIntent object.
{ "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"}
Updates a SetupIntent object.
Parameters
- customerstring
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.
- descriptionstring
An arbitrary string attached to the object. Often useful for displaying to users.
- metadataobject
Set of key-value pairs 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 stringID 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.
More parameters
- attach_
to_ booleanself - flow_
directions array of enums - payment_
method_ stringconfiguration - payment_
method_ objectdata - payment_
method_ objectoptions - payment_
method_ array of stringstypes
Returns
Returns a SetupIntent object.
{ "id": "seti_1Mm8s8LkdIwHu7ix0OXBfTRG", "object": "setup_intent", "application": null, "cancellation_reason": null, "client_secret": "seti_1Mm8s8LkdIwHu7ix0OXBfTRG_secret_NXDICkPqPeiBTAFqWmkbff09lRmSVXe", "created": 1678942624, "customer": null, "description": null, "flow_directions": null, "last_setup_error": null, "latest_attempt": null, "livemode": false, "mandate": null, "metadata": { "order_id": "6735" }, "next_action": null, "on_behalf_of": null, "payment_method": null, "payment_method_options": { "card": { "mandate_options": null, "network": null, "request_three_d_secure": "automatic" } }, "payment_method_types": [ "card" ], "single_use_mandate": null, "status": "requires_payment_method", "usage": "off_session"}
Retrieves the details of a SetupIntent that has previously been created.
Client-side retrieval using a publishable key is allowed when the client_
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.
Parameters
- client_
secret stringRequired if using publishable keyThe client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent.
Returns
Returns a SetupIntent if a valid identifier was provided.
{ "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"}
Returns a list of SetupIntents.
Parameters
- customerstring
Only return SetupIntents for the customer specified by this customer ID.
- payment_
method stringOnly return SetupIntents that associate with the specified payment method.
More parameters
- attach_
to_ booleanself - createdobject
- ending_
before string - limitinteger
- starting_
after string
Returns
A dictionary with a data
property that contains an array of up to limit
SetupIntents, starting after SetupIntent starting_
. Each entry in the array is a separate SetupIntent object. If no more SetupIntents are available, the resulting array will be empty.
{ "object": "list", "url": "/v1/setup_intents", "has_more": false, "data": [ { "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" } ]}