मुख्य सामग्री पर जाएं

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.

Preview Checkout

Calculate pricing, taxes, and totals before creating a session.
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.
Alternative Integration Options: Instead of redirecting, you can embed the checkout directly in your page using Overlay Checkout (modal overlay) or Inline Checkout (fully embedded). Both options use the same checkout session URL.
3

Handle the return

After payment, customers are redirected to your return_url with query parameters including payment/subscription ID, status, customer email, and any license keys. See the return_url parameter docs for the full list.

Request Body

Required Fields

Essential fields needed for every checkout session

Optional Fields

Additional configuration to customize your checkout experience

Required Fields

product_cart
array
आवश्यक
Array of products to include in the checkout session. Each product must have a valid product_id from your Dodo Payments dashboard.
Mixed Checkout: You can combine one-time payment products and subscription products in the same checkout session. This enables powerful use cases like setup fees with subscriptions, hardware bundles with SaaS, and more.
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
object
Customer information. You can either attach an existing customer using their ID or create a new customer record during checkout.
Attach an existing customer to the checkout session using their ID.
billing_address
object
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.
allowed_payment_method_types
array
Control which payment methods are available to customers during checkout. This helps optimize for specific markets or business requirements.Available Options: credit, debit, upi_collect, apple_pay, google_pay, amazon_pay, klarna, affirm, afterpay_clearpay, cashapp, multibanco, bancontact_card, eps, ideal, przelewy24, paypal, sunbit
Critical: Always include credit and debit as fallback options to prevent checkout failures when preferred payment methods are unavailable.
Example:
billing_currency
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 Euros
This field is only effective when adaptive pricing is enabled. If adaptive pricing is disabled, the product’s default currency will be used.
show_saved_payment_methods
boolean
डिफ़ॉल्ट:"false"
Display previously saved payment methods for returning customers, improving checkout speed and user experience.
return_url
string
URL to redirect customers after payment completion. Dodo Payments appends the following query parameters to your URL on redirect: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.
cancel_url
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. This improves the checkout experience and reduces friction.
confirm
boolean
डिफ़ॉल्ट:"false"
If true, finalizes all session details immediately. API will throw an error if required data is missing.
discount_codes
array
Apply one or more stacked discount codes to the checkout session. Codes are applied in array order (the first code reduces the base price, the second reduces the already-discounted price, and so on), up to a maximum of 20 codes per session.
The singular discount_code field below is deprecated but still fully supported — existing integrations continue to work without changes. It cannot be combined with discount_codes in the same request. Migrate to discount_codes when convenient to take advantage of stacking.
discount_code
string
अप्रचलित
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.
metadata
object
Custom key-value pairs to store additional information about the session.
force_3ds
boolean
Override merchant default 3DS behaviour for this session.
minimal_address
boolean
डिफ़ॉल्ट:"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
This significantly reduces checkout friction by eliminating unnecessary form fields.
Enable minimal address for faster checkout completion. Full address collection remains available for businesses that require complete billing details.
customization
object
Customize the appearance and behavior of the checkout interface.
feature_flags
object
Configure specific features and behaviors for the checkout session.
custom_fields
array
कस्टम फॉर्म फ़ील्ड के साथ चेकआउट के दौरान ग्राहकों से अतिरिक्त जानकारी एकत्र करें। आप प्रति चेकआउट सत्र 5 कस्टम फ़ील्ड्स तक परिभाषित कर सकते हैं। ग्राहक प्रतिक्रियाएं वेबहूक पेलोड में शामिल होती हैं और API के माध्यम से उपलब्ध होती हैं।
कस्टम फ़ील्ड के लिए ग्राहक प्रतिक्रियाएँ इसमें शामिल हैं:
  • वेबहूक: payment.succeeded, subscription.active, और अन्य प्रासंगिक ईवेंट पेलोड में custom_field_responses ऐरे होता है
  • API प्रतिक्रियाएँ: भुगतान और सब्स्क्रिप्शन ऑब्जेक्ट में custom_field_responses शामिल होता है
subscription_data
object
सब्स्क्रिप्शन प्रोडक्ट्स वाले चेकआउट सत्रों के लिए अतिरिक्त कॉन्फ़िगरेशन।

उपयोग के उदाहरण

