## Confirm the Checkout Session Use this method to confirm the Checkout Session. You must either read [total.total.amount](/js/custom_checkout/session_object.md#custom_checkout_session_object-total-total-amount) or each of [total.total.minorUnitsAmount](/js/custom_checkout/session_object.md#custom_checkout_session_object-total-total-minorUnitsAmount) and [currency](/js/custom_checkout/session_object.md#custom_checkout_session_object-currency) and [minorUnitsAmountDivisor](/js/custom_checkout/session_object.md#custom_checkout_session_object-minorUnitsAmountDivisor) from the checkout object and display in your UI, otherwise an error will be thrown. This helps keep your checkout page in sync as the Checkout Session updates, including adding future Stripe features, with minimal UI code changes. This method returns a `Promise` that resolves with an object containing the following fields: * `type`: one of either `"success"` or `"error"` * `session`: only populated when `type` is `"success"`. Contains a [Session](/js/custom_checkout/session_object) instance representing the updated state. * `error`: only populated when `type` is `"error"`. Contains an object with a string `message` field which can be displayed to your customer. - `options` (object) Options for `confirm`. - `returnUrl` (string) The URL to redirect your customer to after they authenticate or cancel their payment on the payment method’s app or site. This parameter is only required if you didn't specify the `return_url` when creating the Checkout Session. - `paymentMethod` (string) The ID of a previously collected [PaymentMethod](/api/payment_methods/object.md) to use for confirmation. When this option is provided, Custom Checkout will ignore the payment method collected by the PaymentElement and attempt confirmation using the provided PaymentMethod. - `savePaymentMethod` (boolean) Whether your Customer has provided consent to save the payment method for future purchases. Learn how to [save payment methods](/checkout/custom-checkout/save-payment-methods-checkout.md). - `redirect` ('always' | 'if_required') By default, `confirm` will always redirect to your `returnUrl` after a successful confirmation. If you set `redirect: "if_required"`, then `confirm` will only redirect if your user chooses a redirect-based payment method. - `email` (string) The Customer's email address. If provided, this value overrides any values previously set using [updateEmail](/js/custom_checkout/update_email.md). - `phoneNumber` (string) The Customer's phone number. If provided, this value overrides any values previously set using [updatePhoneNumber](/js/custom_checkout/update_phone_number.md). - `billingAddress` (object) The Customer's billing address. If provided, this value overrides any values previously set using [updateBillingAddress](/js/custom_checkout/update_billing_address.md). - `name` (optional string) Full name. - `address` (optional object) Address. - `country` (string) **required** Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - `line1` (optional string) Address line 1 (e.g., street, PO Box, or company name). - `line2` (optional string) Address line 2 (e.g., apartment, suite, unit, or building). - `city` (optional string) City, district, suburb, town, or village. - `postal_code` (optional string) ZIP or postal code. - `state` (optional string) State, county, province, or region. - `shippingAddress` (object) The Customer's shipping address. If provided, this value overrides any values previously set using [updateShippingAddress](/js/custom_checkout/update_shipping_address.md). - `name` (optional string) Full name. - `address` (optional object) Address. - `country` (string) **required** Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - `line1` (string) **required** Address line 1 (e.g., street, PO Box, or company name). - `line2` (optional string) Address line 2 (e.g., apartment, suite, unit, or building). - `city` (optional string) City, district, suburb, town, or village. - `postal_code` (optional string) ZIP or postal code. - `state` (optional string) State, county, province, or region. - `expressCheckoutConfirmEvent` (object) The [event object](/js/elements_object/express_checkout_element_confirm_event.md#express_checkout_element_on_confirm-handler) passed to your Express Checkout Element `confirm` handler. ### Confirm the Checkout Session ```jsx const checkoutState = useCheckout(); if (checkoutState.type === 'success') { const {confirm} = checkoutState.checkout; confirm({ returnUrl: 'RETURN_URL', }); } ```