Skip to content

Stripe: Create a Setup Intent

Stripe setupIntents.postSetupIntents: arguments, response, policy and SDK examples.

← Setup intents operations · Get started

Operation stripe.postsetupintents

Provider route: POST /v1/setup_intents. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["setupIntents"]["postSetupIntents"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.setupIntents.postSetupIntents(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.setup_intents.post_setup_intents(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.allowed_payment_method_typesarrayOptionalThe 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).
body.allowed_payment_method_types[]stringEach itemOne of: acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, au_becs_debit, bacs_debit, bancontact, billie, bizum, blik, boku_promptpay, boleto, capchase_pay, card, card_present, cashapp, check_scan, click_to_pay, crypto, customer_balance, demo_pay, duitnow, dummy_auth_push, dummy_passthrough_card, edenred, eps, fpx, gcash, getbalance, gift_card, giropay, gopay, grabpay, id_bank_transfer, ideal, interac_present, kakao_pay, klarna, knet, konbini, kr_card, kr_market, kriya, link, mb_way, mobilepay, momo, mondu, multibanco, naver_pay, netbanking, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, ng_wallet, nz_bank_account, octopus, oxxo, p24, paper_check, pay_by_bank, payco, paynow, paypal, paypay, payto, pix, promptpay, qris, rechnung, revolut_pay, samsung_pay, satispay, scalapay, sepa_debit, sequra, shop_pay, shopeepay, sofort, south_korea_market, stripe_balance, sunbit, swish, tamara, test_pay, touch_n_go, truemoney, twint, upi, us_bank_account, us_cash_voucher, vipps, wechat_pay, wero, zip
body.attach_to_selfbooleanOptionalIf 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.
body.automatic_payment_methodsobjectOptionalWhen you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.
body.automatic_payment_methods.allow_redirectsstringOptionalOne of: always, never
body.automatic_payment_methods.enabledbooleanRequired within parent
body.confirmbooleanOptionalSet 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.
body.confirmation_tokenstringOptionalID 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.
Maximum length: 5000
body.customerstringOptionalID 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.
Maximum length: 5000
body.customer_accountstringOptionalID 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.
Maximum length: 5000
body.descriptionstringOptionalAn arbitrary string attached to the object. Often useful for displaying to users.
Maximum length: 1000
body.excluded_payment_method_typesarrayOptionalThe list of payment method types to exclude from use with this SetupIntent.
body.excluded_payment_method_types[]stringEach itemOne of: acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, au_becs_debit, bacs_debit, bancontact, billie, bizum, blik, boleto, card, cashapp, crypto, customer_balance, eps, fpx, giropay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, mb_way, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, paypal, paypay, payto, pix, promptpay, revolut_pay, samsung_pay, satispay, scalapay, sepa_debit, sequra, sofort, sunbit, swish, twint, upi, us_bank_account, wechat_pay, zip
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.flow_directionsarrayOptionalIndicates 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.
body.flow_directions[]stringEach itemOne of: inbound, outbound
body.mandate_dataJSONOptionalThis 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).
body.mandate_data (anyOf 1)ModelAlternativeExpand Create a Setup Intent — request body — body mandate data customer acceptance
body.mandate_data (anyOf 2)stringAlternativeOne of:
body.metadataobjectOptionalSet 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`.
Additional keys: see wildcard field
body.metadata.*stringAdditional keys
body.on_behalf_ofstringOptionalThe Stripe account ID created for this SetupIntent.
body.payment_methodstringOptionalID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.
Maximum length: 5000
body.payment_method_configurationstringOptionalThe ID of the [payment method configuration](https://docs.stripe.com/api/payment_method_configurations) to use with this SetupIntent.
Maximum length: 100
body.payment_method_dataModelOptionalExpand Create a Setup Intent — request body — body payment method data
body.payment_method_optionsModelOptionalExpand Create a Setup Intent — request body — body payment method options
body.return_urlstringOptionalThe 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).
body.single_useobjectOptionalIf 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`.
body.single_use.amountintegerRequired within parent
body.single_use.currencystringRequired within parentFormat: currency
body.usagestringOptionalIndicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`.
One of: off_session, on_session
body.use_stripe_sdkbooleanOptionalSet to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.

Referenced models: Create a Setup Intent — request body — body mandate data customer acceptance, Create a Setup Intent — request body — body payment method data, Create a Setup Intent — request body — body payment method options

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Cancel a Setup Intent — response body

Referenced models: Cancel a Setup Intent — response body

720 more schemas are linked from the tables above, on the schema pages.

Create a Setup Intent — request body — body mandate data customer acceptance
FieldTypePresenceDescription and constraints
$objectRoot
customer_acceptanceobjectRequired within parent
customer_acceptance.accepted_atintegerOptionalFormat: unix-time
customer_acceptance.offlineobjectOptional
customer_acceptance.onlineobjectOptional
customer_acceptance.online.ip_addressstringRequired within parent
customer_acceptance.online.user_agentstringRequired within parentMaximum length: 5000
customer_acceptance.typestringRequired within parentOne of: offline, online
Maximum length: 5000
Create a Setup Intent — request body — body payment method data
FieldTypePresenceDescription and constraints
$objectRootWhen 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.
acss_debitobjectOptional
acss_debit.account_numberstringRequired within parentMaximum length: 5000
acss_debit.institution_numberstringRequired within parentMaximum length: 5000
acss_debit.transit_numberstringRequired within parentMaximum length: 5000
affirmobjectOptional
afterpay_clearpayobjectOptional
alipayobjectOptional
allow_redisplaystringOptionalOne of: always, limited, unspecified
almaobjectOptional
amazon_payobjectOptional
au_becs_debitobjectOptional
au_becs_debit.account_numberstringRequired within parentMaximum length: 5000
au_becs_debit.bsb_numberstringRequired within parentMaximum length: 5000
bacs_debitobjectOptional
bacs_debit.account_numberstringOptionalMaximum length: 5000
bacs_debit.sort_codestringOptionalMaximum length: 5000
bancontactobjectOptional
billieobjectOptional
billing_detailsModelOptionalExpand Create a Setup Intent — request body — body payment method data billing details
bizumobjectOptional
blikobjectOptional
boletoobjectOptional
boleto.tax_idstringRequired within parentMaximum length: 5000
cashappobjectOptional
cryptoobjectOptional
customer_balanceobjectOptional
epsModelOptionalExpand Create a Setup Intent — request body — body payment method data eps
fpxobjectOptional
fpx.bankstringRequired within parentOne of: affin_bank, agrobank, alliance_bank, ambank, bank_islam, bank_muamalat, bank_of_china, bank_rakyat, bnp_paribas, bsn, cimb, citibank, deutsche_bank, hong_leong_bank, hsbc, kfh, maybank2e, maybank2u, mbsb_bank, ocbc, pb_enterprise, public_bank, rhb, standard_chartered, uob
Maximum length: 5000
giropayobjectOptional
grabpayobjectOptional
idealobjectOptional
ideal.bankstringOptionalOne of: abn_amro, adyen, asn_bank, bunq, buut, finom, handelsbanken, ing, knab, mollie, moneyou, n26, nn, rabobank, regiobank, revolut, sns_bank, triodos_bank, van_lanschot, yoursafe
Maximum length: 5000
interac_presentobjectOptional
kakao_payobjectOptional
klarnaobjectOptional
klarna.dobobjectOptional
klarna.dob.dayintegerRequired within parent
klarna.dob.monthintegerRequired within parent
klarna.dob.yearintegerRequired within parent
konbiniobjectOptional
kr_cardobjectOptional
linkobjectOptional
mb_wayobjectOptional
metadataobjectOptionalAdditional keys: see wildcard field
metadata.*stringAdditional keys
mobilepayobjectOptional
multibancoobjectOptional
naver_payobjectOptional
naver_pay.fundingstringOptionalOne of: card, points
nz_bank_accountobjectOptional
nz_bank_account.account_holder_namestringOptionalMaximum length: 5000
nz_bank_account.account_numberstringRequired within parentMaximum length: 5000
nz_bank_account.bank_codestringRequired within parentMaximum length: 5000
nz_bank_account.branch_codestringRequired within parentMaximum length: 5000
nz_bank_account.referencestringOptionalMaximum length: 128
nz_bank_account.suffixstringRequired within parentMaximum length: 5000
oxxoobjectOptional
p24objectOptional
p24.bankstringOptionalOne of: alior_bank, bank_millennium, bank_nowy_bfg_sa, bank_pekao_sa, banki_spbdzielcze, blik, bnp_paribas, boz, citi_handlowy, credit_agricole, envelobank, etransfer_pocztowy24, getin_bank, ideabank, ing, inteligo, mbank_mtransfer, nest_przelew, noble_pay, pbac_z_ipko, plus_bank, santander_przelew24, tmobile_usbugi_bankowe, toyota_bank, velobank, volkswagen_bank
pay_by_bankobjectOptional
paycoobjectOptional
paynowobjectOptional
paypalobjectOptional
paypayobjectOptional
paytoobjectOptional
payto.account_numberstringOptionalMaximum length: 5000
payto.bsb_numberstringOptionalMaximum length: 5000
payto.pay_idstringOptionalMaximum length: 5000
pixobjectOptional
promptpayobjectOptional
radar_optionsobjectOptional
radar_options.sessionstringOptionalMaximum length: 5000
revolut_payobjectOptional
samsung_payobjectOptional
satispayobjectOptional
scalapayobjectOptional
sepa_debitobjectOptional
sepa_debit.ibanstringRequired within parentMaximum length: 5000
sequraobjectOptional
sofortobjectOptional
sofort.countrystringRequired within parentOne of: AT, BE, DE, ES, IT, NL
sunbitobjectOptional
swishobjectOptional
twintobjectOptional
typestringRequired within parentOne of: acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, au_becs_debit, bacs_debit, bancontact, billie, bizum, blik, boleto, cashapp, crypto, customer_balance, eps, fpx, giropay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mb_way, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, paypal, paypay, payto, pix, promptpay, revolut_pay, samsung_pay, satispay, scalapay, sepa_debit, sequra, sofort, sunbit, swish, twint, upi, us_bank_account, wechat_pay, zip
upiobjectOptional
upi.mandate_optionsobjectOptional
upi.mandate_options.amountintegerOptional
upi.mandate_options.amount_typestringOptionalOne of: fixed, maximum
upi.mandate_options.descriptionstringOptionalMaximum length: 20
upi.mandate_options.end_dateintegerOptionalFormat: unix-time
us_bank_accountobjectOptional
us_bank_account.account_holder_typestringOptionalOne of: company, individual
us_bank_account.account_numberstringOptionalMaximum length: 5000
us_bank_account.account_typestringOptionalOne of: checking, savings
us_bank_account.financial_connections_accountstringOptionalMaximum length: 5000
us_bank_account.routing_numberstringOptionalMaximum length: 5000
wechat_payobjectOptional
zipobjectOptional

Referenced models: Create a Setup Intent — request body — body payment method data billing details, Create a Setup Intent — request body — body payment method data eps

PostApplicationFeesIdRefund — response body — application / object: application
FieldTypePresenceDescription and constraints
$objectRoot
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the application.
Maximum length: 5000
name (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: application
Delete a customer — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer
Cancel a Setup Intent — response body — managed payments value enabled
FieldTypePresenceDescription and constraints
$objectRoot
enabledbooleanRequired within parentSet to `true` to enable [Managed Payments](https://docs.stripe.com/payments/managed-payments), Stripe's merchant of record solution, for this session.

SDK function policy ID: stripe.postsetupintents. Catalog operation: PostSetupIntents. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.