> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kotlin

> Allow your Android users to buy stablecoins with credit cards and Google Pay

In this guide, you'll learn how to:

* Install the Kotlin SDK
* Create an Onramp order for your authenticated users
* Use the embedded checkout component to handle KYC, payment, and delivery

![Crossmint Onramp Embedded Checkout Demo](https://mintcdn.com/crossmint/O4OyJtPpVdTUXAHB/images/payments/embedded-v3/quickstart/onramp.png?fit=max\&auto=format\&n=O4OyJtPpVdTUXAHB\&q=85\&s=5aabaa680b80628ae36af70e98ea95e4)

Native Android onramp with Google Pay support

<Snippet file="before-you-start.mdx" />

> [card] [Kotlin SDK on GitHub](https://github.com/Crossmint/crossmint-kotlin-checkout)
>
> View the Kotlin checkout example repository.

<Snippet file="enterprise-feature-production.mdx" />

## Prerequisites

* **Android SDK 24+**
* **Jetpack Compose**
* Android Studio Arctic Fox or later

Install the Crossmint Kotlin SDK using Maven Central.

Add the following dependency to your app's `build.gradle.kts` file:

```kotlin theme={null}
dependencies {
    implementation("com.crossmint:crossmint-sdk-android:0.0.9")
}
```

* Create a [server-side API key](https://docs.crossmint.com/introduction/platform/api-keys/server-side.md) with the
  `orders.create` and `orders.read` scopes enabled. In staging, all scopes are included in your API key.

## Add Onramp to Your App

### 1. Create the order

> [!NOTE]
>
> If you want to enable onramp orders to external wallets (EOAs or third-party smart wallets) instead of Crossmint wallets, see the [Onramp to External Wallets](https://docs.crossmint.com/onramp/guides/onramp-to-external-wallets.md) guide before proceeding.

Use the [Create Order API](https://docs.crossmint.com/api-reference/headless/create-order.md) to initiate the purchase process from your backend.

<Snippet file="onramp-create-order.mdx" />

### 2. Use the checkout component

Once you have the order response with `orderId` and `clientSecret`, use Crossmint's embedded checkout component in your Jetpack Compose view.

The component supports **native Google Pay** for a seamless Android payment experience.

```kotlin theme={null}
import com.crossmint.kotlin.checkout.CheckoutEnvironment
import com.crossmint.kotlin.checkout.CrossmintEmbeddedCheckout
import com.crossmint.kotlin.checkout.models.*

CrossmintEmbeddedCheckout(
    orderId = "<your_order_id>",
    clientSecret = "<your_client_secret>",
    payment = CheckoutPayment(
        crypto = CheckoutCryptoPayment(enabled = false),
        fiat = CheckoutFiatPayment(
            enabled = true,
            allowedMethods = CheckoutAllowedMethods(
                googlePay = true,  // Native Google Pay support
                applePay = false,
                card = true
            )
        )
    ),
    appearance = CheckoutAppearance(
        rules = CheckoutAppearanceRules(
            destinationInput = CheckoutDestinationInputRule(display = "hidden"),
            receiptEmailInput = CheckoutReceiptEmailInputRule(display = "hidden")
        )
    ),
    environment = CheckoutEnvironment.STAGING
)
```

**Key features:**

* **Native Google Pay**: Seamless integration with Android payment system
* **Jetpack Compose Components**: Modern declarative UI framework
* **Automatic KYC**: Handles verification flow automatically
* **Customizable Appearance**: Control visibility of UI elements

### 3. Track the order

<Snippet file="onramp-track-order.mdx" />

## Transaction Completion

<Snippet file="onramp-transaction-completion.mdx" />

## Next Steps

<Snippet file="onramp-next-steps.mdx" />

* View the [Kotlin checkout example repo](https://github.com/Crossmint/crossmint-kotlin-checkout) on GitHub
