--- title: "Step 3: Initializing and Loading the SDK" slug: "step3-initializing-and-loading-the-sdk" updated: 2026-05-22T16:16:15Z published: 2026-05-22T16:16:15Z canonical: "developer.upgrade.com/step3-initializing-and-loading-the-sdk" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.upgrade.com/llms.txt > Use this file to discover all available pages before exploring further. # Step 3: Initializing and Loading the SDK ### Initializing and Loading the SDK To initialize the SDK, create a `ULConfiguration` object. This will store basic settings, the api key, and the up-code which will be given to each partner by Flex Pay Representative. Once created, set it to the `ULUpliftSDK`. It is highly recommended to not hardcode the UP-Code and API key in the source code, instead store them securely. E.g.: in a `.properties` file that is not pushed to a git repository. Flex Pay manages all partner configuration and offerings through unique partner IDs that are called up-codes. Partners are provided two up-codes, one for development and one for production. It is crucial to diligently use the correct up code for each respective stage, whether it is development or production. It is important to note that several functionalities of the **SDK** are only accessible after successful initialization. If the application tries to use these functions without initialization, an `ULError` exception is thrown, with the `ULErrorTypeSDKNotInitialized` type. The technical documentation provides detailed information on which method calls require initialization. ``` val apikey = "your api key goes here" val upCode = "UP-xxxxxx-xx" val configuration = ULConfiguration( upCode = upCode, apiKey = apikey ) ULUpliftSDK.getInstance().setConfiguration(this, configuration, object : ConfigurationCallback { override fun onSuccess() { // This method will be triggered when the initialize method succeeded } override fun onError(error: ULError) { // This method will be triggered when the initialize method failed } }) ``` After successfully configuring the **SDK**, it automatically sets the initial locale associated with the up-code. This can be modified at any time by the host application. All that is required is to set a `ULLocale` object to the **SDK**. This object defines the language and currency used in the **SDK**. Please note that you can only use locales that are available for your up-code. Once you have successfully configured the **SDK**, you can check the list of available locales and currencies. ``` val locale = Locale.US val currency = ULCurrency.ULCurrencyUSD val loc = ULLocale( locale = locale, ulCurrency = currency ) val error = ULUpliftSDK.getInstance().selectLocale(loc) if (error != null) { //Success locale setting } else { //Error at locale setting: } ```