Retrieving Your API Key

Create a key for the account and environment your app uses. See Getting an API Key for the dashboard walkthrough, screenshots, and equivalent API requests.

Create the Key

Follow Getting an API Key and select payments:tap-ios. This is the app key, also called the SDK client key. Copy the secret when it is shown, because generated secrets appear only once. Use the secret itself, not the key ID or the last four characters shown in the list.

Using Your API Key in the SDK

Pass your API key to the SDK when you initialize it, along with a KoardOptions value that selects the environment and logging level:

import KoardSDK


let options = KoardOptions(
environment: .uat,        // .uat | .production | .custom(String)
loggingLevel: .debug      // .none | .error | .warning | .debug | .verbose
)




KoardMerchantSDK.shared.initialize(options: options, apiKey: "your-koard-api-key")
  • environment accepts .uat, .production, or .custom(String) for a custom base URL.
  • loggingLevel accepts .none, .error, .warning, .debug, or .verbose. Use a lower level (such as .error or .none) for production builds.

Call initialize(options:apiKey:) once, early in your app lifecycle (for example in AppDelegate), before using any payment functionality.

Next Step

If you arrived from installation, continue with Initialize the SDK. If initialization is complete, continue to Running Payments.