bolt.com is getting a new home → boltapp.com. Click here to transition smoothly to boltapp.com.

Skip to content

Android SDK API reference

Look up checkout delegates, results, callbacks, and shipping types in the Bolt Android SDK.

View As MarkdownMCP

This reference matches com.bolt:checkout version 0.9.0, available on Maven Central.

BoltCheckoutDelegate

Implement this delegate when using getBoltCheckoutActivityResultLauncher().

Terminal callbacks

CallbackParametersDescription
onCheckoutSuccess(result)result: BoltCheckoutResultCheckout completed. Use the returned references for client-side display, then reconcile the order on your backend.
onCheckoutError(errorReason)errorReason: StringCheckout failed and returned an error string.
onCheckoutCancel()(none)The shopper dismissed checkout.

Lifecycle callbacks

These default to no-op and are useful for analytics:

CallbackParametersDescription
onCheckoutStart()(none)Checkout flow started and the UI is presented.
onEmailEnter(email)email: StringThe shopper entered an email address.
onShippingDetailsComplete(address)address: BoltShippingAddressThe shopper submitted shipping details.
onShippingOptionsComplete()(none)The shopper completed shipping-option selection.
onPaymentSubmit()(none)User tapped the pay button.
onCartLoaded()(none)The cart loaded in checkout.
onNotify(eventName, eventSeverity)eventName: String, eventSeverity: StringCheckout emitted a notification event.

Request callbacks

These are request/response callbacks: checkout sends a request and waits for your app to respond. Both are suspend functions, so you can perform asynchronous work before returning.

CallbackReturn TypeDescription
check()BooleanCalled before checkout opens. Return true to proceed, false to cancel (e.g. cart validation failed). Defaults to true.
fetchShippingOptions(address)BoltShippingAndTaxResult?Called with a BoltShippingAddress. Return shipping options and tax, or null. Defaults to null.

BoltCheckoutResult

onCheckoutSuccess receives a BoltCheckoutResult with these fields:

FieldTypeDescription
orderReferenceStringBolt order reference.
transactionReferenceStringBolt transaction reference.
transactionStatusStringTransaction status returned to the client.
orderDisplayIdStringMerchant-facing order display ID.
totalAmountIntTotal in minor currency units.
taxAmountIntTax in minor currency units.
shippingAmountIntShipping amount in minor currency units.
currencyStringISO 4217 currency code.
currencySymbolStringDisplay symbol for the currency.

BoltLoginDelegate

Implement this delegate when using getLoginActivityResultLauncher().

CallbackParametersDescription
onLoginSuccess(authCode, codeVerifier, state)authCode: String, codeVerifier: String, state: StringUser authenticated successfully. Send authCode and state to your backend for token exchange.
onLoginError(errorReason)errorReason: StringLogin failed (network error, invalid session, or user denied permissions).
onLoginCancel()(none)User dismissed the login screen. No partial session is created.

BoltPaymentFlowDelegate

Implement this delegate when using getPaymentFlowActivityResultLauncher(). The payment flow is a standalone UI for collecting and tokenizing a payment method without running the full checkout.

CallbackParametersDescription
onPaymentFlowSuccess(paymentFlowMethod, creditCard)paymentFlowMethod: BoltPaymentMethod, creditCard: BoltCreditCard?Card successfully tokenized. creditCard contains token, last4, network, expiration, and postal code.
onPaymentFlowError(errorReason)errorReason: StringTokenization or network failure.
onPaymentFlowCancel()(none)User dismissed the payment collection screen.

BoltPaymentAuthorizationDelegate

Implement this delegate when calling authorizePayment(). Used in custom checkout flows where you collected a card via the payment flow.

CallbackParametersDescription
onPaymentAuthorizationSuccess(orderReference)orderReference: StringPayment authorized. Use the reference to confirm the order with your backend.
onPaymentAuthorizationFail(status, reason)status: String, reason: StringAuthorization declined by the processor (e.g. insufficient funds, suspected fraud).
onPaymentAuthorizationError(errorReason)errorReason: StringRequest failed before reaching the processor (e.g. network timeout, missing tokenized card).

Shipping types

BoltShippingOption

Each entry in BoltShippingAndTaxResult.shippingOptions:

FieldTypeDescription
serviceStringHuman-readable shipping method name (e.g. "Standard Shipping").
costLongShipping cost in minor currency units (cents).
currencyStringISO 4217 currency code.
referenceStringIdentifier for this shipping option.
carrierStringCarrier name.
estimatedDeliveryDateStringEstimated delivery date.
taxAmountLongTax on the shipping option in minor currency units.

BoltShippingAndTaxResult

Return type for fetchShippingOptions:

FieldTypeDescription
shippingOptionsList<BoltShippingOption>Available shipping options to display in checkout.
taxAmountLongCart-level tax in minor currency units.
taxCurrencyStringISO 4217 currency code for taxAmount.

On this page