Skip to main content
Overlay checkout opens a modal window on top of your page. Customers enter their payment details in the modal while your page stays visible behind it. When they close the modal, control returns to your page. When they complete payment, they are redirected to your return_url.
Overlay checkout modal displayed on top of a product page

Interactive Demo

See the overlay checkout in action with our live demo.

Quick Start

Install the SDK, initialize it, and open checkout with a checkout URL from the create checkout session API:

Step-by-Step Integration

1

Install the SDK

Install via npm, yarn, or pnpm:
2

Initialize the SDK

Call Initialize once when your app loads, typically in your main component or app entry point:
Always initialize the SDK before opening the checkout. Initialize it once when your application loads, not before every checkout attempt.
3

Create a Checkout Button

Build a component that opens the checkout modal:
4

Add the Button to Your Page

Use the checkout button component in your application:
5

Handle Redirects

Create pages to handle checkout redirects after payment:
6

Test Your Integration

  1. Start your development server:
  1. Test the checkout flow:
    • Click the checkout button
    • Verify the modal appears
    • Test the payment flow using test credentials
    • Confirm redirects work correctly
You should see checkout events logged in your browser console.
7

Go Live

When ready for production:
  1. Change the mode to 'live':
  1. Update your checkout URLs to use live checkout sessions from your backend
  2. Test the complete flow in production
  3. Monitor events and errors

API Reference

Initialize

Call Initialize once to set up the SDK:

Open Checkout

Open the checkout modal:

Close Checkout

Programmatically close the modal:

Check Status

Check if the modal is currently open:

Events

Listen for checkout events via the onEvent callback passed to Initialize:

CDN Implementation

For quick integration without a build step, load the SDK from CDN:

Theme Customization

The client-side themeConfig option is deprecated and will be removed in the next major version of the Checkout SDK (v2.0.0). Passing it logs a deprecation warning in the browser console. Configure your theme when creating the checkout session via the API instead, using the customization.theme_config parameter — see Checkout Theme Customization — or visually on the Design page in the dashboard. Session-configured themes apply to overlay, inline, and hosted checkout alike.
This section covers the deprecated client-side theme configuration using the Checkout SDK. The recommended approach is to configure themes server-side when creating a checkout session via the API using the theme_config parameter. See Checkout Theme Customization for API-level configuration, or use the Design page in the dashboard to configure themes visually with live preview.
If you must use client-side theme configuration, pass themeConfig in the options parameter:

Theme Properties

All available theme properties for light and dark modes:

Error Handling

Always implement error handling in your onEvent callback:
Always handle the checkout.error event to provide a good user experience when errors occur.

Best Practices

  1. Initialize once: Call Initialize once when your app loads, not before every checkout
  2. Error handling: Implement proper error handling in your event callback
  3. Test mode: Use "test" mode during development and switch to "live" only when ready for production
  4. Event handling: Handle all relevant events for a complete user experience
  5. Valid URLs: Always use valid checkout URLs from the create checkout session API
  6. TypeScript: Use TypeScript for better type safety and developer experience
  7. Loading states: Show loading states while the checkout is opening to improve UX
  8. Timer management: Disable the timer (showTimer: false) if you want to handle session expiration manually

Troubleshooting

Possible causes:
  • SDK not initialized before calling open()
  • Invalid checkout URL
  • JavaScript errors in console
  • Network connectivity issues
Solutions:
  • Verify SDK initialization happens before opening checkout
  • Check browser console for errors
  • Ensure checkout URL is valid and from the create checkout session API
  • Verify network connectivity
Possible causes:
  • Event handler not properly set up
  • JavaScript errors preventing event propagation
  • SDK not initialized correctly
Solutions:
  • Confirm event handler is properly configured in Initialize()
  • Check browser console for JavaScript errors
  • Verify SDK initialization completed successfully
  • Test with a simple event handler first
Possible causes:
  • CSS conflicts with your application styles
  • Theme settings not applied correctly
  • Responsive design issues
Solutions:
  • Check for CSS conflicts in browser DevTools
  • Verify theme settings are correct
  • Test on different screen sizes
  • Ensure no z-index conflicts with modal

Digital Wallets

For detailed information about setting up Google Pay and other digital wallets, see the Digital Wallets page.
Apple Pay is not yet supported in overlay checkout.

Browser Support

The Dodo Payments Checkout SDK supports:
  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • IE11+

Overlay vs Inline Checkout

Choose the right checkout type for your use case:
Use overlay checkout for faster integration with minimal changes to your existing pages. Use inline checkout when you want maximum control over the checkout experience and consistent branding.

Inline Checkout

Embed checkout directly into your page for fully integrated experiences.

Checkout Sessions API

Create checkout sessions to power your checkout experiences.

Webhooks

Handle payment events server-side with webhooks.

Integration Guide

Complete guide to integrating Dodo Payments.
For more help, visit our Discord community or contact our developer support team.
Last modified on September 26, 2026