Skip to content

Stripe: Create a test Confirmation Token

Stripe testHelpers.postTestHelpersConfirmationTokens: arguments, response, policy and SDK examples.

← Test helpers operations · Get started

Operation stripe.posttesthelpersconfirmationtokens

Provider route: POST /v1/test_helpers/confirmation_tokens. 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["testHelpers"]["postTestHelpersConfirmationTokens"]>[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.testHelpers.postTestHelpersConfirmationTokens(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.test_helpers.post_test_helpers_confirmation_tokens(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.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.payment_methodstringOptionalID of an existing PaymentMethod.
Maximum length: 5000
body.payment_method_dataobjectOptionalIf provided, this hash will be used to create a PaymentMethod.
body.payment_method_data.acss_debitobjectOptional
body.payment_method_data.acss_debit.account_numberstringRequired within parentMaximum length: 5000
body.payment_method_data.acss_debit.institution_numberstringRequired within parentMaximum length: 5000
body.payment_method_data.acss_debit.transit_numberstringRequired within parentMaximum length: 5000
body.payment_method_data.affirmobjectOptional
body.payment_method_data.afterpay_clearpayobjectOptional
body.payment_method_data.alipayobjectOptional
body.payment_method_data.allow_redisplaystringOptionalOne of: always, limited, unspecified
body.payment_method_data.almaobjectOptional
body.payment_method_data.amazon_payobjectOptional
body.payment_method_data.au_becs_debitobjectOptional
body.payment_method_data.au_becs_debit.account_numberstringRequired within parentMaximum length: 5000
body.payment_method_data.au_becs_debit.bsb_numberstringRequired within parentMaximum length: 5000
body.payment_method_data.bacs_debitobjectOptional
body.payment_method_data.bacs_debit.account_numberstringOptionalMaximum length: 5000
body.payment_method_data.bacs_debit.sort_codestringOptionalMaximum length: 5000
body.payment_method_data.bancontactobjectOptional
body.payment_method_data.billieobjectOptional
body.payment_method_data.billing_detailsModelOptionalExpand Create a Setup Intent — request body — body payment method data billing details
body.payment_method_data.bizumobjectOptional
body.payment_method_data.blikobjectOptional
body.payment_method_data.boletoobjectOptional
body.payment_method_data.boleto.tax_idstringRequired within parentMaximum length: 5000
body.payment_method_data.cashappobjectOptional
body.payment_method_data.cryptoobjectOptional
body.payment_method_data.customer_balanceobjectOptional
body.payment_method_data.epsModelOptionalExpand Create a Setup Intent — request body — body payment method data eps
body.payment_method_data.fpxobjectOptional
body.payment_method_data.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
body.payment_method_data.giropayobjectOptional
body.payment_method_data.grabpayobjectOptional
body.payment_method_data.idealobjectOptional
body.payment_method_data.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
body.payment_method_data.interac_presentobjectOptional
body.payment_method_data.kakao_payobjectOptional
body.payment_method_data.klarnaobjectOptional
body.payment_method_data.klarna.dobobjectOptional
body.payment_method_data.klarna.dob.dayintegerRequired within parent
body.payment_method_data.klarna.dob.monthintegerRequired within parent
body.payment_method_data.klarna.dob.yearintegerRequired within parent
body.payment_method_data.konbiniobjectOptional
body.payment_method_data.kr_cardobjectOptional
body.payment_method_data.linkobjectOptional
body.payment_method_data.mb_wayobjectOptional
body.payment_method_data.metadataobjectOptionalAdditional keys: see wildcard field
body.payment_method_data.metadata.*stringAdditional keys
body.payment_method_data.mobilepayobjectOptional
body.payment_method_data.multibancoobjectOptional
body.payment_method_data.naver_payobjectOptional
body.payment_method_data.naver_pay.fundingstringOptionalOne of: card, points
body.payment_method_data.nz_bank_accountobjectOptional
body.payment_method_data.nz_bank_account.account_holder_namestringOptionalMaximum length: 5000
body.payment_method_data.nz_bank_account.account_numberstringRequired within parentMaximum length: 5000
body.payment_method_data.nz_bank_account.bank_codestringRequired within parentMaximum length: 5000
body.payment_method_data.nz_bank_account.branch_codestringRequired within parentMaximum length: 5000
body.payment_method_data.nz_bank_account.referencestringOptionalMaximum length: 128
body.payment_method_data.nz_bank_account.suffixstringRequired within parentMaximum length: 5000
body.payment_method_data.oxxoobjectOptional
body.payment_method_data.p24objectOptional
body.payment_method_data.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
body.payment_method_data.pay_by_bankobjectOptional
body.payment_method_data.paycoobjectOptional
body.payment_method_data.paynowobjectOptional
body.payment_method_data.paypalobjectOptional
body.payment_method_data.paypayobjectOptional
body.payment_method_data.paytoobjectOptional
body.payment_method_data.payto.account_numberstringOptionalMaximum length: 5000
body.payment_method_data.payto.bsb_numberstringOptionalMaximum length: 5000
body.payment_method_data.payto.pay_idstringOptionalMaximum length: 5000
body.payment_method_data.pixobjectOptional
body.payment_method_data.promptpayobjectOptional
body.payment_method_data.radar_optionsobjectOptional
body.payment_method_data.radar_options.sessionstringOptionalMaximum length: 5000
body.payment_method_data.revolut_payobjectOptional
body.payment_method_data.samsung_payobjectOptional
body.payment_method_data.satispayobjectOptional
body.payment_method_data.scalapayobjectOptional
body.payment_method_data.sepa_debitobjectOptional
body.payment_method_data.sepa_debit.ibanstringRequired within parentMaximum length: 5000
body.payment_method_data.sequraobjectOptional
body.payment_method_data.sofortobjectOptional
body.payment_method_data.sofort.countrystringRequired within parentOne of: AT, BE, DE, ES, IT, NL
body.payment_method_data.sunbitobjectOptional
body.payment_method_data.swishobjectOptional
body.payment_method_data.twintobjectOptional
body.payment_method_data.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
body.payment_method_data.upiobjectOptional
body.payment_method_data.upi.mandate_optionsobjectOptional
body.payment_method_data.upi.mandate_options.amountintegerOptional
body.payment_method_data.upi.mandate_options.amount_typestringOptionalOne of: fixed, maximum
body.payment_method_data.upi.mandate_options.descriptionstringOptionalMaximum length: 20
body.payment_method_data.upi.mandate_options.end_dateintegerOptionalFormat: unix-time
body.payment_method_data.us_bank_accountobjectOptional
body.payment_method_data.us_bank_account.account_holder_typestringOptionalOne of: company, individual
body.payment_method_data.us_bank_account.account_numberstringOptionalMaximum length: 5000
body.payment_method_data.us_bank_account.account_typestringOptionalOne of: checking, savings
body.payment_method_data.us_bank_account.financial_connections_accountstringOptionalMaximum length: 5000
body.payment_method_data.us_bank_account.routing_numberstringOptionalMaximum length: 5000
body.payment_method_data.wechat_payobjectOptional
body.payment_method_data.zipobjectOptional
body.payment_method_optionsobjectOptionalPayment-method-specific configuration for this ConfirmationToken.
body.payment_method_options.cardobjectOptional
body.payment_method_options.card.installmentsobjectOptional
body.payment_method_options.card.installments.planobjectRequired within parent
body.payment_method_options.card.installments.plan.countintegerOptional
body.payment_method_options.card.installments.plan.intervalstringOptionalOne of: month
body.payment_method_options.card.installments.plan.typestringRequired within parentOne of: bonus, fixed_count, revolving
body.return_urlstringOptionalReturn URL used to confirm the Intent.
body.setup_future_usagestringOptionalIndicates that you intend to make future payments with this ConfirmationToken’s payment method.

The presence of this property will [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
One of: off_session, on_session
body.shippingobjectOptionalShipping information for this ConfirmationToken.
body.shipping.addressobjectRequired within parent
body.shipping.address.citystringOptionalMaximum length: 5000
body.shipping.address.countrystringOptionalMaximum length: 5000
body.shipping.address.line1stringOptionalMaximum length: 5000
body.shipping.address.line2stringOptionalMaximum length: 5000
body.shipping.address.postal_codestringOptionalMaximum length: 5000
body.shipping.address.statestringOptionalMaximum length: 5000
body.shipping.namestringRequired within parentMaximum length: 5000
body.shipping.phoneJSONOptional
body.shipping.phone (anyOf 1)stringAlternativeMaximum length: 5000
body.shipping.phone (anyOf 2)stringAlternativeOne of:

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

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieve a Confirmation Token — response body

Referenced models: Retrieve a Confirmation Token — response body

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

Retrieve a Confirmation Token — response body
FieldTypePresenceDescription and constraints
$objectRootConfirmationTokens help transport client side data collected by Stripe JS over
to your server for confirming a PaymentIntent or SetupIntent. If the confirmation
is successful, values present on the ConfirmationToken are written onto the Intent.

To learn more about how to use ConfirmationToken, visit the related guides:
- [Finalize payments on the server](https://docs.stripe.com/payments/finalize-payments-on-the-server)
- [Build two-step confirmation](https://docs.stripe.com/payments/build-a-two-step-confirmation).
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
expires_atJSONOptional
expires_at (anyOf 1)JSONAlternative
expires_at (anyOf 1) (anyOf 1)integerAlternativeTime at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent.
Format: unix-time
expires_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
expires_at (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
mandate_dataJSONOptional
mandate_data (anyOf 1)JSONAlternativeData used for generating a Mandate.
mandate_data (anyOf 1) (anyOf 1)ModelAlternativeExpand Retrieve a Confirmation Token — response body — mandate data Data used for generating a Mandate Data used for generating a Mandate
mandate_data (anyOf 2)nullAlternative
metadataJSONOptional
metadata (anyOf 1)objectAlternativeSet 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.
Additional keys: see wildcard field
metadata (anyOf 1).*stringAdditional keysMaximum length: 500
metadata (anyOf 2)nullAlternative
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: confirmation_token
payment_intentJSONOptional
payment_intent (anyOf 1)stringAlternativeID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
Maximum length: 5000
payment_intent (anyOf 2)nullAlternative
payment_method_optionsJSONOptional
payment_method_options (anyOf 1)JSONAlternativePayment-method-specific configuration for this ConfirmationToken.
payment_method_options (anyOf 1) (anyOf 1)ModelAlternativeExpand Retrieve a Confirmation Token — response body — payment method options value Payment-method-specific configuration
payment_method_options (anyOf 2)nullAlternative
payment_method_previewJSONOptional
payment_method_preview (anyOf 1)JSONAlternativePayment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
payment_method_preview (anyOf 1) (anyOf 1)ModelAlternativeExpand Retrieve a ConfirmationToken — response body — payment_method_preview / value / allow_redisplay: always, limited, unspecified
payment_method_preview (anyOf 2)nullAlternative
return_urlJSONOptional
return_url (anyOf 1)stringAlternativeReturn URL used to confirm the Intent.
Maximum length: 5000
return_url (anyOf 2)nullAlternative
setup_future_usageJSONOptional
setup_future_usage (anyOf 1)stringAlternativeIndicates that you intend to make future payments with this ConfirmationToken's payment method.

The presence of this property will [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
Known values: off_session, on_session
setup_future_usage (anyOf 2)nullAlternative
setup_intentJSONOptional
setup_intent (anyOf 1)stringAlternativeID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
Maximum length: 5000
setup_intent (anyOf 2)nullAlternative
shippingJSONOptional
shipping (anyOf 1)JSONAlternativeShipping information collected on this ConfirmationToken.
shipping (anyOf 1) (anyOf 1)ModelAlternativeExpand Retrieve a Confirmation Token — response body — shipping value address, name, phone
shipping (anyOf 2)nullAlternative
use_stripe_sdkbooleanRequired within parentIndicates whether the Stripe SDK is used to handle confirmation flow. Defaults to `true` on ConfirmationToken.

Referenced models: Retrieve a Confirmation Token — response body — mandate data Data used for generating a Mandate Data used for generating a Mandate, Retrieve a Confirmation Token — response body — payment method options value Payment-method-specific configuration, Retrieve a ConfirmationToken — response body — payment_method_preview / value / allow_redisplay: always, limited, unspecified, Retrieve a Confirmation Token — response body — shipping value address, name, phone

Create a Setup Intent — request body — body payment method data billing details
FieldTypePresenceDescription and constraints
$objectRoot
addressJSONOptional
address (anyOf 1)objectAlternative
address (anyOf 1).citystringOptionalMaximum length: 5000
address (anyOf 1).countrystringOptionalMaximum length: 5000
address (anyOf 1).line1stringOptionalMaximum length: 5000
address (anyOf 1).line2stringOptionalMaximum length: 5000
address (anyOf 1).postal_codestringOptionalMaximum length: 5000
address (anyOf 1).statestringOptionalMaximum length: 5000
address (anyOf 2)stringAlternativeOne of:
emailJSONOptional
email (anyOf 1)stringAlternative
email (anyOf 2)stringAlternativeOne of:
nameJSONOptional
name (anyOf 1)stringAlternativeMaximum length: 5000
name (anyOf 2)stringAlternativeOne of:
phoneJSONOptional
phone (anyOf 1)stringAlternativeMaximum length: 5000
phone (anyOf 2)stringAlternativeOne of:
tax_idstringOptionalMaximum length: 5000
Create a Setup Intent — request body — body payment method data eps
FieldTypePresenceDescription and constraints
$objectRoot
bankstringOptionalOne of: arzte_und_apotheker_bank, austrian_anadi_bank_ag, bank_austria, bankhaus_carl_spangler, bankhaus_schelhammer_und_schattera_ag, bawag_psk_ag, bks_bank_ag, brull_kallmus_bank_ag, btv_vier_lander_bank, capital_bank_grawe_gruppe_ag, deutsche_bank_ag, dolomitenbank, easybank_ag, erste_bank_und_sparkassen, hypo_alpeadriabank_international_ag, hypo_bank_burgenland_aktiengesellschaft, hypo_noe_lb_fur_niederosterreich_u_wien, hypo_oberosterreich_salzburg_steiermark, hypo_tirol_bank_ag, hypo_vorarlberg_bank_ag, marchfelder_bank, oberbank_ag, raiffeisen_bankengruppe_osterreich, schoellerbank_ag, sparda_bank_wien, volksbank_gruppe, volkskreditbank_ag, vr_bank_braunau
Maximum length: 5000
Retrieve a Confirmation Token — response body — mandate data Data used for generating a Mandate Data used for generating a Mandate
FieldTypePresenceDescription and constraints
$objectRootData used for generating a Mandate.
customer_acceptanceModelRequired within parentExpand Retrieve a Confirmation Token — response body — mandate data Data used for generating a Mandate Data used for generating a Mandate customer acceptance

Referenced models: Retrieve a Confirmation Token — response body — mandate data Data used for generating a Mandate Data used for generating a Mandate customer acceptance

Retrieve a Confirmation Token — response body — payment method options value Payment-method-specific configuration
FieldTypePresenceDescription and constraints
$objectRootPayment-method-specific configuration
cardJSONOptional
card (anyOf 1)JSONAlternativeThis hash contains the card payment method options.
card (anyOf 1) (anyOf 1)ModelAlternativeExpand Retrieve a Confirmation Token — response body — payment method options value Payment-method-specific configuration card This hash contains the card payment method options This hash contains the card payment method options
card (anyOf 2)nullAlternative

Referenced models: Retrieve a Confirmation Token — response body — payment method options value Payment-method-specific configuration card This hash contains the card payment method options This hash contains the card payment method options

Create a Payment Method — response body — zip
FieldTypePresenceDescription and constraints
$objectRoot

SDK function policy ID: stripe.posttesthelpersconfirmationtokens. Catalog operation: PostTestHelpersConfirmationTokens. 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.