Skip to main content
Primer Checkout Android SDK is currently in beta (v3.0.0-beta.2). The API is subject to change before the stable release.

Prerequisites

Install the SDK

Add the Primer Checkout SDK dependency to your module-level build.gradle.kts:
dependencies {
    implementation("io.primer:checkout:3.0.0-beta.2")
}
Or using the BOM for version management:
dependencies {
    implementation(platform("io.primer:primer-sdk-android-bom:3.0.0-beta.2"))
    implementation("io.primer:checkout")
}

Compose Setup

Ensure Jetpack Compose is enabled in your module-level build.gradle.kts. The SDK uses the Kotlin Compose Compiler plugin — add it to your plugins block instead of setting kotlinCompilerExtensionVersion:
plugins {
    id("org.jetbrains.kotlin.plugin.compose") version "<your-kotlin-version>"
}

android {
    buildFeatures {
        compose = true
    }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2025.12.00"))
    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.material3:material3")
    implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
}
The Primer SDK is built against a specific Compose BOM version. We recommend aligning your app’s BOM version with ours to avoid binary incompatibilities. See the Compose BOM to library version mapping for details.

Basic Usage

Add the checkout to your Composable:
@Composable
fun CheckoutScreen(clientToken: String) {
    val checkout = rememberPrimerCheckoutController(
        clientToken = clientToken,
    )

    PrimerCheckoutSheet(
        checkout = checkout,
        onEvent = { event ->
            when (event) {
                is PrimerCheckoutEvent.Success -> { /* Navigate to confirmation */ }
                is PrimerCheckoutEvent.Failure -> { /* Error is shown in the UI */ }
            }
        },
    )
}

Verify Installation

Build your project to confirm the SDK is resolved correctly:
./gradlew assembleDebug
If the build succeeds, the SDK is installed and ready to use.

ProGuard / R8

The SDK includes its own ProGuard rules. No additional configuration is needed for release builds.

Next Steps

First Payment

Accept your first payment

Theming

Customize the appearance

Core Concepts

Understand the architecture

Settings

Configure SDK behavior