> ## 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

<Note>
  The Kotlin SDK is currently in **Beta**.
</Note>

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

<Frame type="simple" caption="Native Android onramp with Google Pay support">
  <img src="https://mintcdn.com/crossmint/O4OyJtPpVdTUXAHB/images/payments/embedded-v3/quickstart/onramp.png?fit=max&auto=format&n=O4OyJtPpVdTUXAHB&q=85&s=5aabaa680b80628ae36af70e98ea95e4" alt="Crossmint Onramp Embedded Checkout Demo" width="1734" height="1220" data-path="images/payments/embedded-v3/quickstart/onramp.png" />
</Frame>

<CardGroup cols={2}>
  <Snippet file="before-you-start.mdx" />

  <Card title="Kotlin SDK on GitHub" icon="github" iconType="duotone" href="https://github.com/Crossmint/crossmint-kotlin-checkout">
    View the Kotlin checkout example repository.
  </Card>
</CardGroup>

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

## Requirements

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

## 1. Installation

Install the Crossmint Kotlin SDK using Maven Central.

<Steps>
  <Step title="Add Dependency">
    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")
    }
    ```
  </Step>

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

## 2. Create 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](/onramp/guides/onramp-to-external-wallets) guide before proceeding.
</Note>

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

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

## 3. Use 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

## 4. Track Order

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

## 5. Transaction Completion

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

## 6. Next Steps

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

* View the <a href="https://github.com/Crossmint/crossmint-kotlin-checkout" target="_blank" rel="noopener noreferrer">Kotlin checkout example repo</a> on GitHub
