Create a test Confirmation Token ​
Creates a test mode Confirmation Token server side for your integration tests.
Returns ​
Returns a testmode Confirmation Token
Parameters ​
payment_method(string, optional) ID of an existing PaymentMethod.payment_method_data(object, optional) If provided, this hash will be used to create a PaymentMethod.payment_method_data.type(enum, required) The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.payment_method_data.acss_debit(object, optional) If this is anacss_debitPaymentMethod, this hash contains details about the ACSS Debit payment method.payment_method_data.acss_debit.account_number(string, required) Customer’s bank account number.payment_method_data.acss_debit.institution_number(string, required) Institution number of the customer’s bank.payment_method_data.acss_debit.transit_number(string, required) Transit number of the customer’s bank.
payment_method_data.affirm(object, optional) If this is anaffirmPaymentMethod, this hash contains details about the Affirm payment method.payment_method_data.afterpay_clearpay(object, optional) If this is anAfterpayClearpayPaymentMethod, this hash contains details about the AfterpayClearpay payment method.payment_method_data.alipay(object, optional) If this is anAlipayPaymentMethod, this hash contains details about the Alipay payment method.payment_method_data.allow_redisplay(enum, optional) This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults tounspecified. Possible enum values:alwaysUsealwaysto indicate that this payment method can always be shown to a customer in a checkout flow.limitedUselimitedto indicate that this payment method can’t always be shown to a customer in a checkout flow. For example, it can only be shown in the context of a specific subscription.unspecifiedThis is the default value for payment methods whereallow_redisplaywasn’t set.
payment_method_data.alma(object, optional) If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.payment_method_data.amazon_pay(object, optional) If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.payment_method_data.au_becs_debit(object, optional) If this is anau_becs_debitPaymentMethod, this hash contains details about the bank account.payment_method_data.au_becs_debit.account_number(string, required) The account number for the bank account.payment_method_data.au_becs_debit.bsb_number(string, required) Bank-State-Branch number of the bank account.
payment_method_data.bacs_debit(object, optional) If this is abacs_debitPaymentMethod, this hash contains details about the Bacs Direct Debit bank account.payment_method_data.bacs_debit.account_number(string, optional) Account number of the bank account that the funds will be debited from.payment_method_data.bacs_debit.sort_code(string, optional) Sort code of the bank account. (e.g.,10-20-30)
payment_method_data.bancontact(object, optional) If this is abancontactPaymentMethod, this hash contains details about the Bancontact payment method.payment_method_data.billie(object, optional) If this is abilliePaymentMethod, this hash contains details about the Billie payment method.payment_method_data.billing_details(object, optional) Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.payment_method_data.billing_details.address(object, optional) Billing address.payment_method_data.billing_details.address.city(string, optional) City, district, suburb, town, or village.payment_method_data.billing_details.address.country(string, optional) Two-letter country code (ISO 3166-1 alpha-2).payment_method_data.billing_details.address.line1(string, optional) Address line 1, such as the street, PO Box, or company name.payment_method_data.billing_details.address.line2(string, optional) Address line 2, such as the apartment, suite, unit, or building.payment_method_data.billing_details.address.postal_code(string, optional) ZIP or postal code.payment_method_data.billing_details.address.state(string, optional) State, county, province, or region (ISO 3166-2).
payment_method_data.billing_details.email(string, optional) Email address.The maximum length is 800 characters.
payment_method_data.billing_details.name(string, optional) Full name.payment_method_data.billing_details.phone(string, optional) Billing phone number (including extension).payment_method_data.billing_details.tax_id(string, optional) Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
payment_method_data.blik(object, optional) If this is ablikPaymentMethod, this hash contains details about the BLIK payment method.payment_method_data.boleto(object, optional) If this is aboletoPaymentMethod, this hash contains details about the Boleto payment method.payment_method_data.boleto.tax_id(string, required) The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
payment_method_data.cashapp(object, optional) If this is acashappPaymentMethod, this hash contains details about the Cash App Pay payment method.payment_method_data.crypto(object, optional) If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.payment_method_data.customer_balance(object, optional) If this is acustomer_balancePaymentMethod, this hash contains details about the CustomerBalance payment method.payment_method_data.eps(object, optional) If this is anepsPaymentMethod, this hash contains details about the EPS payment method.payment_method_data.eps.bank(string, optional) The customer’s bank.
payment_method_data.fpx(object, optional) If this is anfpxPaymentMethod, this hash contains details about the FPX payment method.payment_method_data.fpx.bank(string, required) The customer’s bank.
payment_method_data.giropay(object, optional) If this is agiropayPaymentMethod, this hash contains details about the Giropay payment method.payment_method_data.grabpay(object, optional) If this is agrabpayPaymentMethod, this hash contains details about the GrabPay payment method.payment_method_data.ideal(object, optional) If this is anidealPaymentMethod, this hash contains details about the iDEAL payment method.payment_method_data.ideal.bank(string, optional) The customer’s bank. Only use this parameter for existing customers. Don’t use it for new customers.
payment_method_data.interac_present(object, optional) If this is aninterac_presentPaymentMethod, this hash contains details about the Interac Present payment method.payment_method_data.kakao_pay(object, optional) If this is akakao_payPaymentMethod, this hash contains details about the Kakao Pay payment method.payment_method_data.klarna(object, optional) If this is aklarnaPaymentMethod, this hash contains details about the Klarna payment method.payment_method_data.klarna.dob(object, optional) Customer’s date of birthpayment_method_data.klarna.dob.day(integer, required) The day of birth, between 1 and 31.payment_method_data.klarna.dob.month(integer, required) The month of birth, between 1 and 12.payment_method_data.klarna.dob.year(integer, required) The four-digit year of birth.
payment_method_data.konbini(object, optional) If this is akonbiniPaymentMethod, this hash contains details about the Konbini payment method.payment_method_data.kr_card(object, optional) If this is akr_cardPaymentMethod, this hash contains details about the Korean Card payment method.payment_method_data.link(object, optional) If this is anLinkPaymentMethod, this hash contains details about the Link payment method.payment_method_data.mb_way(object, optional) If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.payment_method_data.metadata(object, optional) 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 tometadata.payment_method_data.mobilepay(object, optional) If this is amobilepayPaymentMethod, this hash contains details about the MobilePay payment method.payment_method_data.multibanco(object, optional) If this is amultibancoPaymentMethod, this hash contains details about the Multibanco payment method.payment_method_data.naver_pay(object, optional) If this is anaver_payPaymentMethod, this hash contains details about the Naver Pay payment method.payment_method_data.naver_pay.funding(enum, optional) Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults tocard. Possible enum values:cardUse a card to fund this transaction.pointsUse Naver Pay points to fund this transaction.
payment_method_data.nz_bank_account(object, optional) If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.payment_method_data.nz_bank_account.account_number(string, required) The account number for the bank account.payment_method_data.nz_bank_account.bank_code(string, required) The numeric code for the bank account’s bank.payment_method_data.nz_bank_account.branch_code(string, required) The numeric code for the bank account’s bank branch.payment_method_data.nz_bank_account.suffix(string, required) The suffix of the bank account number.payment_method_data.nz_bank_account.account_holder_name(string, optional) The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
payment_method_data.oxxo(object, optional) If this is anoxxoPaymentMethod, this hash contains details about the OXXO payment method.payment_method_data.p24(object, optional) If this is ap24PaymentMethod, this hash contains details about the P24 payment method.payment_method_data.p24.bank(enum, optional) The customer’s bank.
payment_method_data.pay_by_bank(object, optional) If this is apay_by_bankPaymentMethod, this hash contains details about the PayByBank payment method.payment_method_data.payco(object, optional) If this is apaycoPaymentMethod, this hash contains details about the PAYCO payment method.payment_method_data.paynow(object, optional) If this is apaynowPaymentMethod, this hash contains details about the PayNow payment method.payment_method_data.paypal(object, optional) If this is apaypalPaymentMethod, this hash contains details about the PayPal payment method.payment_method_data.paypay(object, optional) If this is apaypayPaymentMethod, this hash contains details about the PayPay payment method.payment_method_data.payto(object, optional) If this is apaytoPaymentMethod, this hash contains details about the PayTo payment method.payment_method_data.payto.account_number(string, optional) The account number for the bank account.payment_method_data.payto.bsb_number(string, optional) Bank-State-Branch number of the bank account.payment_method_data.payto.pay_id(string, optional) The PayID alias for the bank account.
payment_method_data.pix(object, optional) If this is apixPaymentMethod, this hash contains details about the Pix payment method.payment_method_data.promptpay(object, optional) If this is apromptpayPaymentMethod, this hash contains details about the PromptPay payment method.payment_method_data.radar_options(object, optional) Options to configure Radar. See Radar Session for more information.payment_method_data.radar_options.session(string, optional) A Radar Session is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
payment_method_data.revolut_pay(object, optional) If this is arevolut_payPaymentMethod, this hash contains details about the Revolut Pay payment method.payment_method_data.samsung_pay(object, optional) If this is asamsung_payPaymentMethod, this hash contains details about the SamsungPay payment method.payment_method_data.satispay(object, optional) If this is asatispayPaymentMethod, this hash contains details about the Satispay payment method.payment_method_data.sepa_debit(object, optional) If this is asepa_debitPaymentMethod, this hash contains details about the SEPA debit bank account.payment_method_data.sepa_debit.iban(string, required) IBAN of the bank account.
payment_method_data.sofort(object, optional) If this is asofortPaymentMethod, this hash contains details about the SOFORT payment method.payment_method_data.sofort.country(enum, required) Two-letter ISO code representing the country the bank account is located in. Possible enum values:ATAustriaBEBelgiumDEGermanyESSpainITItalyNLNetherlands
payment_method_data.sunbit(object, optional) If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method.payment_method_data.swish(object, optional) If this is aswishPaymentMethod, this hash contains details about the Swish payment method.payment_method_data.twint(object, optional) If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.payment_method_data.upi(object, optional) If this is aupiPaymentMethod, this hash contains details about the UPI payment method.payment_method_data.upi.mandate_options(object, optional) Configuration options for setting up an eMandatepayment_method_data.upi.mandate_options.amount(integer, optional) Amount to be charged for future payments.payment_method_data.upi.mandate_options.amount_type(enum, optional) One offixedormaximum. Iffixed, theamountparam refers to the exact amount to be charged in future payments. Ifmaximum, the amount charged can be up to the value passed for theamountparam. Possible enum values:fixedIffixed, theamountparam refers to the exact amount to be charged in future payments.maximumIfmaximum, the amount charged can be up to the value passed for theamountparam.
payment_method_data.upi.mandate_options.description(string, optional) A description of the mandate or subscription that is meant to be displayed to the customer.The maximum length is 20 characters.
payment_method_data.upi.mandate_options.end_date(timestamp, optional) End date of the mandate or subscription.
payment_method_data.us_bank_account(object, optional) If this is anus_bank_accountPaymentMethod, this hash contains details about the US bank account payment method.payment_method_data.us_bank_account.account_holder_type(enum, optional) Account holder type: individual or company. Possible enum values:companyAccount belongs to a companyindividualAccount belongs to an individual
payment_method_data.us_bank_account.account_number(string, optional) Account number of the bank account.payment_method_data.us_bank_account.account_type(enum, optional) Account type: checkings or savings. Defaults to checking if omitted. Possible enum values:checkingBank account type is checkingsavingsBank account type is savings
payment_method_data.us_bank_account.financial_connections_account(string, optional) The ID of a Financial Connections Account to use as a payment method.payment_method_data.us_bank_account.routing_number(string, optional) Routing number of the bank account.
payment_method_data.wechat_pay(object, optional) If this is anwechat_payPaymentMethod, this hash contains details about the wechat_pay payment method.payment_method_data.zip(object, optional) If this is azipPaymentMethod, this hash contains details about the Zip payment method.
payment_method_options(object, optional) Payment-method-specific configuration for this ConfirmationToken.payment_method_options.card(object, optional) Configuration for any card payments confirmed using this ConfirmationToken.payment_method_options.card.installments(object, optional) Installment configuration for payments confirmed using this ConfirmationToken.payment_method_options.card.installments.plan(object, required) The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation.payment_method_options.card.installments.plan.type(enum, required) Type of installment plan, one offixed_count,bonus, orrevolving. Possible enum values:bonusAn installment plan used in Japan, where the customer defers payment to a later date that aligns with their salary bonus.fixed_countAn installment plan where the number of installment payments is fixed and known at the time of purchase.revolvingAn installment plan used in Japan, where the customer pays a certain amount each month, and the remaining balance rolls over to the next month.
payment_method_options.card.installments.plan.count(integer, optional) Forfixed_countinstallment plans, this is required. It represents the number of installment payments your customer will make to their credit card.payment_method_options.card.installments.plan.interval(enum, optional) Forfixed_countinstallment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One ofmonth. Possible enum values:month
return_url(string, optional) Return URL used to confirm the Intent.setup_future_usage(enum, optional) Indicates that you intend to make future payments with this ConfirmationToken’s payment method.The presence of this property will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. Possible enum values:
off_sessionUseoff_sessionif your customer may or may not be present in your checkout flow.on_sessionUseon_sessionif you intend to only reuse the payment method when your customer is present in your checkout flow.
shipping(object, optional) Shipping information for this ConfirmationToken.shipping.address(object, required) Shipping addressshipping.address.city(string, optional) City, district, suburb, town, or village.shipping.address.country(string, required for calculating taxes) Two-letter country code (ISO 3166-1 alpha-2).shipping.address.line1(string, optional) Address line 1, such as the street, PO Box, or company name.shipping.address.line2(string, optional) Address line 2, such as the apartment, suite, unit, or building.shipping.address.postal_code(string, required for calculating taxes) ZIP or postal code.shipping.address.state(string, optional) State, county, province, or region (ISO 3166-2).
shipping.name(string, required) Recipient name.shipping.phone(string, optional) Recipient phone (including extension)
curl
curl https://api.stripe.com/v1/test_helpers/confirmation_tokens \
-u "<<YOUR_SECRET_KEY>>" \
-d payment_method=pm_card_visaResponse ​
json
{
"id": "ctoken_1Ow71CL4FhS6zgoxWjxc7sfr",
"object": "confirmation_token",
"created": 1710871450,
"expires_at": 1710914650,
"livemode": false,
"payment_intent": null,
"payment_method_preview": {
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "unchecked"
},
"country": "US",
"display_brand": "visa",
"exp_month": 3,
"exp_year": 2025,
"fingerprint": "jbGyCKrSRsFpOBWP",
"funding": "credit",
"generated_from": null,
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"type": "card"
},
"return_url": null,
"setup_future_usage": null,
"setup_intent": null,
"shipping": null,
"use_stripe_sdk": true
}