Quick Start Guide
Get your first checkout session running in under 5 minutes
API Reference & Live Testing
Explore the full API documentation and interactively test Checkout Session requests and responses.
Session Validity: Checkout sessions are valid for 24 hours by default. If you pass
confirm=true
in your request, the session will only be valid for 15 minutes.Prerequisites
1
Dodo Payments Account
You’ll need an active Dodo Payments merchant account with API access.
2
API Credentials
Generate your API credentials from the Dodo Payments dashboard:
3
Products Setup
Create your products in the Dodo Payments dashboard before implementing checkout sessions.
Creating Your First Checkout Session
API Response
All methods above return the same response structure:1
Get the checkout URL
Extract the
checkout_url
from the API response.2
Redirect your customer
Direct your customer to the checkout URL to complete their purchase.
3
Handle the return
After payment, customers are redirected to your
return_url
with additional query parameters for payment status.Request Body
Required Fields
Essential fields needed for every checkout session
Optional Fields
Additional configuration to customize your checkout experience
Required Fields
Array of products to include in the checkout session. Each product must have a valid
product_id
from your Dodo Payments dashboard.Important: Multiple product carts can only contain one-time payment products. You cannot mix subscription products with one-time products in the same checkout session.
Find Your Product IDs: You can find product IDs in your Dodo Payments dashboard under Products → View Details, or by using the List Products API.
Optional Fields
Configure these fields to customize the checkout experience and add business logic to your payment flow.Customer Information
Customer Information
Pre-fill customer details to reduce checkout friction and improve conversion rates.
Billing address information for accurate tax calculation, fraud prevention, and regulatory compliance.
When
confirm
is set to true
, all billing address fields become required for successful session creation.Payment Configuration
Payment Configuration
Control which payment methods are available to customers during checkout. This helps optimize for specific markets or business requirements.Available Options: Example:
credit
, debit
, upi_collect
, upi_intent
, apple_pay
, google_pay
, amazon_pay
, klarna
, affirm
, afterpay_clearpay
, sepa
, ach
Critical: Always include
credit
and debit
as fallback options to prevent checkout failures when preferred payment methods are unavailable.Override the default currency selection with a fixed billing currency. Uses ISO 4217 currency codes.Supported Currencies:
USD
, EUR
, GBP
, CAD
, AUD
, INR
, and moreExample: "USD"
for US Dollars, "EUR"
for EurosThis field is only effective when adaptive pricing is enabled. If adaptive pricing is disabled, the product’s default currency will be used.
Display previously saved payment methods for returning customers, improving checkout speed and user experience.
Session Management
Session Management
URL to redirect customers after successful payment or cancellation.
If true, finalizes all session details immediately. API will throw an error if required data is missing.
Apply a discount code to the checkout session.
Custom key-value pairs to store additional information about the session.
UI Customization & Features
UI Customization & Features
Subscription Configuration
Subscription Configuration
Additional configuration for checkout sessions containing subscription products.
Usage Examples
Here are 10 comprehensive examples showcasing different checkout session configurations for various business scenarios:1. Simple Single Product Checkout
2. Multi-Product Cart
3. Subscription with Trial Period
4. Pre-confirmed Checkout
When
confirm
is set to true
, the customer will be taken directly to the checkout page, bypassing any confirmation steps.5. Checkout with Currency Override
The
billing_currency
override only takes effect when adaptive currency is enabled in your account settings. If adaptive currency is disabled, this parameter will have no effect.6. Saved Payment Methods for Returning Customers
7. B2B Checkout with Tax ID Collection
8. Dark Theme Checkout with Discount Code
9. Regional Payment Methods (UPI for India)
10. BNPL (Buy Now Pay Later) Checkout
Moving from Dynamic Links to Checkout Sessions
Key Differences
Previously, when creating a payment link with Dynamic Links, you were required to provide the customer’s complete billing address. With Checkout Sessions, this is no longer necessary. You can simply pass along whatever information you have, and we’ll handle the rest. For example:- If you only know the customer’s billing country, just provide that.
- The checkout flow will automatically collect the missing details before moving the customer to the payment page.
- On the other hand, if you already have all the required information and want to skip directly to the payment page, you can pass the full data set and include
confirm=true
in your request body.
Migration Process
Migrating from Dynamic Links to Checkout Sessions is straightforward:1
Update your integration
Update your integration to use the new API or SDK method.
2
Adjust request payload
Adjust the request payload according to the Checkout Sessions format.
3
That's it!
Yes. No additional handling or special migration steps are needed on your side.