Accept a payment with the Express Checkout Element
Use a single integration to accept payments through one-click payment buttons.
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.
Customers see different payment buttons depending on what their device and browser combination supports. Compatible devices automatically support Google Pay and Link. Supporting Apple Pay and PayPal requires additional steps.
Option | Description |
---|---|
Merchant country | Set this using the publishable key that you use to initialize Stripe.js. To change the country, you must unmount the Express Checkout Element, update the publishable key, then re-mount the Express Checkout Element. |
Background color | Set colors using the Elements Appearance API. Button themes are inherited from the Appearance API but you can also define them directly when you create the Element. |
Desktop and mobile size | Use the dropdown to set the max pixel width of the parent element that the Express Checkout Element is mounted to. You can set it to 750px (Desktop) or 320px (Mobile). |
Max columns and max rows | Set these values using the layout parameter when you Create the Express Checkout Element. |
Overflow menu | Set this using the layout parameter when you Create the Express Checkout Element. |
Collect shipping address | To collect shipping information, you must pass options when creating the Express Checkout Element. Learn more about collecting customer details and displaying line items. |
We recommend that you collect payment details before creating an Intent when using the Express Checkout Element. If you previously integrated with the Payment Element, you might need to update your integration to this preferred approach.
Before you begin
- 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 a sandbox and live mode.
- Create a PayPal Sandbox account to test your integration.
Set up StripeServer-side
First, create a Stripe account or sign in.
Use our official libraries to access the Stripe API from your application:
Enable payment methods
By default, Stripe uses your payment methods settings to determine which payment methods are enabled in the Express Checkout Element.
To manually override which payment methods are enabled, list any that you want to enable using the payment_
attribute.
- If you collect payments before creating an intent, then list payment methods in the
paymentMethodTypes
attribute on your Elements provider options. - If you create an intent before rendering Elements, then list payment methods in the
payment_
attribute on your Intent.method_ types
Supported payment methods
Apple Pay and Google Pay are automatically enabled when using card
payment method type. When using Link, you must also pass the card
payment method type.
Payment method name | Payment method API parameters |
---|---|
Apple Pay | card |
Google Pay | card |
Link | link, card |
PayPal | paypal |
Amazon Pay | amazon_ |
Klarna | klarna |
OptionalAdditional Elements optionsClient-side
The Elements object accepts additional options that influence payment collection. Based on the options provided, the Express Checkout Element displays available payment methods from those you’ve enabled. Learn more about payment method support.
Property | Type | Description | Required |
---|---|---|---|
mode |
| Indicates whether the Express Checkout Element is used with a PaymentIntent, SetupIntent, or Subscription. | Yes |
currency | string | The currency of the amount to charge the customer. | Yes |
amount | number | The amount to charge the customer, shown in Apple Pay, Google Pay, or BNPL UIs. | For payment and subscription mode |
setupFutureUsage |
| Indicates that you intend to make future payments with the payment details collected by the Express Checkout Element. Not supported for PayPal or Klarna using the Express Checkout Element. | No |
captureMethod |
| Controls when to capture the funds from the customer’s account. | No |
onBehalfOf | string | Connect only. The Stripe account ID, which is the business of record. See use cases to determine if this option is relevant for your integration. | No |
paymentMethodTypes | string[] | A list of payment method types to render. You can omit this attribute to manage your payment methods in the Stripe Dashboard. | No |
paymentMethodConfiguration | string | The payment method configuration to use when managing your payment methods in the Stripe Dashboard. If not specified, your default configuration is used. | No |
paymentMethodCreation | manual | Allows PaymentMethods to be created from the Elements instance using stripe.createPaymentMethod. | No |
paymentMethodOptions | {us_ | Verification options for the us_ payment method. Accepts the same verification methods as Payment Intents. | No |
paymentMethodOptions | {card: {installments: {enabled: boolean}}} | Allows manually enabling the card installment plan selection UI if applicable when you aren’t managing your payment methods in the Stripe Dashboard. You must set mode='payment' and explicitly specify paymentMethodTypes . Otherwise an error is raised. Incompatible with paymentMethodCreation='manual' . | No |
Create and mount the Express Checkout ElementClient-side
The Express Checkout Element contains an iframe that securely sends the payment information to Stripe over an HTTPS connection. The checkout page address must also start with https://
, rather than http://
, for your integration to work.
Collect customer details and display line itemsClient-side
Pass options when creating the Express Checkout Element.
OptionalListen to the ready eventClient-side
After mounting, the Express Checkout Element won’t show buttons for a brief period. To animate the Element when buttons appear, listen to the ready event. Inspect the availablePaymentMethods
value to determine which buttons, if any, display in the Express Checkout Element.
OptionalControl when to show payment buttonsClient-side
You can manage the payment methods that appear in the Express Checkout Element in several ways:
- In the Stripe Dashboard’s payment methods settings.
- By using the paymentMethods property to disable payment buttons. Using this property gives you finer control over what your customers see.
The Express Checkout Element displays Apple Pay or Google Pay when the customer is on a supported platform and has an active card. If you want to always display Apple Pay and Google Pay even when the customer doesn’t have an active card, you can also configure this with paymentMethods
.
OptionalStyle the buttonClient-side
You can style each payment method button differently. For examples of button themes and types, see Google’s and Apple’s resources. You can also use the borderRadius
variable in the Appearance API:
OptionalCreate a ConfirmationTokenClient-side
When the customer authorizes a payment, you can create a ConfirmationToken to send to your server for additional validation or business logic prior to confirmation. You must immediately use the created ConfirmationToken to confirm a PaymentIntent or SetupIntent.
Create a PaymentIntentServer-side
Stripe uses a PaymentIntent object to represent your intent to collect payment from a customer, tracking charge attempts and payment state changes throughout the process.
Create a PaymentIntent on your server with an amount and currency. This must match what you set on the stripe.
instance in step 3. Always decide how much to charge on the server-side, a trusted environment, as opposed to the client-side. This prevents malicious customers from choosing their own prices.
The returned PaymentIntent includes a client secret, which the client-side uses to securely complete the payment process instead of passing the entire PaymentIntent object. You can use different approaches to pass the client secret to the client-side.
Submit the payment to StripeClient-side
Use stripe.confirmPayment to complete the payment using details from the Express Checkout Element.
Note
For Amazon Pay, Klarna, and PayPal, the amount you confirm in the PaymentIntent must match the amount the buyer pre-authorized. If the amounts don’t match, the payment is declined.
Provide a return_url to this function to indicate where Stripe should redirect the user after they complete the payment. Your user might be initially redirected to an intermediate site before being redirected to the return_
. Payments immediately redirect to the return_
when a payment is successful.
If you don’t want to redirect after payment completion, set redirect to if_
. This only redirects customers that check out with redirect-based payment methods.
Test the integration
Before you go live, test each payment method integration. To determine a payment method’s browser compatibility, see supported browsers. If you use the Express Checkout Element within an iframe, the iframe must have the allow attribute set to payment *
.
OptionalUse the Express Checkout Element with Stripe Connect
Connect platforms that either create direct charges or add the token to a Customer
on the connected account must take additional steps.
On your frontend, before creating the
ExpressCheckoutElement
, set thestripeAccount
option on the Stripe instance:const stripe = Stripe(
, { apiVersion: "2025-08-27.basil", stripeAccount:'pk_test_TYooMQauvdEDq54NiTphI7jx', });'{{CONNECTED_ACCOUNT_ID}}'Register all of the domains where you plan to show the Express Checkout Element.
Disclose Stripe to your customers 
Stripe collects information on customer interactions with Elements to provide services to you, prevent fraud, and improve its services. This includes using cookies and IP addresses to identify which Elements a customer saw during a single checkout session. You’re responsible for disclosing and obtaining all rights and consents necessary for Stripe to use data in these ways. For more information, visit our privacy center.