API reference
Setup Intents
A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. Later, you can use PaymentIntents to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent transitions through multiple statuses as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. For example, cardholders in certain regions might need to be run through Strong Customer Authentication during payment method collection to streamline later off-session payments. If you use the SetupIntent with a Customer, it automatically attaches the resulting payment method to that Customer after successful setup. We recommend using SetupIntents or setup_future_usage on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. Related guide: Setup Intents API
Create a SetupIntent
POST/v1/setup_intents
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.
Body parameters
allowed_payment_method_typesarray of stringsThe 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.
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.
Show 2 child parameters
enabledbooleanRequiredallow_redirectsstringPossible valuesalwaysnever
confirmbooleanSet to
trueto attempt to confirm this SetupIntent immediately. This parameter defaults tofalse. If a card is the attached payment method, you can provide areturn_urlin 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 stringsThe list of payment method types to exclude from use with this SetupIntent.
expandarray of stringsSpecifies which fields in the response should be expanded.
flow_directionsarray of stringsIndicates the directions of money movement for which this payment method is intended to be used. Include
inboundif you intend to use the payment method as the origin to pull funds from. Includeoutboundif 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_dataobjectThis hash contains details about the mandate to create. This parameter can only be used with
confirm=true.Show 1 child parameter
customer_acceptanceobjectRequiredShow 4 child parameters
typestringRequiredPossible valuesofflineonline
accepted_atintegerofflineobjectonlineobjectChild parameters are listed in the OpenAPI document.
metadataobjectSet 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.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 to use with this SetupIntent.
payment_method_dataobjectWhen included, this hash creates a PaymentMethod that is set as the
payment_methodvalue in the SetupIntent.Show 59 child parameters
typestringRequiredPossible valuesacss_debitaffirmafterpay_clearpayalipayalmaamazon_payau_becs_debitbacs_debitbancontactbilliebizumblikboletocashappcryptocustomer_balance- and 37 more
acss_debitobjectShow 3 child parameters
account_numberstringRequiredinstitution_numberstringRequiredtransit_numberstringRequired
affirmobjectafterpay_clearpayobjectalipayobjectallow_redisplaystringPossible valuesalwayslimitedunspecified
almaobjectamazon_payobjectau_becs_debitobjectShow 2 child parameters
account_numberstringRequiredbsb_numberstringRequired
bacs_debitobjectShow 2 child parameters
account_numberstringsort_codestring
bancontactobjectbillieobjectbilling_detailsobjectShow 5 child parameters
addressobjectChild parameters are listed in the OpenAPI document.
emailstringnamestringphonestringtax_idstring
bizumobjectblikobjectboletoobjectShow 1 child parameter
tax_idstringRequired
cashappobjectcryptoobjectcustomer_balanceobjectepsobjectShow 1 child parameter
bankstringPossible valuesarzte_und_apotheker_bankaustrian_anadi_bank_agbank_austriabankhaus_carl_spanglerbankhaus_schelhammer_und_schattera_agbawag_psk_agbks_bank_agbrull_kallmus_bank_agbtv_vier_lander_bankcapital_bank_grawe_gruppe_agdeutsche_bank_agdolomitenbankeasybank_agerste_bank_und_sparkassenhypo_alpeadriabank_international_aghypo_bank_burgenland_aktiengesellschaft- and 12 more
fpxobjectShow 1 child parameter
bankstringRequiredPossible valuesaffin_bankagrobankalliance_bankambankbank_islambank_muamalatbank_of_chinabank_rakyatbnp_paribasbsncimbcitibankdeutsche_bankhong_leong_bankhsbckfh- and 9 more
giropayobjectgrabpayobjectidealobjectShow 1 child parameter
bankstringPossible valuesabn_amroadyenasn_bankbunqbuutfinomhandelsbankeningknabmolliemoneyoun26nnrabobankregiobankrevolut- and 4 more
interac_presentobjectkakao_payobjectklarnaobjectShow 1 child parameter
dobobjectChild parameters are listed in the OpenAPI document.
konbiniobjectkr_cardobjectlinkobjectmb_wayobjectmetadataobjectmobilepayobjectmultibancoobjectnaver_payobjectShow 1 child parameter
fundingstringPossible valuescardpoints
nz_bank_accountobjectShow 6 child parameters
account_numberstringRequiredbank_codestringRequiredbranch_codestringRequiredsuffixstringRequiredaccount_holder_namestringreferencestring
oxxoobjectp24objectShow 1 child parameter
bankstringPossible valuesalior_bankbank_millenniumbank_nowy_bfg_sabank_pekao_sabanki_spbdzielczeblikbnp_paribasbozciti_handlowycredit_agricoleenvelobanketransfer_pocztowy24getin_bankideabankinginteligo- and 10 more
pay_by_bankobjectpaycoobjectpaynowobjectpaypalobjectpaytoobjectShow 3 child parameters
account_numberstringbsb_numberstringpay_idstring
pixobjectpromptpayobjectradar_optionsobjectShow 1 child parameter
sessionstring
revolut_payobjectsamsung_payobjectsatispayobjectscalapayobjectsepa_debitobjectShow 1 child parameter
ibanstringRequired
sofortobjectShow 1 child parameter
countrystringRequiredPossible valuesATBEDEESITNL
sunbitobjectswishobjecttwintobjectupiobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
us_bank_accountobjectShow 5 child parameters
account_holder_typestringPossible valuescompanyindividual
account_numberstringaccount_typestringPossible valuescheckingsavings
financial_connections_accountstringrouting_numberstring
wechat_payobjectzipobject
payment_method_optionsobjectPayment method-specific configuration for this SetupIntent.
Show 14 child parameters
acss_debitobjectShow 3 child parameters
currencystringPossible valuescadusd
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
verification_methodstringPossible valuesautomaticinstantmicrodeposits
amazon_payobjectbacs_debitobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
bizumobjectcardobjectShow 4 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
networkstringPossible valuesamexcartes_bancairesdinersdiscovereftpos_augirocardinteracjcblinkmastercardunionpayunknownvisa
request_three_d_securestringPossible valuesanyautomaticchallenge
three_d_secureobjectChild parameters are listed in the OpenAPI document.
card_presentobjectklarnaobjectShow 4 child parameters
currencystringon_demandobjectChild parameters are listed in the OpenAPI document.
preferred_localestringPossible valuescs-CZda-DKde-ATde-CHde-DEel-GRen-ATen-AUen-BEen-CAen-CHen-CZen-DEen-DKen-ESen-FI- and 30 more
subscriptionsarray of objectsChild parameters are listed in the OpenAPI document.
linkobjectpaypalobjectShow 1 child parameter
billing_agreement_idstring
paytoobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
pixobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
sepa_debitobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
upiobjectShow 2 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
us_bank_accountobjectShow 4 child parameters
financial_connectionsobjectChild parameters are listed in the OpenAPI document.
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
networksobjectChild parameters are listed in the OpenAPI document.
verification_methodstringPossible valuesautomaticinstantmicrodeposits
payment_method_typesarray of stringsThe 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. A list of valid payment method types can be found here.
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.single_useobjectIf you populate this hash, this SetupIntent generates a
single_usemandate 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, andus_bank_account.Show 2 child parameters
amountintegerRequiredcurrencystringRequired
usagestringIndicates how the payment method is intended to be used in the future. If not provided, this value defaults to
off_session.Possible valuesoff_sessionon_session
use_stripe_sdkbooleanSet to
truewhen confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
Returns
The setup_intent object.
curl -X POST https://api.knoxapi.com/v1/setup_intents \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const setupIntent = await stripe.setupIntents.create();import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
setup_intent = client.v1.setup_intents.create()require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
setup_intent = Stripe::SetupIntent.create(){
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}List all SetupIntents
GET/v1/setup_intents
Returns a list of SetupIntents.
Query parameters
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.
createdobject | integerA filter on the list, based on the object
createdfield. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.Show 4 child parameters
gtintegergteintegerltintegerlteinteger
customerstringOnly return SetupIntents for the customer specified by this customer ID.
customer_accountstringOnly return SetupIntents for the account specified by this customer ID.
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
payment_methodstringOnly return SetupIntents that associate with the specified payment method.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of setup_intent objects.
curl -G https://api.knoxapi.com/v1/setup_intents \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const page = await stripe.setupIntents.list({
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
page = client.v1.setup_intents.list(params={
"limit": 3,
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
page = Stripe::SetupIntent.list({
limit: 3,
}){
"object": "list",
"url": "/v1/setup_intents",
"has_more": false,
"data": [
{
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}
]
}Update a SetupIntent
POST/v1/setup_intents/{intent}
Updates a SetupIntent object.
Path parameters
intentstringRequired
Body parameters
allowed_payment_method_typesarray of stringsThe 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.
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_typesarray of stringsThe list of payment method types to exclude from use with this SetupIntent.
expandarray of stringsSpecifies which fields in the response should be expanded.
flow_directionsarray of stringsIndicates the directions of money movement for which this payment method is intended to be used. Include
inboundif you intend to use the payment method as the origin to pull funds from. Includeoutboundif 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.metadataobjectSet 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_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 to use with this SetupIntent.
payment_method_dataobjectWhen included, this hash creates a PaymentMethod that is set as the
payment_methodvalue in the SetupIntent.Show 59 child parameters
typestringRequiredPossible valuesacss_debitaffirmafterpay_clearpayalipayalmaamazon_payau_becs_debitbacs_debitbancontactbilliebizumblikboletocashappcryptocustomer_balance- and 37 more
acss_debitobjectShow 3 child parameters
account_numberstringRequiredinstitution_numberstringRequiredtransit_numberstringRequired
affirmobjectafterpay_clearpayobjectalipayobjectallow_redisplaystringPossible valuesalwayslimitedunspecified
almaobjectamazon_payobjectau_becs_debitobjectShow 2 child parameters
account_numberstringRequiredbsb_numberstringRequired
bacs_debitobjectShow 2 child parameters
account_numberstringsort_codestring
bancontactobjectbillieobjectbilling_detailsobjectShow 5 child parameters
addressobjectChild parameters are listed in the OpenAPI document.
emailstringnamestringphonestringtax_idstring
bizumobjectblikobjectboletoobjectShow 1 child parameter
tax_idstringRequired
cashappobjectcryptoobjectcustomer_balanceobjectepsobjectShow 1 child parameter
bankstringPossible valuesarzte_und_apotheker_bankaustrian_anadi_bank_agbank_austriabankhaus_carl_spanglerbankhaus_schelhammer_und_schattera_agbawag_psk_agbks_bank_agbrull_kallmus_bank_agbtv_vier_lander_bankcapital_bank_grawe_gruppe_agdeutsche_bank_agdolomitenbankeasybank_agerste_bank_und_sparkassenhypo_alpeadriabank_international_aghypo_bank_burgenland_aktiengesellschaft- and 12 more
fpxobjectShow 1 child parameter
bankstringRequiredPossible valuesaffin_bankagrobankalliance_bankambankbank_islambank_muamalatbank_of_chinabank_rakyatbnp_paribasbsncimbcitibankdeutsche_bankhong_leong_bankhsbckfh- and 9 more
giropayobjectgrabpayobjectidealobjectShow 1 child parameter
bankstringPossible valuesabn_amroadyenasn_bankbunqbuutfinomhandelsbankeningknabmolliemoneyoun26nnrabobankregiobankrevolut- and 4 more
interac_presentobjectkakao_payobjectklarnaobjectShow 1 child parameter
dobobjectChild parameters are listed in the OpenAPI document.
konbiniobjectkr_cardobjectlinkobjectmb_wayobjectmetadataobjectmobilepayobjectmultibancoobjectnaver_payobjectShow 1 child parameter
fundingstringPossible valuescardpoints
nz_bank_accountobjectShow 6 child parameters
account_numberstringRequiredbank_codestringRequiredbranch_codestringRequiredsuffixstringRequiredaccount_holder_namestringreferencestring
oxxoobjectp24objectShow 1 child parameter
bankstringPossible valuesalior_bankbank_millenniumbank_nowy_bfg_sabank_pekao_sabanki_spbdzielczeblikbnp_paribasbozciti_handlowycredit_agricoleenvelobanketransfer_pocztowy24getin_bankideabankinginteligo- and 10 more
pay_by_bankobjectpaycoobjectpaynowobjectpaypalobjectpaytoobjectShow 3 child parameters
account_numberstringbsb_numberstringpay_idstring
pixobjectpromptpayobjectradar_optionsobjectShow 1 child parameter
sessionstring
revolut_payobjectsamsung_payobjectsatispayobjectscalapayobjectsepa_debitobjectShow 1 child parameter
ibanstringRequired
sofortobjectShow 1 child parameter
countrystringRequiredPossible valuesATBEDEESITNL
sunbitobjectswishobjecttwintobjectupiobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
us_bank_accountobjectShow 5 child parameters
account_holder_typestringPossible valuescompanyindividual
account_numberstringaccount_typestringPossible valuescheckingsavings
financial_connections_accountstringrouting_numberstring
wechat_payobjectzipobject
payment_method_optionsobjectPayment method-specific configuration for this SetupIntent.
Show 14 child parameters
acss_debitobjectShow 3 child parameters
currencystringPossible valuescadusd
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
verification_methodstringPossible valuesautomaticinstantmicrodeposits
amazon_payobjectbacs_debitobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
bizumobjectcardobjectShow 4 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
networkstringPossible valuesamexcartes_bancairesdinersdiscovereftpos_augirocardinteracjcblinkmastercardunionpayunknownvisa
request_three_d_securestringPossible valuesanyautomaticchallenge
three_d_secureobjectChild parameters are listed in the OpenAPI document.
card_presentobjectklarnaobjectShow 4 child parameters
currencystringon_demandobjectChild parameters are listed in the OpenAPI document.
preferred_localestringPossible valuescs-CZda-DKde-ATde-CHde-DEel-GRen-ATen-AUen-BEen-CAen-CHen-CZen-DEen-DKen-ESen-FI- and 30 more
subscriptionsarray of objectsChild parameters are listed in the OpenAPI document.
linkobjectpaypalobjectShow 1 child parameter
billing_agreement_idstring
paytoobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
pixobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
sepa_debitobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
upiobjectShow 2 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
us_bank_accountobjectShow 4 child parameters
financial_connectionsobjectChild parameters are listed in the OpenAPI document.
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
networksobjectChild parameters are listed in the OpenAPI document.
verification_methodstringPossible valuesautomaticinstantmicrodeposits
payment_method_typesarray of stringsThe 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. A list of valid payment method types can be found here.
Returns
The setup_intent object.
curl https://api.knoxapi.com/v1/setup_intents/seti_1Pgag7B7WZ01zgkWSgwGdb8Z \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "metadata[order_id]=6735"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const setupIntent = await stripe.setupIntents.update('seti_1Pgag7B7WZ01zgkWSgwGdb8Z', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
setup_intent = client.v1.setup_intents.update("seti_1Pgag7B7WZ01zgkWSgwGdb8Z", params={
"metadata": {
"order_id": "6735",
},
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
setup_intent = Stripe::SetupIntent.update('seti_1Pgag7B7WZ01zgkWSgwGdb8Z', {
metadata: {
order_id: '6735',
},
}){
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}Retrieve a SetupIntent
GET/v1/setup_intents/{intent}
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.
Path parameters
intentstringRequired
Query parameters
client_secretstringThe client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent.
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The setup_intent object.
curl https://api.knoxapi.com/v1/setup_intents/seti_1Pgag7B7WZ01zgkWSgwGdb8Z \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const setupIntent = await stripe.setupIntents.retrieve('seti_1Pgag7B7WZ01zgkWSgwGdb8Z');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
setup_intent = client.v1.setup_intents.retrieve("seti_1Pgag7B7WZ01zgkWSgwGdb8Z")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
setup_intent = Stripe::SetupIntent.retrieve('seti_1Pgag7B7WZ01zgkWSgwGdb8Z'){
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}Cancel a SetupIntent
POST/v1/setup_intents/{intent}/cancel
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.
Path parameters
intentstringRequired
Body parameters
cancellation_reasonstringReason for canceling this SetupIntent. Possible values are:
abandoned,requested_by_customer, orduplicatePossible valuesabandonedduplicaterequested_by_customer
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The setup_intent object.
curl -X POST https://api.knoxapi.com/v1/setup_intents/seti_1Pgag7B7WZ01zgkWSgwGdb8Z/cancel \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const setupIntent = await stripe.setupIntents.cancel('seti_1Pgag7B7WZ01zgkWSgwGdb8Z');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
setup_intent = client.v1.setup_intents.cancel("seti_1Pgag7B7WZ01zgkWSgwGdb8Z")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
setup_intent = Stripe::SetupIntent.cancel('seti_1Pgag7B7WZ01zgkWSgwGdb8Z'){
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}Confirm a SetupIntent
POST/v1/setup_intents/{intent}/confirm
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.
Path parameters
intentstringRequired
Body parameters
allowed_payment_method_typesarray of stringsThe 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.
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 stringsSpecifies which fields in the response should be expanded.
mandate_dataobjectShow 1 child parameter
customer_acceptanceobjectRequiredShow 4 child parameters
typestringRequiredPossible valuesofflineonline
accepted_atintegerofflineobjectonlineobjectChild parameters are listed in the OpenAPI document.
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_methodvalue in the SetupIntent.Show 59 child parameters
typestringRequiredPossible valuesacss_debitaffirmafterpay_clearpayalipayalmaamazon_payau_becs_debitbacs_debitbancontactbilliebizumblikboletocashappcryptocustomer_balance- and 37 more
acss_debitobjectShow 3 child parameters
account_numberstringRequiredinstitution_numberstringRequiredtransit_numberstringRequired
affirmobjectafterpay_clearpayobjectalipayobjectallow_redisplaystringPossible valuesalwayslimitedunspecified
almaobjectamazon_payobjectau_becs_debitobjectShow 2 child parameters
account_numberstringRequiredbsb_numberstringRequired
bacs_debitobjectShow 2 child parameters
account_numberstringsort_codestring
bancontactobjectbillieobjectbilling_detailsobjectShow 5 child parameters
addressobjectChild parameters are listed in the OpenAPI document.
emailstringnamestringphonestringtax_idstring
bizumobjectblikobjectboletoobjectShow 1 child parameter
tax_idstringRequired
cashappobjectcryptoobjectcustomer_balanceobjectepsobjectShow 1 child parameter
bankstringPossible valuesarzte_und_apotheker_bankaustrian_anadi_bank_agbank_austriabankhaus_carl_spanglerbankhaus_schelhammer_und_schattera_agbawag_psk_agbks_bank_agbrull_kallmus_bank_agbtv_vier_lander_bankcapital_bank_grawe_gruppe_agdeutsche_bank_agdolomitenbankeasybank_agerste_bank_und_sparkassenhypo_alpeadriabank_international_aghypo_bank_burgenland_aktiengesellschaft- and 12 more
fpxobjectShow 1 child parameter
bankstringRequiredPossible valuesaffin_bankagrobankalliance_bankambankbank_islambank_muamalatbank_of_chinabank_rakyatbnp_paribasbsncimbcitibankdeutsche_bankhong_leong_bankhsbckfh- and 9 more
giropayobjectgrabpayobjectidealobjectShow 1 child parameter
bankstringPossible valuesabn_amroadyenasn_bankbunqbuutfinomhandelsbankeningknabmolliemoneyoun26nnrabobankregiobankrevolut- and 4 more
interac_presentobjectkakao_payobjectklarnaobjectShow 1 child parameter
dobobjectChild parameters are listed in the OpenAPI document.
konbiniobjectkr_cardobjectlinkobjectmb_wayobjectmetadataobjectmobilepayobjectmultibancoobjectnaver_payobjectShow 1 child parameter
fundingstringPossible valuescardpoints
nz_bank_accountobjectShow 6 child parameters
account_numberstringRequiredbank_codestringRequiredbranch_codestringRequiredsuffixstringRequiredaccount_holder_namestringreferencestring
oxxoobjectp24objectShow 1 child parameter
bankstringPossible valuesalior_bankbank_millenniumbank_nowy_bfg_sabank_pekao_sabanki_spbdzielczeblikbnp_paribasbozciti_handlowycredit_agricoleenvelobanketransfer_pocztowy24getin_bankideabankinginteligo- and 10 more
pay_by_bankobjectpaycoobjectpaynowobjectpaypalobjectpaytoobjectShow 3 child parameters
account_numberstringbsb_numberstringpay_idstring
pixobjectpromptpayobjectradar_optionsobjectShow 1 child parameter
sessionstring
revolut_payobjectsamsung_payobjectsatispayobjectscalapayobjectsepa_debitobjectShow 1 child parameter
ibanstringRequired
sofortobjectShow 1 child parameter
countrystringRequiredPossible valuesATBEDEESITNL
sunbitobjectswishobjecttwintobjectupiobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
us_bank_accountobjectShow 5 child parameters
account_holder_typestringPossible valuescompanyindividual
account_numberstringaccount_typestringPossible valuescheckingsavings
financial_connections_accountstringrouting_numberstring
wechat_payobjectzipobject
payment_method_optionsobjectPayment method-specific configuration for this SetupIntent.
Show 14 child parameters
acss_debitobjectShow 3 child parameters
currencystringPossible valuescadusd
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
verification_methodstringPossible valuesautomaticinstantmicrodeposits
amazon_payobjectbacs_debitobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
bizumobjectcardobjectShow 4 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
networkstringPossible valuesamexcartes_bancairesdinersdiscovereftpos_augirocardinteracjcblinkmastercardunionpayunknownvisa
request_three_d_securestringPossible valuesanyautomaticchallenge
three_d_secureobjectChild parameters are listed in the OpenAPI document.
card_presentobjectklarnaobjectShow 4 child parameters
currencystringon_demandobjectChild parameters are listed in the OpenAPI document.
preferred_localestringPossible valuescs-CZda-DKde-ATde-CHde-DEel-GRen-ATen-AUen-BEen-CAen-CHen-CZen-DEen-DKen-ESen-FI- and 30 more
subscriptionsarray of objectsChild parameters are listed in the OpenAPI document.
linkobjectpaypalobjectShow 1 child parameter
billing_agreement_idstring
paytoobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
pixobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
sepa_debitobjectShow 1 child parameter
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
upiobjectShow 2 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
us_bank_accountobjectShow 4 child parameters
financial_connectionsobjectChild parameters are listed in the OpenAPI document.
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
networksobjectChild parameters are listed in the OpenAPI document.
verification_methodstringPossible valuesautomaticinstantmicrodeposits
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
truewhen confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
Returns
The setup_intent object.
curl -X POST https://api.knoxapi.com/v1/setup_intents/seti_1Pgag7B7WZ01zgkWSgwGdb8Z/confirm \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const setupIntent = await stripe.setupIntents.confirm('seti_1Pgag7B7WZ01zgkWSgwGdb8Z');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
setup_intent = client.v1.setup_intents.confirm("seti_1Pgag7B7WZ01zgkWSgwGdb8Z")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
setup_intent = Stripe::SetupIntent.confirm('seti_1Pgag7B7WZ01zgkWSgwGdb8Z'){
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}Verify microdeposits on a SetupIntent
POST/v1/setup_intents/{intent}/verify_microdeposits
Verifies microdeposits on a SetupIntent object.
Path parameters
intentstringRequired
Body parameters
amountsarray of integersTwo positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
client_secretstringThe client secret of the SetupIntent.
descriptor_codestringA six-character code starting with SM present in the microdeposit sent to the bank account.
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The setup_intent object.
curl -X POST https://api.knoxapi.com/v1/setup_intents/seti_1Pgag7B7WZ01zgkWSgwGdb8Z/verify_microdeposits \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const setupIntent = await stripe.setupIntents.verifyMicrodeposits('seti_1Pgag7B7WZ01zgkWSgwGdb8Z');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
setup_intent = client.v1.setup_intents.verify_microdeposits("seti_1Pgag7B7WZ01zgkWSgwGdb8Z")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
setup_intent = Stripe::SetupIntent.verify_microdeposits('seti_1Pgag7B7WZ01zgkWSgwGdb8Z'){
"application": null,
"automatic_payment_methods": {
"enabled": null
},
"cancellation_reason": null,
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"created": 1234567890,
"customer": null,
"description": null,
"flow_directions": null,
"id": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z",
"last_setup_error": {
"type": "idempotency_error"
},
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": {
"type": "type"
},
"object": "setup_intent",
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"single_use_mandate": null,
"status": "requires_payment_method",
"usage": "off_session",
"excluded_payment_method_types": null,
"allowed_payment_method_types": null
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.