Skip to main content
This guide walks you through integrating the Sezzle Android SDK into your app. By the end, your app will display Sezzle promotional messaging on product pages and launch Sezzle checkout.

Prerequisites

  • Android 6.0+ (API 23), compileSdk 35+
  • Kotlin or Java
  • A Sezzle merchant account with your Public API Key
  • A backend server to capture payments after checkout
A working example app is included in the SDK repo at example/. It demonstrates all widget variants and both checkout modes.

1. Installation

Add to your app module’s build.gradle.kts:
The SDK is published on Maven Central. No additional repository configuration is needed. Requirements: Android 6.0+ (API 23), compileSdk 35+

2. Configuration

Initialize the SDK once at app startup in your Application class:
Never include your private API key in the app. The SDK only uses the public key. Use your private key server-side to capture payments.

3. Promotional Messaging

Add a SezzlePromotionalView to your product screen to display installment pricing:
The widget automatically shows the correct message based on the price and updates when you call:
Android Widgets

Promotional widgets at different price points

All Parameters

The widget auto-detects dark mode and switches styles automatically. If you want to force a specific style, pass SezzlePromotionalStyle.LIGHT or SezzlePromotionalStyle.DARK explicitly.

Widget Configuration

All config parameters are optional — the widget works out of the box with sensible defaults: To customize, pass only the values you want to override:

Custom Promotional Text

If you need full control over the UI, use SezzlePromoDataHandler to get a styled SpannableString with the Sezzle logo inline:

4. Checkout

Build the Checkout Object

Customer Fields

Order Fields

Address Fields (SezzleAddress)

Start Checkout

The activity parameter must be a ComponentActivity (e.g., AppCompatActivity). The SDK uses the Activity Result API internally.

Handle the Result

Implement SezzleCheckoutListener:
After onCheckoutComplete, send result.orderUUID to your backend server. Your server should call POST /v2/order/{orderUUID}/capture using your private API key to capture the payment. See the Orders API for details.

5. WebView Mode

By default, checkout opens in Chrome Custom Tabs — a secure browser tab that runs in its own process and shares cookies with Chrome (faster login for returning Sezzle users). To keep the user inside your app, use WebView mode:
If your host activity can be destroyed and recreated while checkout is on screen — e.g. under Android’s “Don’t keep activities” developer option, under aggressive background-process limits, or under genuine memory pressure on low-RAM devices — prefer the startCheckoutForResult overload introduced in 1.2.4. It delivers the result through Android’s Activity Result API, which Android re-attaches on activity recreation, so the callback reliably reaches whichever instance is alive when checkout finishes. The listener-based path above stores your callback in a static field; if your activity is recreated mid-checkout, that callback may target a destroyed instance and the result can be lost. Register the launcher as a field on your activity (Android requires registerForActivityResult to be called before the activity reaches STARTED):
For the server-driven flow, use the URL-based overload:
This entrypoint always uses WEB_VIEW mode. For SYSTEM_BROWSER (Chrome Custom Tabs) checkout, continue using the listener-based startCheckout — the Custom Tabs flow has a different recreation profile and doesn’t have the same lifecycle hazard.
System Browser

Multi-user devices — clearing Sezzle session on logout

Android’s CookieManager is an app-wide persistent singleton. Cookies set during one user’s WEB_VIEW checkout (auth tokens, session identifiers) persist across users on the same device — so if your app supports multiple users (e.g. a logout/login flow on a shared device), the next user’s first BNPL attempt can resume the previous user’s Sezzle session and surface their state (credit-limit decline, etc.) to the wrong customer. Starting in 1.2.5, call SezzleSDK.clearWebViewData() from your logout flow to clear Sezzle’s cookies and Web storage before the next user signs in:
The clear is scoped to Sezzle’s own domains — your other cookies and Web storage are not touched. Safe to call repeatedly; safe to call when no Sezzle checkout has ever run. Preserves your app-wide CookieManager.acceptCookie() setting (privacy/GDPR/DNT modes are not silently flipped). SYSTEM_BROWSER mode shares cookies with Chrome and is unaffected — if your users need to clear those, they should clear them in Chrome itself.

6. Dark Mode

The SDK automatically adapts to the device’s appearance setting. The promotional widget, installment modal, and checkout modal all support dark mode.
Light Mode
If you need to force a specific style:

7. Error Handling

All errors are delivered via SezzleCheckoutListener.onCheckoutError(error):

8. Server-Driven Integration

For larger merchants who prefer a fully server-driven integration — no public key on-device, with the backend owning session creation, capture, and refunds — use the alternative startCheckout overload introduced in 1.2.0.

How it works

Your backend creates the checkout session via POST /v2/session with merchant-chosen callback URLs, then hands order.checkout_url plus those URLs to the app. The SDK opens the URL, intercepts navigation to your callback URLs, and reports back via SezzleCheckoutListener.onCheckoutComplete(result) with the full callback URL — so you can encode your own state in the query string and recover it on completion.

Step 1 — Backend creates the session

Pick any callback URLs you want — a custom scheme like yourapp-sezzle://... or HTTPS deep links. You can encode state in the query string (e.g. yourapp-sezzle://done?orderRef=12345) and recover it from the SDK callback. Persist order.uuid server-side; the app only needs order.checkout_url plus the two callback URLs.
Don’t put PII, auth tokens, or anything sensitive in the callback URL query string. The callback URL is rendered in the browser and may be logged. Use opaque references (a random orderRef mapped server-side) — never the customer’s email, phone, payment data, or session tokens.Custom URL schemes are also not exclusive — another app installed on the device can register the same scheme and intercept the callback. For maximum security in production, use App Links (verified HTTPS deep links) on Android — they’re tied to a domain you control, so other apps can’t claim them.

Step 2 — App presents checkout

SezzleSDK.configure(...) is not required for this flow — there’s nothing for the SDK to authenticate.

Step 3 — Read the result

Manifest note for SYSTEM_BROWSER mode

SYSTEM_BROWSER mode opens checkout in Chrome Custom Tabs and routes the redirect back via the OS intent system. The SDK ships an intent-filter for sezzle-sdk://checkout only — if you use a custom callback scheme, register an intent-filter for your scheme in your own AndroidManifest.xml, pointing at SezzleRedirectActivity:
WEB_VIEW mode needs no manifest work — any scheme is intercepted by the WebView client directly.

Notes

  • Match your URLs. Whatever your backend passed as complete_url.href / cancel_url.href, pass the same Uri to startCheckout. The SDK matches on scheme + host + path; query params on the inbound URL are read by you.
  • order.uuid lives on your server. It’s not in the checkout_url and isn’t echoed back — your backend already has it from the session-creation response.

9. Testing

Use the sandbox environment for testing:
Use the test data to complete test checkouts in sandbox.
Switch to SezzleEnvironment.PRODUCTION and your live public key before releasing to the Play Store.