यहाँ विभिन्न व्यावसायिक परिदृश्यों के लिए विभिन्न चेकआउट सत्र कॉन्फ़िगरेशनों को प्रदर्शित करने वाले 10 व्यापक उदाहरण हैं:

1. सरल सिंगल प्रोडक्ट चेकआउट

2. मल्टी-प्रोडक्ट कार्ट

3. परीक्षण अवधि के साथ सब्स्क्रिप्शन

4. पूर्व-पुष्टीकृत चेकआउट

जब confirm को true पर सेट किया जाता है, तो ग्राहक को सीधे चेकआउट पृष्ठ पर ले जाया जाएगा, जिससे कोई पुष्टि चरण बाईपास हो जाएगा।

5. मुद्रा ओवरराइड के साथ चेकआउट

billing_currency ओवरराइड केवल तब प्रभावी होता है जब अपने खाता सेटिंग्स में अनुकूलनीय मुद्रा चालू हो। यदि अनुकूलनीय मुद्रा बंद है, तो इस पैरामीटर का कोई प्रभाव नहीं होगा।

6. वापसी ग्राहकों के लिए बची हुई भुगतान विधियाँ

7. B2B चेकआउट कर पहचान संख्या संग्रह के साथ

8. स्टैक्ड डिस्काउंट कोड्स के साथ डार्क थीम चेकआउट

9. क्षेत्रीय भुगतान विधियाँ (भारत के लिए UPI)

UPI कॉन्फ़िगरेशन और परीक्षण के बारे में विस्तृत जानकारी के लिए India Payment Methods पृष्ठ देखें।

10. BNPL (अभी खरीदें बाद में चुकाएं) चेकआउट

BNPL कॉन्फ़िगरेशन और परीक्षण के बारे में विस्तृत जानकारी के लिए Buy Now Pay Later (BNPL) पृष्ठ देखें।

11. त्वरित चेकआउट के लिए मौजूदा भुगतान विधियों का उपयोग करना

ग्राहक की बचे हुई भुगतान विधि का उपयोग करके एक चेकआउट सत्र बनाएं जो तुरंत प्रक्रिया करता है, भुगतान विधि संग्रह को छोड़ना:
जब payment_method_id का उपयोग किया जाता है, confirm को true पर सेट किया जाना चाहिए और एक मौजूदा customer_id प्रदान करना चाहिए। भुगतान की मुद्रा के साथ पात्रता के लिए भुगतान विधि सत्यापित की जाएगी।
भुगतान विधि ग्राहक की होनी चाहिए और भुगतान मुद्रा के साथ संगत होनी चाहिए। यह लौटने वाले ग्राहकों के लिए वन-क्लिक खरीदारी को सक्षम करता है।

12. क्लीनर भुगतान URLs के लिए शॉर्ट लिंक

कस्टम स्लग के साथ शेयर किए जा सकने वाले छोटे भुगतान लिंक उत्पन्न करें:
शॉर्ट लिंक एसएमएस, ईमेल, या सामाजिक मीडिया शेयरिंग के लिए परिपूर्ण होते हैं। वे याद रखने में आसान होते हैं और लंबे URLs की तुलना में अधिक ग्राहक भरोसा बनाते हैं।

13. त्वरित पुनर्निर्देशन के साथ भुगतान सफलता पृष्ठ को छोड़ें

ग्राहकों को भुगतान समाप्ति के बाद तुरंत पुनर्निर्देशित करें, डिफॉल्ट सफलता पृष्ठ को छोड़कर:
redirect_immediately: true का उपयोग करें जब आपके पास एक कस्टम सफलता पृष्ठ हो जो डिफ़ॉल्ट भुगतान सफलता पृष्ठ की तुलना में बेहतर उपयोगकर्ता अनुभव प्रदान करता है। यह विशेष रूप से मोबाइल ऐप्स और एम्बेडेड चेकआउट फ्लोज़ के लिए उपयोगी है।
जब redirect_immediately सक्षम होता है, तो ग्राहकों को आपके return_url पर भुगतान समाप्ति के तुरंत बाद पुनर्निर्देशित किया जाता है, डिफ़ॉल्ट सफलता पृष्ठ को पूरी तरह छोड़कर।

