Overview
The Bolt Android SDK provides a managed checkout flow that handles the entire payment experience: shipping, payment entry, 3D Secure challenges, and order completion. To launch checkout, your backend generates an order token and your app passes it to the SDK.
Generating an Order Token (Backend)
Before launching the checkout UI, your backend server must create an order token by calling the Bolt Merchant Orders API. This token represents the cart and is required by the SDK to start checkout.
The API key used to authenticate this request is a secret. This call must be made from your server: never from the mobile app.
Request
Request Body
All amounts are in cents (e.g. 1783 = $17.83).
Response
Your backend returns this token to your mobile app, which then passes it to the SDK.
End-to-End Flow
- User taps “Checkout”: app sends cart details to your backend.
- Your backend calls
POST /v1/merchant/orders with the cart and your API key.
- Bolt returns the order token; your backend forwards it to the app.
- App passes the token to the SDK.
- SDK presents the checkout experience.
- App receives the result (success, cancelled, or failed).
Implementing the Checkout Flow
To handle the checkout process, register an ActivityResultLauncher and implement BoltCheckoutDelegate to manage the success, error, and cancellation states.
Complete Example (Activity)
Launching from a Fragment
If you are launching checkout from within a Fragment, use the fragment overload:
Pre-Filling Customer Data
Use BoltMerchantHints to pre-fill customer details and reduce friction during checkout:
UI Modes
Currently, the SDK supports WebView mode only. The checkout experience is rendered via a Bolt-hosted WebView. Native checkout mode is planned for a future release.