Skip to main content
This is the official Dodo Payments Flutter package (dodopayments_checkout on pub.dev). A separate, community-built package also exists, see Community Projects.

Checkout Sessions API

Create the checkout_url this SDK opens, from your backend.

Mobile Integration Guide

See how this fits into the full mobile payment flow.
dodopayments_checkout opens Dodo’s hosted checkout in SFSafariViewController on iOS and a Chrome Custom Tab on Android — the same native cores used by the standalone iOS and Android SDKs. All checkout logic lives in those native cores; the Dart layer passes the call through a typed Pigeon channel. It holds no API key and never calls the Dodo Payments API. Requires Flutter 3.44+ / Dart 3.12+, iOS 16+, and Android minSdk 23.

Installation

1

Add the Dependency

pubspec.yaml
2

Register a Callback URL Scheme

Add a URL type for your scheme in ios/Runner/Info.plist:
ios/Runner/Info.plist
Then forward incoming URLs (e.g. via app_links) into the SDK, because SFSafariViewController cannot catch its own return URL:
It’s safe to forward every URL here. handleOpenURL only acts on URLs matching your registered returnUrl and resolves false for anything else.

Usage

What the Result Means

result.status is a UI hint, not proof of payment. Confirm every payment from your backend, via the payment.succeeded / subscription.active webhook.
CheckoutStatus
required
One of succeeded, failed, cancelled, pending, expired.
String?
Set when the return URL included one. Display it in the UI, don’t use it to grant access. See Verify the Payment below.
String?
Set for subscription checkouts.
List<String>?
Set when the checkout includes license key products.
String?
Set when the checkout captures an email.
Map<String, String>
Every query parameter from the return URL, verbatim.

Verify the Payment

Webhooks

Dodo Payments calls your backend when a payment succeeds or a subscription activates.

Get Payment Detail

Look up paymentId with your secret key to check its status directly.
Grant access after one of these confirms the payment, never from result.status alone.

Appearance Customization

Customize the checkout browser’s toolbar, buttons, and color scheme via customization on CheckoutParams. Options are grouped by platform because Android’s Custom Tab and iOS’s SFSafariViewController expose different native controls. All fields are optional; omitting customization uses each platform’s default appearance.
Color?
Toolbar background color.
Color?
Navigation bar color.
Color?
Divider color above the navigation bar.
CloseButtonStyle
standard shows the system “X” icon; back draws a back arrow instead.
CloseButtonPosition
Which side of the toolbar the close button appears on.
bool
Shows the toolbar’s share icon.
bool
Shows the page title under the URL in the toolbar.
bool
Lets the toolbar auto-hide as the page scrolls.
bool
Shows “Bookmark this page” in the overflow menu.
bool
Shows “Download page” in the overflow menu.
BrowserColorScheme
Forces light or dark appearance regardless of the device’s system setting.
DismissButtonStyle
Label or icon for the dismiss button.
PresentationStyle
pageSheet presents as a card with swipe-to-dismiss; fullScreen covers the whole screen.
bool
Lets the toolbar collapse on scroll. Only visible when presentationStyle is fullScreenpageSheet keeps the bars pinned regardless of this setting.
BrowserColorScheme
Forces light or dark appearance regardless of the device’s system setting.

Errors

start throws CheckoutException only for misuse or a platform failure. A cancelled or declined payment is always a result, never an exception.
  • invalidCheckoutUrl (INVALID_CHECKOUT_URL): not a checkout.dodopayments.com session URL.
  • invalidReturnUrl (INVALID_RETURN_URL): not a valid absolute URL.
  • alreadyInProgress (ALREADY_IN_PROGRESS): a checkout is already running.
  • platformError (PLATFORM_ERROR): unexpected platform failure.

Abandoned Sessions

If the app is killed mid-checkout, recover the session on next launch and reconcile it with your backend.

Mobile Integration Guide

The same contract for Android, iOS, and React Native.

Community Projects

A separate, community-built Flutter package also exists.
Last modified on August 8, 2026