Quick Start
Platform Examples
Checkout Customization
Mobile Recipes
start(...) call, and each one includes abandoned-session recovery. Build the flow by hand only if none of the SDKs fits your stack.Prerequisites
Before you start, you need:- A Dodo Payments account.
- An API key from Developer → API Keys and a webhook signing secret from Developer → Webhooks.
- An Android, iOS, React Native, or Flutter app.
- A backend server that creates checkout sessions. The API key stays on this server.
Integration Workflow
Your backend makes every Dodo Payments API call. Your app only asks your backend for a checkout URL, opens it, and shows the result.status in the deep link tells your app what to show the customer. It is not proof of payment. Grant access from the payment.succeeded or subscription.active webhook on your backend, not from the mobile result.Backend: Create Checkout Session
checkout_url to the app. Set the session’s return_url to the deep link your app registers, for example myapp://checkout/return.Checkout Session API Docs
Mobile: Get Checkout URL
userSessionToken is that token and CheckoutResponse is your own response type.- iOS (Swift)
- Android (Kotlin)
- React Native (JavaScript)
- Flutter (Dart)
Mobile: Open Checkout in Browser
Pick your mobile SDK
Backend: Handle Payment Completion
payment.succeeded or subscription.active webhook. Use the result from the return URL only to update the app’s screen.Choose Your SDK
Every mobile SDK has the same contract. Onestart(...) call opens Dodo Payments hosted checkout in the platform’s system browser surface and returns a typed CheckoutResult whose status is succeeded, failed, cancelled, pending, or expired. No SDK holds an API key or calls the Dodo Payments API, and all four support abandoned-session recovery.
Android
com.dodopayments.api:checkout-android opens a Custom Tab. Requires minSdk 23.iOS
dodopayments-mobile-sdk-ios opens SFSafariViewController. Requires iOS 16+.React Native
@dodopayments/react-native-checkout, a Turbo Module over both native cores. Requires React Native 0.77+ with the New Architecture.Flutter
dodopayments_checkout, a Pigeon channel over both native cores. Requires Flutter 3.44+.Registering a Callback URL Scheme
All four SDKs return control to your app through a custom URL scheme that you choose, for examplemyapp://checkout/return. Register it once per platform:
- Android
- iOS
- Expo
returnUrl.checkout_url in the platform’s system browser surface (a Custom Tab on Android, SFSafariViewController on iOS), intercept the navigation to your return_url, and read the status and payment_id query parameters. The SDKs do this for you.Appearance Customization
Every SDK accepts an optionalcustomization parameter on start(...) or CheckoutParams. It controls the system browser surface: the toolbar, the buttons, and how the browser is presented. The checkout page’s own theme is separate. You set it on your server with customization.theme_config when you create the checkout session.
The options are grouped by platform, because a Custom Tab on Android and SFSafariViewController on iOS expose different native controls. Every field is optional. An unset field leaves the platform’s own default in place.
Android - Custom Tab
Android - Custom Tab
default shows the system “X” icon; back draws a back arrow instead.iOS - SFSafariViewController
iOS - SFSafariViewController
pageSheet presents checkout as a card that the customer can swipe to dismiss. fullScreen covers the whole screen.presentationStyle is fullScreen. With pageSheet, the bars stay pinned.android and ios option groups. The native SDKs take only their own platform’s options.
- React Native
- Flutter
- Android (Kotlin)
- iOS (Swift)
Checkout Page Customization
The checkout page itself (which fields appear, the theme, and which payment methods show) is set on your server when you create the checkout session. Appearance Customization covers only the browser surface around it. The parameters below have the most effect on mobile conversion. ये parameters checkout session request में तीन स्थानों पर होते हैं: top level पर,customization में, या feature_flags में। Where it goes column प्रत्येक parameter के object का नाम बताता है। प्रत्येक parameter को दिखाए गए object में रखें, क्योंकि गलत object में रखा गया parameter कोई प्रभाव नहीं डालता।

show_order_details: false moves the contact and payment fields above the fold, instead of behind the order summary.
minimal_address: true to collect only a postcode instead of the full street, city, and state fields:

minimal_address: true reduces the billing address to a single postcode field.
theme: "system" so the checkout follows the device’s light or dark mode preference:

