## Create a ConfirmationToken with Elements Convert payment information collected by Elements into a [ConfirmationToken](/api/confirmation_tokens.md) object. Use this method if you want to [confirm payment on your server](/payments/finalize-payments-on-the-server.md) or [confirm payment on a subsequent page](/payments/build-a-two-step-confirmation.md). `stripe.createConfirmationToken(options)` returns a `Promise` which resolves with a result object. This object has either: * `result.confirmationToken`: a [ConfirmationToken](/api/confirmation_tokens) was created successfully. * `result.error`: there was an error. This includes client-side validation errors. Refer to the [API reference](/api/errors) for all possible errors. **Syntax:** `stripe.createConfirmationToken(...)` - `options` (object) **required** - `elements` (object) **required** The [Elements](#payment_element_create) instance that was used to create the Express Checkout Element or Payment Element. Calling `stripe.createConfirmationToken` pulls payment method, billing address, and shipping address data from the Elements instance. - `params` (object) Parameters that will be passed on to the Stripe API. - `payment_method_data` (object) When you call `stripe.createConfirmationToken`, payment details are collected from Elements. You can include additional `payment_method_data` fields, which will be merged with the data collected from Elements. Refer to the [PaymentMethod API](/api/payment_methods/create.md) for a full list of parameters. - `billing_details` (object) [Billing information](/api/payment_methods/create.md#create_payment_method-billing_details) associated with the PaymentMethod that may be used or required by particular types of payment methods. - `allow_redisplay` ('unspecified' | 'always' | 'limited') Indicates whether the payment method can be displayed to the customer in subsequent checkout flows. The value passed here will override the [allow_redisplay](docs/api/payment_methods/object#payment_method_object-allow_redisplay) determined by the provided `elements` parameter. - `shipping` (object) The [shipping details](/api/payment_intents/object.md#payment_intent_object-shipping) for the payment, if collected. You can't specify `shipping` if `mode: 'setup'` is specified on the `elements` object. **Note**: When the [Address Element](/js/element/address_element.md) in shipping mode is being used, shipping address details are collected from the Address Element. You can also include additional `shipping` fields, which will be merged with the data collected from the Element, overriding any fields that were also collected by the Address Element. - `return_url` (string) The URL to redirect your customer back to after they authenticate or cancel their payment 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. ### Create a ConfirmationToken ```js stripe .createConfirmationToken({ elements, params: { payment_method_data: { billing_details: { name: 'Jenny Rosen', }, }, }, }) .then(function(result) { // Handle result.error or result.confirmationToken }); ``` ```es_next const {confirmationToken, error} = await stripe.createConfirmationToken({ elements, params: { payment_method_data: { billing_details: { name: 'Jenny Rosen', }, }, }, }); ```