Bolt has moved to boltapp.com. Stores still using bolt.com hosts must update now: see the migration guide.

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.10.2, available on Maven Central.

BoltCheckoutDelegate

Implement this delegate when using getBoltCheckoutActivityResultLauncher(). All delegate types are in the com.bolt.checkout.intl package.

Terminal callbacks

CallbackParametersDescription
onCheckoutSuccess(result)result: BoltCheckoutResultCheckout completed. Use result.reference, result.cart?.orderReference, and result.merchantOrderNumber 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.
onCartLoaded()(none)The cart loaded in checkout.
onEmailEnter(email)email: StringThe shopper entered and validated an email address.
onShippingDetailsComplete(address)address: BoltShippingAddressThe shopper submitted contact and shipping details.
onShippingOptionsComplete()(none)The shopper selected a shipping option and moved to payment.
onPaymentSubmit(customFields)customFields: Map<String, BoltCustomFieldValue>The shopper tapped the pay button. The map holds merchant-configured custom field values keyed by field ID, and is empty when checkout sent none.
onNotify(event)event: BoltCallbackEventCheckout emitted a notification event, such as an error banner.
onCheckoutBack(nextStep)nextStep: String?The shopper navigated backward. Fires only when the back button is enabled for your division. nextStep can be null.
onCheckoutGoToStep(nextStep)nextStep: StringThe shopper moved forward to a checkout step.
onCheckoutLogout(initialStep)initialStep: StringThe shopper logged out inside checkout. initialStep is the step checkout returns to.
onPlatformLoginSuccess(silentLogin)silentLogin: BoltSilentLoginThe shopper signed in to Bolt during checkout. Call silentLogin.authorize { result -> } to get an SSO authorization code without showing a login screen. Nothing runs if you do not call it.
onUpsellPageShown(cart)cart: BoltTransactionCart?A post-purchase upsell offer was displayed.
onUpsellDecision(cart, decision)cart: BoltTransactionCart?, decision: BoltUpsellDecisionThe shopper reached a final decision on the upsell offer.

Step names in onCheckoutBack, onCheckoutGoToStep, and onCheckoutLogout are open-ended strings such as shipping_info and payment. Handle values you do not recognize.

onPaymentSubmit() and onNotify(eventName, eventSeverity) from earlier versions still exist. The SDK calls the new overloads, which forward to the old ones by default. Override only one version of each.

Callback event types

TypeFieldsDescription
BoltCallbackEventeventName: String, eventSeverity: String, eventMetadata: Map<String, String>eventSeverity is "error", "warning", or "info". Nested metadata objects arrive as JSON strings.
BoltCustomFieldValueText(value: String) or Toggle(value: Boolean)A custom field value. Fields with no value are left out of the map.
BoltUpsellDecisionACCEPTED, DECLINED, TIMED_OUT, ABANDONED, UNKNOWNUNKNOWN covers decisions this SDK version does not recognize.
BoltSilentLoginResultSuccess(authCode: String, state: String) or Failure(reason: String)Result passed to BoltSilentLogin.authorize. Send authCode and state to your backend for token exchange, as in SSO login.

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)BoltFrontendShippingAndTaxResult?Called with a BoltShippingAddress. Return shipping options and tax, or null to fall back to backend shipping. Defaults to null.

BoltCheckoutResult

onCheckoutSuccess receives a BoltCheckoutResult that mirrors Bolt's client transaction view. Fields marked ? can be null. Amounts are in minor currency units.

Field names and types match the published 0.10.2 artifact. Which optional fields are populated for a given checkout is not yet verified against 0.10.2.

Reconciliation fields

FieldRole
referenceBolt transaction reference. Replaces 0.9.0's transactionReference.
cart?.orderReferenceBolt order reference. Replaces 0.9.0's orderReference.
merchantOrderNumberYour merchant-facing order number when Bolt provides it.
statusTransaction status. Replaces 0.9.0's transactionStatus.
amountCharged total as a BoltAmountView. Replaces 0.9.0's totalAmount, currency, and currencySymbol.

The 0.9.0 fields orderDisplayId, taxAmount, and shippingAmount are no longer top-level fields. Tax and shipping details are in cart?.taxAmount and shippingOption.

Transaction core

FieldTypeDescription
idStringTransaction ID.
typeStringTransaction type.
processorStringPayment processor identifier.
dateLongTransaction timestamp.
referenceStringTransaction reference.
statusStringOverall transaction status.
amountBoltAmountViewPrimary amount: use for display and reconciliation.

BoltAmountView

FieldTypeDescription
amountLongAmount in minor currency units (e.g. cents).
currencyStringISO 4217 code (e.g. "USD").
currencySymbolStringDisplay symbol (e.g. "$").

Parties and payment instruments

FieldTypeDescription
fromConsumerBoltConsumerView?Payer (id, email, firstName, lastName, phone).
toConsumerBoltConsumerView?Payee when applicable.
fromCreditCardBoltCreditCardView?Card used (id, last4, bin, expiration, network, billingAddress, and more).
toCreditCardBoltCreditCardView?Destination card when applicable.
last4String?Last four digits of the card at the transaction level.

Authorization, capture, and risk

FieldTypeDescription
authorizationBoltAuthorizationView?status and reason for the authorization decision.
capturesList<BoltCaptureView>?Capture records (status, amount as BoltAmountView).
creditBoltCreditView?Credit status when present.
transactionPropertiesBoltTransactionProperties?avsResult and cvvResult from the processor.
orderDecisionBoltOrderDecisionView?Order decision (score, decisionFactors).
riskScoreDouble?Risk score when provided.
customerListStatusBoltCustomerListStatus?autoApproved, blockListed.
indemnificationDecisionString?Indemnification decision when applicable.
indemnificationReasonString?Indemnification reason when applicable.
splitsList<BoltTransactionSplitView>?Split amounts (amount, type).
lastViewedUtcLong?Last viewed time.
viewStatusString?View status.
hasRefundsBoolean?Whether refunds exist on the transaction.

Addresses and shipping

FieldTypeDescription
shippingAddressBoltAddressInput?Shipping address (firstName, lastName, company, streetAddress1, streetAddress2, locality, region, postalCode, countryCode, country, phone, email).
billingAddressBoltAddressInput?Billing address.
shippingOptionBoltShippingOption?Selected shipping option: valid, value, and error. When valid is true, value is a BoltCartShipmentView with service, cost, reference, carrier, estimatedDeliveryDate, taxAmount, and more.

In 0.10.2, BoltShippingOption is this result type. The shipping option you return from fetchShippingOptions is now BoltFrontendShippingOption.

Cart, integrations, and notes

FieldTypeDescription
cartBoltTransactionCart?orderReference, taxAmount, discounts (BoltCartDiscountView), and items (BoltCartItemView).
shopifyBoltShopifyResponse?Shopify-hosted payment fields when applicable.
sfccBoltSfccOrderResponse?Salesforce Commerce Cloud integration: sfccOrderToken when present.
customFieldResponsesList<BoltCustomFieldResponse>?Custom fields: publicId, response.
userNoteString?Shopper-supplied order note.

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

These types were renamed after 0.9.0: BoltShippingOption is now BoltFrontendShippingOption, and BoltShippingAndTaxResult is now BoltFrontendShippingAndTaxResult.

BoltFrontendShippingOption

Each entry in BoltFrontendShippingAndTaxResult.shippingOptions:

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

BoltFrontendShippingAndTaxResult

Return type for fetchShippingOptions:

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

On this page