Quick Start
Create your first checkout session in under 5 minutes
API Reference
Full API documentation and interactive testing
Preview Endpoint
Calculate pricing and taxes before creating a session
Session Validity: Checkout sessions expire after 24 hours by default, or 15 minutes when
confirm: true.Prerequisites
You need:- An active Dodo Payments merchant account
- API credentials from Developer → API Keys in the dashboard
- At least one product created in Products
Creating Your First Checkout Session
- Node.js SDK
- Python SDK
- REST API
API Response
All methods return:session_id is guaranteed to be present. When payment_method_id is provided, the charge processes immediately and checkout_url is null. Use the returned payment_id instead.
When confirm: true, the payment is created at session-creation time, and the response also includes payment_id, client_secret, and publishable_key for use with the Dodo Payments checkout SDK.
Redirect Your Customer
1
Extract the checkout URL
Get
checkout_url from the API response.2
Redirect to checkout
Send your customer to the URL:Alternatively, open in a new window:
3
Handle the return
After payment, customers are redirected to your
return_url with query parameters:Example redirect:
Check Session Status
To check a session’s status, call Get Checkout Session (GET /checkouts/{id}). The response has the session id, created_at, customer_email, and customer_name, plus payment_id and payment_status. Both payment fields are null while the customer is still entering details. After the customer submits payment, payment_status holds the payment’s status, such as succeeded, failed, or processing. Use webhooks as the source of truth for fulfillment.
Request Body
Required Fields
array
requis
Array of products to include in the checkout session. Each product must have a valid
product_id from your dashboard.You can combine one-time payment products and subscription products in the same session.Optional Fields
Customer Information
Customer Information
object
Customer information. You can either attach an existing customer using their ID or create a new customer record during checkout.
- Attach Existing Customer
- Create New Customer
object
Billing address information for accurate tax calculation, fraud prevention, and regulatory compliance.When
confirm: true, all billing address fields become required.Payment Configuration
Payment Configuration
array
Control which payment methods are available to customers during checkout. This helps optimize for specific markets or business requirements.Common options:
credit, debit, upi_collect, apple_pay, google_pay, amazon_pay, klarna, affirm, afterpay_clearpay, cashapp, ach, multibanco, bancontact_card, eps, ideal, blik, gcash, ali_pay_hk, fps, touch_n_go, paypalSee the Create Checkout Session API reference for the complete list.Example:string
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 is used.boolean
défaut:"false"
Display previously saved payment methods for returning customers, improving checkout speed and user experience.
Session Management
Session Management
string
URL to redirect customers after payment completion. Dodo Payments appends query parameters to your URL on redirect (see the redirect table above).Example redirect URLs:Use the
license_key and email query parameters to display license keys or send a confirmation immediately on your return page, without needing an extra API call.string
URL to redirect customers when they click the back button or cancel the checkout session. If not provided, the back button will not be displayed.Set a
cancel_url to give customers a clear way to return to your site without completing the purchase.boolean
défaut:"false"
If true, finalizes all session details immediately. The API throws an error if required data is missing.When
confirm: true:- All billing address fields become required
payment_method_idcan be provided to process the charge immediately- Session expires after 15 minutes instead of 24 hours
- An existing
customer_idis required ifpayment_method_idis provided
array
Apply one or more stacked discount codes to the checkout session. Codes are applied in array order (the first code reduces the starting price, the second reduces the already-discounted price, and so on), up to a maximum of 20 codes per session.When Purchasing Power Parity is enabled, the starting price is the PPP-adjusted amount, not the base price.The singular
discount_code field below is deprecated but still fully supported. It cannot be combined with discount_codes in the same request.string
obsolète
Deprecated — prefer
discount_codes for new integrations. This field still works for backward compatibility, but cannot be combined with discount_codes in the same request.object
Custom key-value pairs to store additional information about the session.
boolean
Override merchant default 3DS behaviour for this session.
boolean
défaut:"false"
Enable minimal address collection mode. When enabled, the checkout only collects:
- Country: Always required for tax determination
- ZIP/Postal code: Only in regions where it’s necessary for sales tax, VAT, or GST calculation
string
A saved payment method belonging to the attached customer. Requires
confirm: true and an existing customer.customer_id. The payment method is validated for eligibility with the payment’s currency. When set, the charge is processed immediately and checkout_url is returned as null. Use the returned payment_id instead.boolean
défaut:"false"
If true, returns a shortened checkout URL instead of the full session URL.
string
Product collection ID for the collection-based checkout flow. When you set it, pass an empty
product_cart array. Discount codes can’t be pre-applied at session creation. See Product Collections.string
Tax ID for the customer (for example, a VAT number). Requires
billing_address with a country.string
Optional business or legal name associated with the tax ID, up to 250 characters. When provided together with a valid
tax_id, it is rendered on the invoice instead of the customer’s personal name.integer
Override the merchant-level mandate floor (in INR paise) for INR e-mandates on Indian cards.The mandate amount sent to the processor is
max(this_floor, actual_billing_amount), so this is effectively the customer-facing authorization ceiling whenever billing is lower. When unset, the merchant setting applies; when that’s also unset, the system default of ₹15,000 applies.UI Customization
UI Customization
object
Customize the appearance and behavior of the checkout interface.
Feature Flags
Feature Flags
object
Configure specific features and behaviors for the checkout session.
Custom Fields
Custom Fields
array
Collect additional information from customers during checkout with custom form fields. You can define up to 5 custom fields per checkout session. Customer responses are included in webhook payloads and available via the API.
- Webhooks:
payment.succeeded,subscription.active, and other relevant event payloads contain thecustom_field_responsesarray - API responses: Payment and subscription objects include
custom_field_responses
Subscription Configuration
Subscription Configuration
object
Additional configuration for checkout sessions containing subscription products.
Usage Examples
Simple Single Product Checkout
Multi-Product Cart
Subscription with Trial Period
Pre-Confirmed Checkout
Checkout with Currency Override
Saved Payment Methods for Returning Customers
B2B Checkout with Tax ID Collection
Dark Theme Checkout with Stacked Discount Codes
Regional Payment Methods (UPI for India)
For detailed information about UPI configuration and testing, see the India Payment Methods page.BNPL (Buy Now Pay Later) Checkout
For detailed information about BNPL configuration and testing, see the Buy Now Pay Later (BNPL) page.Instant Checkout with Existing Payment Method
Short Links for Cleaner Payment URLs
Skip Payment Success Page with Immediate Redirect
Forcing a Language
Collecting Custom Fields
Previewing Checkout Sessions
Use the Preview Checkout Session endpoint to calculate pricing, taxes, and totals before creating a session. This is useful for displaying accurate pricing information on your site.The previewed
current_breakup.subtotal already reflects Purchasing Power Parity and Charm Pricing where they apply to the product.When the cart contains a subscription product, the preview response also returns a
next_billing_date — a preview of the upcoming billing date, so you can show it before the subscription is created. It is computed relative to now: now + trial period when a trial applies, otherwise now + one payment frequency. The field is omitted for one-time-only carts. This is an estimate anchored on the preview time; the authoritative next_billing_date is set when the subscription activates.The preview also returns
trial_period_days (the effective trial length, free or paid) and trial_amount (the per-unit trial charge after discounts, in the price currency’s minor units). trial_amount is only present for a paid trial and is null for a free trial or no trial. Use current_breakup for the taxed total actually due today.- Node.js SDK
- Python SDK
- REST API
Migrating from Dynamic Links
If you’re using Dynamic Links, Checkout Sessions offer more flexibility. With Dynamic Links, you had to provide the customer’s complete billing address. With Checkout Sessions, you can pass whatever information you have, and the checkout flow collects the rest. For example:- Provide only the customer’s billing country, and checkout collects the remaining details.
- Or provide all information and set
confirm: trueto skip directly to the payment page.
Related Resources
Overlay Checkout
Open checkout as a modal overlay on your page
Inline Checkout
Embed checkout directly in your page
Mobile Integration
Integrate checkout in native mobile apps
Webhooks
Listen for payment and subscription events
Payment Methods
Supported payment methods by region
Subscriptions
Recurring billing and subscription management