14. एक भाषा को मजबूर करना

ग्राहक के ब्राउजर भाषा पहचान को ओवरराइड करके चेकआउट को एक विशिष्ट भाषा में प्रदर्शित करना:
force_language का उपयोग करें जब आपको अपने ग्राहक की पसंदीदा भाषा पता हो (जैसे, उनके खाता सेटिंग्स से) या जब विशिष्ट क्षेत्रीय बाज़ारों को लक्षित कर रहे हों।
समर्थित भाषाएँ: Arabic (ar), Catalan (ca), Chinese (zh), Dutch (nl), English (en), French (fr), German (de), Hebrew (he), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Malay (ms), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Spanish (es), Swedish (sv), Thai (th), Turkish (tr)

15. कस्टम फील्ड्स एकत्र करना

ग्राहकों से चेकआउट के दौरान अतिरिक्त जानकारी एकत्र करने के लिए कस्टम क्षेत्र का उपयोग करें:
कस्टम फ़ील्ड प्रतिक्रियाएँ स्वचालित रूप से वेबहूक पेलोड (payment.succeeded, subscription.active, आदि) में शामिल होती हैं और API के माध्यम से प्राप्त की जा सकती हैं। अपने CRM को समृद्ध बनाने, ऑनबोर्डिंग फ़्लोज़ को ट्रिगर करने, या ग्राहक अनुभव को अनुकूलित करने के लिए उनका उपयोग करें।
उपलब्ध फ़ील्ड प्रकार: text, number, email, url, date, dropdown, boolean

चेकआउट सत्र का पूर्वावलोकन

चेकआउट सत्र बनाने से पहले, आप टैक्स, छूट और कुल के साथ मूल्य निर्धारण टूटन का पूर्वावलोकन कर सकते हैं। यह ग्राहकों को चेकआउट पर जाने से पहले सही मूल्य निर्धारण प्रदर्शित करने में सहायक होता है।

Preview API Reference

पूरा प्रीव्यू एंडपॉइंट डोक्यूमेंटेशन देखें।

डायनेमिक लिंक से चेकआउट सत्र में स्थानांतरित होना

प्रमुख अंतर

पहले, डायनेमिक लिंक के साथ एक भुगतान लिंक बनाने के समय, आपको ग्राहकों का पूरा बिलिंग पता प्रदान करना आवश्यक था। चेकआउट सत्र के साथ, अब यह आवश्यक नहीं है। आप जो भी जानकारी आपके पास है उसे पास करके छोड़ सकते हैं, और हम बाकी की देखभाल करेंगे। उदाहरण के लिए:
  • यदि आप केवल ग्राहक के बिलिंग देश को जानते हैं, तो बस उसे प्रदान करें।
  • चेकआउट फ़्लो स्वचालित रूप से गुम विवरण इकट्ठा करेगा और ग्राहक को भुगतान पृष्ठ पर ले जाने से पहले।
  • दूसरी ओर, यदि आपके पास पहले से सभी आवश्यक जानकारी है और आप सीधे भुगतान पृष्ठ पर जाना चाहते हैं, तो आप पूरा डेटा सेट पास कर सकते हैं और अपने अनुरोध निकाय में confirm=true को शामिल कर सकते हैं।

माइग्रेशन प्रक्रिया

डायनेमिक लिंक से चेकआउट सत्र में माइग्रेट करना सरल है:
1

Update your integration

अपनी एकीकरण को नई API या SDK विधि का उपयोग करने के लिए अपडेट करें।
2

Adjust request payload

चेकआउट सत्र प्रारूप के अनुसार अनुरोध पेलोड को समायोजित करें।
3

That's it!

हाँ। आपकी ओर से कोई अतिरिक्त हैंडलिंग या विशेष माइग्रेशन चरणों की आवश्यकता नहीं है।

संबंधित API संदर्भ

Create Checkout Session

सभी उपलब्ध पैरामीटर और विकल्पों के साथ चेकआउट सत्र बनाने के लिए संपूर्ण API संदर्भ

Preview Checkout Session

एक सत्र बनाने से पहले मूल्य निर्धारण, कर और कुल का पूर्वावलोकन करने के लिए API संदर्भ
अंतिम संशोधन 9 जुलाई 2026