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

# Initialize the SDK

This article explains how to configure and initialize the Payment Links SDK for Android.

## Configure the SDK

The Android Payment Links SDK exposes a `ConfigModel`. Create an instance with the following arguments:

<CodeGroup>
  ```kotlin Kotlin theme={"system"}
  let config = ConfigModel(
      checkoutPublicKey: "{YOUR_CHECKOUT_PUBLIC_KEY}",
      environment: "sandbox"
  )
  ```
</CodeGroup>

| Argument            | Type     | Description                                                                                                |
| ------------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| `checkoutPublicKey` | `String` | The Checkout Public Key. You can find it by going to the **Publisher Dashboard → Settings → Integration**. |
| `environment`       | `String` | The checkout environment. One of:<br />- `sandbox`: For testing.<br />- `production`: For live operations. |

## Initialize The SDK

When you initialize the Android Payment Links SDK, you need to provide a `customerId`. This allows the SDK to handle cases where the player closes the browser during checkout and later returns to the game. In such cases, the SDK begins validating the order using the `customerId` from initialization and the `purchaseId` from the checkout session.  It then contacts the Appcharge server to check the order status and responds to the app with the next step.

Additionally, the `customerId` ensures correct validation even if multiple players share the same device. For example, if a different player logs into the same game on the same phone, the SDK uses the `customerId` to identify the correct player and validate any associated orders with the Appcharge server.

Use the following function to initialize the SDK:

<CodeGroup>
  ```kotlin Kotlin theme={"system"}
  BridgeAPI.init(
      context: Context, 
      configModel: ConfigModel, 
      customerId: String, 
      callback: ICheckoutPurchase)
  ```
</CodeGroup>

| Argument      | Type                | Description                                   |
| ------------- | ------------------- | --------------------------------------------- |
| `context`     | `Context`           | Application or Current context.               |
| `configModel` | `ConfigModel`       | Configuration model for initializing the SDK. |
| `customerId`  | `String`            | Current customer ID.                          |
| `callback`    | `ICheckoutPurchase` | Interface callback.                           |
