Quick Start

This tutorial takes you from an initialized SDK to your first sale on the terminal.

Before you begin

Complete the Prerequisites and Add the SDK to your project.

Step 1: Initialize the SDK

Initialize the SDK once, during your application's startup, with ApoloSdk.Builder. The build() call starts the warm-up, which loads the terminal configuration and authenticates with the payment services.
kotlin
ApoloSdk.Builder(applicationContext) .setCredentials( clientId = "your_client_id", clientSecret = "your_client_secret", terminalCode = "your_terminal_code", partnerName = "your_partner_name", partnerPackageName = "com.yourcompany.app", ) .setOnWarmUpStatus { status -> when (status) { WarmUpStatus.Loading -> { /* keep the UI in a waiting state */ } WarmUpStatus.Success -> { /* the SDK is ready to operate */ } is WarmUpStatus.Failure -> { /* show the cause; recover with shutdown() + build() */ } } } .build()
Wait for WarmUpStatus.Success before starting any operation. A Failure carries its cause — for example, a 401 for invalid credentials. To recover, call ApoloSdk.shutdown() and then build() again.

Step 2: Get the client

After a successful warm-up, get the initialized client:

kotlin
val apolo = ApoloSdk.getClient()

Step 3: Run your first sale

Start a direct credit sale for a fixed amount in cents. The terminal drives the card capture, PIN, and confirmation, and the result arrives in the callback.

kotlin
apolo.initSale( context = activity, saleSetup = BrSaleSetup.Credit(amountInCents = 1000L), // R$ 10.00 onPaymentResult = { result -> // result.result == "00" indicates an approved transaction }, )

Verify the integration

CheckWhat to expect
Gradle syncCompletes without JDK errors.
DependencyThe SDK resolves from brazil-hml in the debug build type.
InitializationsetOnWarmUpStatus emits WarmUpStatus.Success.
Client accessAfter warm-up, ApoloSdk.getClient() returns the client without throwing.

Next steps