Overview
Inline checkout lets you create fully integrated checkout experiences that blend seamlessly with your website or application. Unlike the overlay checkout, which opens as a modal on top of your page, inline checkout embeds the payment form directly into your page layout. Using inline checkout, you can:- Create checkout experiences that are fully integrated with your app or website
- Let Dodo Payments securely capture customer and payment information in an optimized checkout frame
- Display items, totals, and other information from Dodo Payments on your page
- Use SDK methods and events to build advanced checkout experiences

How It Works
Inline checkout works by embedding a secure Dodo Payments frame into your website or app. The checkout frame handles collecting customer information and capturing payment details. Your page displays the items list, totals, and options for changing what’s on the checkout. The SDK lets your page and the checkout frame interact with each other. Dodo Payments automatically creates a subscription when a checkout completes, ready for you to provision.What Makes a Good Inline Checkout?
It’s important that customers know who they’re buying from, what they’re buying, and how much they’re paying. To build an inline checkout that’s compliant and optimized for conversion, your implementation must include:
Example inline checkout layout showing required elements
- Recurring information: If recurring, how often it recurs and the total to pay on renewal. If a trial, how long the trial lasts.
- Item descriptions: A description of what’s being purchased.
- Transaction totals: Transaction totals, including subtotal, total tax, and grand total. Be sure to include the currency too.
- Dodo Payments footer: The full inline checkout frame, including the checkout footer that has information about Dodo Payments, our terms of sale, and our privacy policy.
- Refund policy: A link to your refund policy, if it differs from the Dodo Payments standard refund policy.
Customer Journey
The checkout flow is determined by your checkout session configuration. Depending on how you configure the checkout session, customers will experience a checkout that may present all information on a single page or across multiple steps.Customer opens checkout

Customer enters their details
Customer selects payment method

Checkout completed

Dodo Payments creates subscription

