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

# Launch the Checkout

To launch the checkout, follow these steps:

1. Create a checkout session using the [Create Checkout Session API](/../../api-reference/checkout/checkout-session/create-checkout-session). The API response includes `url`, `sessionToken`, and `purchaseId`. Save these values for the next step.
2. Open the checkout using this function, passing the saved values as arguments:
   <CodeGroup>
     ```csharp csharp theme={"system"}
     `CheckOutController.Instance.OpenCheckout(url, sessionToken, purchaseId)
     ```
   </CodeGroup>

The checkout opens in a new window and guides the player through the purchase process. If the request is successful, the`OnPurchaseSuccess` callback is triggered, indicating that the purchase was successful. If the request fails, the `OnPurchaseFailed` callback is triggered with an error code. Follow the instructions in the [WebGL SDK troubleshooting](./troubleshooting) article and try to re-initialize again based on the error.

For more details on the callbacks you need to implement and how to handle them, refer to the [Implement the WebGL SDK Callbacks](./implement-the-callbacks) article.

> **Important:**
>
> The checkout can only be launched if the SDK initialization is successful and the `OnInitialize` callback is triggered. If the initialization fails and the `OnInitializeFailed` callback is triggered with an error code, refer to the [WebGL SDK troubleshooting](./troubleshooting) article for guidance. Follow the instructions to re-initialize the SDK based on the specific error.
