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_
secretstringRequired if using publishable key The 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_
methodstring Only return SetupIntents that associate with the specified payment method.
More parameters
- attach_
to_ selfboolean - createdobject
- ending_
beforestring - limitinteger
- starting_
afterstring
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" } ]}
You can cancel a SetupIntent object when itâs in one of these statuses: requires_
, requires_
, or requires_
.
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.
Parameters
- cancellation_
reasonstring Reason for canceling this SetupIntent. Possible values are:
abandoned
,requested_
, orby_ customer duplicate
Returns
Returns a SetupIntent object if the cancellation succeeds. Returns an error if the SetupIntent is already canceled or isnât in a cancelable state.
{ "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": "canceled", "usage": "off_session"}
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_
status and suggest additional actions via next_
. If setup fails, the SetupIntent will transition to the requires_
status or the canceled
status if the confirmation limit is reached.
Parameters
- payment_
methodstring ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
More parameters
- confirmation_
tokenstring - mandate_
dataobject - payment_
method_ dataobject - payment_
method_ optionsobjectsecret key only - return_
urlstring - use_
stripe_ sdkboolean
Returns
Returns the resulting SetupIntent after all possible transitions are applied.
{ "id": "seti_1Mm2cBLkdIwHu7ixaiKW3ElR", "object": "setup_intent", "application": null, "cancellation_reason": null, "client_secret": "seti_1Mm2cBLkdIwHu7ixaiKW3ElR_secret_NX6phB7HbSmlkpqzKZ3Bxr7uXFRf9Jg", "created": 1678918571, "customer": null, "description": null, "flow_directions": null, "last_setup_error": null, "latest_attempt": "setatt_1Mm2cBLkdIwHu7ixdEp1VkXJ", "livemode": false, "mandate": null, "metadata": {}, "next_action": null, "on_behalf_of": null, "payment_method": "pm_1Mm2cBLkdIwHu7ixGoOfZSsV", "payment_method_options": { "card": { "mandate_options": null, "network": null, "request_three_d_secure": "automatic" } }, "payment_method_types": [ "card" ], "single_use_mandate": null, "status": "succeeded", "usage": "off_session"}
Verifies microdeposits on a SetupIntent object.
Parameters
- amountsarray of integers
Two positive integers, in cents, equal to the values of the microdeposits sent to the bank account.
- descriptor_
codestring A six-character code starting with SM present in the microdeposit sent to the bank account.
Returns
Returns a SetupIntent object.
{ "id": "seti_1Mm5yZLkdIwHu7ixm0sPzrx4", "object": "setup_intent", "application": null, "cancellation_reason": null, "client_secret": "seti_1Mm5yZLkdIwHu7ixm0sPzrx4_secret_NXAJ5iPM38ITW1pI7o8VZZhoZyDrrWR", "created": 1678931491, "customer": null, "description": null, "flow_directions": null, "last_setup_error": null, "latest_attempt": "setatt_1Mm5yZLkdIwHu7ix7QtOkLAu", "livemode": false, "mandate": "mandate_1Mm5yaLkdIwHu7ixmNoLkKLC", "metadata": {}, "next_action": null, "on_behalf_of": null, "payment_method": "pm_1Mm5yZLkdIwHu7ixf89jW57b", "payment_method_options": { "acss_debit": { "currency": "cad", "mandate_options": { "interval_description": "First of every month", "payment_schedule": "interval", "transaction_type": "personal" }, "verification_method": "automatic" } }, "payment_method_types": [ "acss_debit" ], "single_use_mandate": null, "status": "succeeded", "usage": "off_session"}