Quick Start
Get started with the Dodo Payments Inline Checkout in just a few lines of code:Step-by-Step Integration Guide
Install the SDK
Initialize the SDK for Inline Display
displayType: 'inline'. You should also listen for the checkout.breakdown event to update your UI with real-time tax and total calculations.Create a Container Element
Open the Checkout
DodoPayments.Checkout.open() with the checkoutUrl and the elementId of your container:Test Your Integration
- Start your development server:
- Test the checkout flow:
- Enter your email and address details in the inline frame.
- Verify that your custom order summary updates in real-time.
- Test the payment flow using test credentials.
- Confirm redirects work correctly.
checkout.breakdown events logged in your browser console if you added a console log in the onEvent callback.Go Live
- Change the mode to
'live':
- Update your checkout URLs to use live checkout sessions from your backend.
- Test the complete flow in production.
Complete React Example
This example demonstrates how to implement a custom order summary alongside the inline checkout, keeping them in sync using thecheckout.breakdown event.
API Reference
Configuration
Initialize Options
Checkout Options
Methods
Open Checkout
Opens the checkout frame in the specified container.Close Checkout
Programmatically removes the checkout frame and cleans up event listeners.Check Status
Returns whether the checkout frame is currently injected.Events
The SDK provides real-time events through theonEvent callback. For inline checkout, checkout.breakdown is particularly useful for syncing your UI.
Checkout Breakdown Data
Thecheckout.breakdown event provides the following data:
Understanding the Breakdown Event
Thecheckout.breakdown event is the primary way to keep your application’s UI in sync with the Dodo Payments checkout state.
When it fires:
- On initialization: Immediately after the checkout frame is loaded and ready.
- On address change: Whenever the customer selects a country or enters a postal code that results in a tax recalculation.
- Currency Formatting: Prices are always returned as integers in the smallest currency unit (e.g., cents for USD, yen for JPY). To display them, divide by 100 (or the appropriate power of 10) or use a formatting library like
Intl.NumberFormat. - Handling Initial States: When the checkout first loads,
taxanddiscountmay be0ornulluntil the user provides their billing information or applies a code. Your UI should handle these states gracefully (e.g., showing a dash—or hiding the row). - The “Final Total” vs “Total”: While
totalgives you the standard price calculation,finalTotalis the source of truth for the transaction. IffinalTotalis present, it reflects exactly what will be charged to the customer’s card, including any dynamic adjustments. - Real-time Feedback: Use the
taxfield to show users that taxes are being calculated in real-time. This provides a “live” feel to your checkout page and reduces friction during the address entry step.
Implementation Options
Package Manager Installation
Install via npm, yarn, or pnpm as shown in the Step-by-Step Integration Guide.CDN Implementation
For quick integration without a build step, you can use our CDN:Update Payment Method
Inline checkout supports payment method updates for subscriptions. When a customer needs to update their payment method — whether for an active subscription or to reactivate an on-hold subscription — you can render the update flow directly within your page layout.How It Works
- Call the Update Payment Method API to get a
payment_link:
- Pass the returned
payment_linkas thecheckoutUrlto open inline checkout:
For On-Hold Subscriptions
When updating the payment method for a subscription inon_hold status, Dodo Payments automatically creates a charge for any remaining dues. Monitor the payment.succeeded and subscription.active webhooks to confirm reactivation.
Error Handling
The SDK provides detailed error information through the event system. Always implement proper error handling in youronEvent callback:
Best Practices
- Responsive Design: Ensure your container element has enough width and height. The iframe will typically expand to fill its container.
- Synchronization: Use the
checkout.breakdownevent to keep your custom order summary or pricing tables in sync with what the user sees in the checkout frame. - Skeleton States: Show a loading indicator in your container until the
checkout.openedevent fires. - Cleanup: Call
DodoPayments.Checkout.close()when your component unmounts to clean up the iframe and event listeners.
#0d0d0d as the background color for optimal visual integration with the inline checkout frame.Payment Status Validation
Why Server-Side Validation is Essential
While inline checkout events provide real-time feedback, they should not be your only source of truth for payment status. Network issues, browser crashes, or users closing the page can cause events to be missed. To ensure reliable payment validation:- Your server should listen to webhook events - Dodo Payments sends webhooks for payment status changes
- Implement a polling mechanism - Your frontend should poll your server for status updates
- Combine both approaches - Use webhooks as the primary source and polling as a fallback
Recommended Architecture
Implementation Steps
1. Listen for checkout events - When the user clicks pay, start preparing to verify the status:payment.succeeded or payment.failed webhooks. See our Webhooks documentation for details.
Troubleshooting
Checkout frame is not appearing
Checkout frame is not appearing
- Verify that
elementIdmatches theidof adivthat actually exists in the DOM. - Ensure
displayType: 'inline'was passed toInitialize. - Check that the
checkoutUrlis valid.
Taxes are not updating in my UI
Taxes are not updating in my UI
- Ensure you are listening for the
checkout.breakdownevent. - Taxes are only calculated after the user enters a valid country and postal code in the checkout frame.
Enabling Digital Wallets
For detailed information about setting up Apple Pay, Google Pay, and other digital wallets, see the Digital Wallets page.Quick Setup for Apple Pay
Open Wallet domains

Open Wallet domains from the Apple Pay row
Download the domain association file

Download the Apple Pay domain association file
Register your domain
shop.example.com),然后 继续。
Register the domain where you embed inline checkout
Host the file on your domain
Content-Type: application/octet-stream 或 text/plain 提供。Verify the domain

Verify the hosted association file
Confirm it's active

Verified domains show an Active status
Test the integration
- 在 Apple 设备上打开结账
- 验证 Apple Pay 按钮是否显示
- 完成测试交易
浏览器支持
Dodo Payments 结账 SDK 支持以下浏览器:- Chrome(最新版)
- Firefox(最新版)
- Safari(最新版)
- Edge(最新版)
- IE11+