Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
    Overview
    Quickstarts
    Customize look and feel
    Collect additional information
    Collect taxes
    Dynamically update checkout
    Manage your product catalog
    Subscriptions
    Manage payment methods
      Add one-click buttons
      Migrate payment methods to the Dashboard
    Let customers pay in their local currency
    Add discounts, upsells, and optional items
    Set up future payments
    Save payment details during payment
    Manually approve payments on your server
    After the payment
    Elements with Checkout Sessions API beta changelog
    Migrate from legacy Checkout
    Migrate Checkout to use Prices
Build an advanced integration
Build an in-app integration
Payment methods
Add payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsBuild a checkout pageManage payment methods

Add one-click payment buttons

Use one-click payment options, such as Apple Pay or Google Pay.

Copy page
Express Checkout Element

The Express Checkout Element is an integration for accepting payments through one-click payment methods buttons. Supported payment methods include Link, Apple Pay, Google Pay, PayPal, Klarna, and Amazon Pay.

Try the demo

In the following demo, you can toggle some of the prebuilt options to change the background color, layout, size, and shipping address collection of the payment interface. The demo displays Google Pay and Apple Pay only on their available platforms. Payment Method buttons are only shown in their supported countries.

If you don’t see the demo, try viewing this page in a supported browser.

Prerequisites

Before you start, you must:

  • Enable Link, Apple Pay, Google Pay, PayPal, or Amazon Pay in the Dashboard.
  • Add a payment method to your browser. For example, you can add a card to your Google Pay account or to your Wallet for Safari.
  • Serve your application over HTTPS. This is required in development and in production. You can use a service such as ngrok.
  • Register your domain in both your testing environment and live mode.

Handle one-click payments

The Express Checkout Element emits the confirm event when your customer finalizes their payment. Create a handler that responds to the event by calling confirm and pass it to the Express Checkout Element.

The event also contains the following fields:

  • expressPaymentType: One of 'apple_pay', 'google_pay', 'link', 'paypal', 'klarna', or 'amazon_pay'.
  • billingDetails: Object containing information about the customer’s billing details.
  • shippingAddress: Object containing information about the customer’s shipping address.
  • shippingRate: Object containing information about the selected shipping rate.
index.html
<div id="express-checkout-element"></div>
checkout.js
const expressCheckoutElement = checkout.createExpressCheckoutElement(); expressCheckoutElement.on('confirm', (event) => { checkout.confirm({expressCheckoutConfirmEvent: event}) }); expressCheckoutElement.mount('#express-checkout-element');

The following options are also supported:

  • buttonHeight
  • buttonTheme
  • layout
  • paymentMethodOrder
  • paymentMethods
    • Note: Both your Dashboard configuration and Checkout configuration affect the availability of payment methods in the Express Checkout Element. By default, it displays all available payment methods based on both configurations. If you set the paymentMethods option, the Express Checkout Element merges your specified options with the default logic to determine the final set of payment methods displayed.

Collect additional customer details

You can collect additional information from the Express Checkout Element by configuring options on your Checkout Session, such as phone_number_collection, shipping_address_collection, and shipping_options.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price]"={{PRICE_ID}} \ -d "line_items[0][quantity]"=1 \ -d mode=payment \ -d ui_mode=custom \ -d return_url={{RETURN_URL}} \ -d "phone_number_collection[enabled]"=true \ -d "shipping_address_collection[allowed_countries][0]"=US \ -d "shipping_options[0][shipping_rate]"=
{{SHIPPING_RATE_ID}}
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc