> ## 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 Mobile Checkout SDK

Now, initialize the Checkout via the Bridge instance:

<CodeGroup>
  ```kotlin kotlin theme={"system"}
  bridge.init(this, configModel, customerId, gaid, object : ICheckoutPurchase {  
      override fun onInitialized() {  
          onResult("Initialize Complete")  
      }  

      override fun onInitializeFailed(error: ErrorMessage) {  
          onResult("Initialization failed - $error") 
      }

      override fun onPurchaseSuccess(order: OrderResponseModel, sessionMetadata: String) 
          // Handle purchase success  
          // SessionMetadata Holds the metadata information of the order
          runOnUiThread {   
              onResult("Purchase complete $order")  
          }  
      }

      override fun onPurchaseFailed(error: ErrorMessage, sessionMetadata: String) {
          // Handle purchase failure  
          // SessionMetadata Holds the metadata information of the order
          runOnUiThread {  
              onResult("Purchase fail - $error")  
          }
      }

      override fun onPricePointsSuccess(pricePoints: PricePointsModel) {
          runOnUiThread {  
              onResult("Price points complete - $pricePoints")  
          }
      }
      
      override fun onPricePointsFail(error: ErrorMessage) { 
          runOnUiThread {    
              onResult("Price points fail - $error")  
          }  
      }

      override fun onPurchaseConsumed(consumed: Boolean) {
          runOnUiThread {
              if (consumed) {
                  onResult("Purchase Consumed success")
              }
              else {
                  onResult("Purchase Consumed failed")
              }
          }
      }
  )
  ```
</CodeGroup>

The bridge initialization requires three arguments:

| Argument            | Description                                 |
| ------------------- | ------------------------------------------- |
| `Context`           | The current/main Activity context           |
| `ConfigModel`       | Configuration options for initialization    |
| `customerId`        | Customer Identification                     |
| `gaid`              | Google Advertising ID                       |
| `ICheckoutPurchase` | Checkout interface will be used as callback |

The ICheckoutPurchase interface exposes 6 methods:

| Method                 | Description                                                                                                                                               |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onInitialized`        | Triggered when checkout initialization is complete.                                                                                                       |
| `onInitializeFailed`   | Triggered when checkout initialization failed.                                                                                                            |
| `onPurchaseSuccess`    | Triggered when checkout initialization is successfully completed.                                                                                         |
| `onPurchaseFailed`     | Triggered when the purchase has failed. An error message will be presented.                                                                               |
| `onPricePointsSuccess` | Triggered when the price points have successfully been retrieved.                                                                                         |
| `onPricePointsFail`    | Triggered when no price points are available, could not be retrieved.                                                                                     |
| `onPurchaseConsumed`   | Triggered when the `consumed` action is either successful or has failed. The `consumed` argument indicates whether the action was a success or a failure. |
