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
- Node.js SDK
- Python SDK
- REST API
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 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
Array of products to include in the checkout session. Each product must have a valid
product_id from your Dodo Payments dashboard.Optional Fields
Configure these fields to customize the checkout experience and add business logic to your payment flow.Customer Information
Customer Information
Customer information. You can either attach an existing customer using their ID or create a new customer record during checkout.
- Attach Existing Customer
- New Customer
Attach an existing customer to the checkout session using their ID.
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:
credit, debit, upi_collect, apple_pay, google_pay, amazon_pay, klarna, affirm, afterpay_clearpay, cashapp, multibanco, bancontact_card, eps, ideal, przelewy24, paypal, sunbitExample: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 payment completion. Dodo Payments appends the following query parameters to your URL on redirect:
Example redirect URLs:
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.
If true, finalizes all session details immediately. API will throw an error if required data is missing.
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.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.Custom key-value pairs to store additional information about the session.
Override merchant default 3DS behaviour for this session.
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
UI Customization & Features
UI Customization & Features
Custom Fields
Custom Fields
कस्टम फॉर्म फ़ील्ड के साथ चेकआउट के दौरान ग्राहकों से अतिरिक्त जानकारी एकत्र करें। आप प्रति चेकआउट सत्र 5 कस्टम फ़ील्ड्स तक परिभाषित कर सकते हैं। ग्राहक प्रतिक्रियाएं वेबहूक पेलोड में शामिल होती हैं और API के माध्यम से उपलब्ध होती हैं।
कस्टम फ़ील्ड के लिए ग्राहक प्रतिक्रियाएँ इसमें शामिल हैं:
- वेबहूक:
payment.succeeded,subscription.active, और अन्य प्रासंगिक ईवेंट पेलोड मेंcustom_field_responsesऐरे होता है - API प्रतिक्रियाएँ: भुगतान और सब्स्क्रिप्शन ऑब्जेक्ट में
custom_field_responsesशामिल होता है
Subscription Configuration
Subscription Configuration
सब्स्क्रिप्शन प्रोडक्ट्स वाले चेकआउट सत्रों के लिए अतिरिक्त कॉन्फ़िगरेशन।
उपयोग के उदाहरण
यहाँ विभिन्न व्यावसायिक परिदृश्यों के लिए विभिन्न चेकआउट सत्र कॉन्फ़िगरेशनों को प्रदर्शित करने वाले 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. त्वरित चेकआउट के लिए मौजूदा भुगतान विधियों का उपयोग करना
ग्राहक की बचे हुई भुगतान विधि का उपयोग करके एक चेकआउट सत्र बनाएं जो तुरंत प्रक्रिया करता है, भुगतान विधि संग्रह को छोड़ना:भुगतान विधि ग्राहक की होनी चाहिए और भुगतान मुद्रा के साथ संगत होनी चाहिए। यह लौटने वाले ग्राहकों के लिए वन-क्लिक खरीदारी को सक्षम करता है।
12. क्लीनर भुगतान URLs के लिए शॉर्ट लिंक
कस्टम स्लग के साथ शेयर किए जा सकने वाले छोटे भुगतान लिंक उत्पन्न करें:13. त्वरित पुनर्निर्देशन के साथ भुगतान सफलता पृष्ठ को छोड़ें
ग्राहकों को भुगतान समाप्ति के बाद तुरंत पुनर्निर्देशित करें, डिफॉल्ट सफलता पृष्ठ को छोड़कर:जब
redirect_immediately सक्षम होता है, तो ग्राहकों को आपके return_url पर भुगतान समाप्ति के तुरंत बाद पुनर्निर्देशित किया जाता है, डिफ़ॉल्ट सफलता पृष्ठ को पूरी तरह छोड़कर।14. एक भाषा को मजबूर करना
ग्राहक के ब्राउजर भाषा पहचान को ओवरराइड करके चेकआउट को एक विशिष्ट भाषा में प्रदर्शित करना: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
चेकआउट सत्र का पूर्वावलोकन
चेकआउट सत्र बनाने से पहले, आप टैक्स, छूट और कुल के साथ मूल्य निर्धारण टूटन का पूर्वावलोकन कर सकते हैं। यह ग्राहकों को चेकआउट पर जाने से पहले सही मूल्य निर्धारण प्रदर्शित करने में सहायक होता है।- Node.js SDK
- Python SDK
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 संदर्भ