With theme: system, the checkout follows the device's light or dark appearance automatically.
Full checkout session parameter reference
Mobile-Optimized Recipes
Each recipe is a complete checkout session request that your backend sends. Pick the one that matches your scenario and replace the product ID with your own. The Node.js and Python clients are set up in the first recipe, and the other recipes reuse them.Minimal Mobile Checkout - fastest path to payment
Minimal Mobile Checkout - fastest path to payment
- Node.js SDK
- Python SDK
One-Click Returning Customer - saved card, instant confirmation
One-Click Returning Customer - saved card, instant confirmation
customer_id, their saved payment_method_id, and confirm: true to skip the checkout form. With a payment_method_id, the session charges the saved method directly and returns no checkout_url, so your app has nothing to open. Learn the outcome from webhooks.- Node.js SDK
- Python SDK
payment.succeeded webhook. Any status your app shows is a UI hint only.Subscription with Free Trial - trial before first charge
Subscription with Free Trial - trial before first charge
trial_period_days sets the trial length for this session.- Node.js SDK
- Python SDK
subscription.active webhook, not when the mobile SDK returns. For the full webhook flow, see the Subscription Integration Guide.On-Demand Mandate - save a card for future variable charges
On-Demand Mandate - save a card for future variable charges
- Node.js SDK
- Python SDK
Subscription Flows from Mobile
A mobile app starts a subscription with the same checkout session flow as a one-time payment. The SDK opens hosted checkout, the customer subscribes, and your app handles the deep-link return. Your backend manages the rest of the subscription lifecycle.Regular Recurring Subscriptions
For billing at a fixed interval, such as monthly or yearly, create a checkout session with a subscription product and a deep-linkreturn_url. Your backend receives subscription.active when the subscription starts.
On-Demand Subscriptions
An on-demand subscription authorizes a customer’s payment method once, so you can charge variable amounts later. Use it for wallet top-ups, pay-as-you-go, and any charge whose amount you don’t know in advance. For the full request body, see the On-Demand Mandate recipe. On mobile, keep these points in mind:- Set
show_on_demand_tag: falseso the checkout page doesn’t show subscription or on-demand wording. Customers who save a card for top-ups don’t expect subscription terms. - After the customer authorizes the mandate, your backend receives
subscription.active. Store thesubscription_id, because every later charge uses it.
Subscription with Free Trial
To offer a trial before the first charge, passsubscription_data.trial_period_days in the checkout session. The customer authorizes a payment method at signup, and Dodo Payments charges it when the trial ends. For the full request body, see the Subscription with Free Trial recipe.
Upgrades and Downgrades
Your backend changes plans through the API, not through a new checkout session. Dodo Payments calculates proration with the proration mode you choose. To let customers change plans themselves, link to the Customer Portal.Subscription Integration Guide
On-Demand Subscriptions
Upgrade / Downgrade
Customer Portal
Reducing Checkout Drop-Offs
छोटी screen पर प्रत्येक form field भरने में अधिक प्रयास लगता है। नीचे दी गई checkout session settings form को छोटा करती हैं और drop-offs कम करती हैं।Optimize the Form
These settings shorten the checkout form on mobile:Pre-Fill Customer Data
Each field you pre-fill is one the customer doesn’t have to type:- New customers: set
customer.emailandcustomer.namefrom your auth session. - Returning customers: set
customer.customer_idto use the customer’s stored details. - Currency: pass
billing_currencyandbilling_address.countrytogether.
Recovery Tools
Recovery tools bring back customers whose checkout or renewal didn’t complete:Abandoned Cart Recovery
Payment Retries
Subscription Dunning
Recovery Overview
Best Practices
- Security: अपनी app में कभी भी API key शामिल न करें। अपने backend पर checkout sessions बनाएँ और app को केवल
checkout_urlभेजें। - Authority:
CheckoutResult.statusको UI hint मानें। Access केवल तब दें जब आपका backend payment की पुष्टि कर दे। - User Experience: जब आपका backend session बना रहा हो, तब loading state दिखाएँ।
cancelledको failure न मानें, क्योंकि payment अभी भी सफल हुआ हो सकता है। - Testing: test mode और test cards का उपयोग करें, और real device के साथ-साथ simulator पर भी return URL round trip जाँचें।
- Conversion:
show_order_details: falseऔरminimal_address: trueसेट करें। साथ में, ये payment methods को above the fold ले आते हैं और अधिकांश address fields हटा देते हैं। - Currency:
billing_currencyऔरbilling_address.countryदोनों pass करें। यदि आप इनमें से किसी एक को छोड़ देते हैं, तो Adaptive Currency ग्राहक के IP address से billing currency चुन सकता है। - On-demand billing: जब आप on-demand subscriptions का उपयोग केवल card save करने के लिए करते हैं, तब
show_on_demand_tag: falseसेट करें। जो ग्राहक wallet में top up करते हैं, वे subscription wording की अपेक्षा नहीं करते। - Recovery: checkout पूरा न करने वाले ग्राहकों को email भेजने के लिए dashboard में Abandoned Cart Recovery चालू करें।
Troubleshooting
Common Issues
- Callback कभी नहीं आता:
returnUrlमें scheme आपके द्वारा registered scheme से match होना चाहिए। Android पर यहdodoCallbackSchememanifest placeholder होता है। iOS पर यहInfo.plistURL type होता है। React Native और Flutter apps को दोनों की आवश्यकता होती है, और Expo में config plugin दोनों सेट करता है। - Checkout आपकी app के बजाय browser में लौटता है (iOS): आपकी app incoming URL को forward नहीं करती।
.onOpenURL,scene(_:openURLContexts:), या React NativeLinkinglistener सेDodoCheckout.handleOpenURL(url)call करें। - Android पर
PLATFORM_ERROR: सबसे सामान्य कारण scheme mismatch है। यह तब भी दिखाई देता है जब आपकाMainActivityandroid:taskAffinity=""(flutter createdefault) सेट करता है, जिससे कुछ Android OEM builds in-progress checkout खो सकते हैं। ALREADY_IN_PROGRESS: एक checkout अभी भी open है। दूसरा शुरू करने से पहले पिछले checkout के पूरा होने की प्रतीक्षा करें या उसे dismiss करें।- Unresolved placeholder के कारण build fail होता है: आपने Android SDK जोड़ा है, लेकिन
manifestPlaceholders["dodoCallbackScheme"]सेट नहीं किया। - Payment सफल हुआ, लेकिन access नहीं दिया गया: आपकी app mobile result से access दे रही है। इसके बजाय
payment.succeededयाsubscription.activewebhook से access दें। - Mobile पर Apple Pay या Google Pay दिखाई नहीं देता: जाँचें कि checkout embedded WebView (
WKWebViewया AndroidWebView) के अंदर तो load नहीं हो रहा। इसे SDK के साथ या system browser surface में खोलें: Android पर Custom Tab में, या iOS परSFSafariViewControllerयाASWebAuthenticationSessionमें।
Additional Resources
- Payment Integration Guide
- Webhook Documentation
- Testing Process
- Technical FAQs
- Checkout Session Customization
- On-Demand Subscriptions
- Subscription Upgrade/Downgrade
- Abandoned Cart Recovery
- Customer Portal
