Skip to main content
Primer Checkout Android SDK is currently in beta (v3.0.0-beta.8). The API is subject to change before the stable release.
Central interface for managing a checkout session. Create with rememberPrimerCheckoutController().

Creation

Interface

Property

Methods

Idempotency key

Set the X-Idempotency-Key header from the beforePaymentCreate gate on PrimerCheckoutSheet or PrimerCheckoutHost. The gate runs once per attempt — just before the SDK creates the payment — and the value you pass to continuePaymentCreation(idempotencyKey) is sent on POST /payments and every subsequent POST /payments/{id}/resume for that attempt. A retry after failure runs the gate again, producing a fresh key.

Express Checkout shipping

The two shipping handlers price Google Pay shipping from the address the shopper enters in the Google Pay sheet. Register both before the Google Pay sheet opens. They are suspend functions and run on the main thread. They share one 20 second budget per Google Pay callback, and the SDK cancels a handler when the budget runs out.
The three types are in the io.primer.checkout.api.shipping package. See Express Checkout shipping for the full flow, the client session patch your backend sends, and the failure modes.

Extension function

formatAmount

Formats an amount in minor units (cents) into a locale-aware currency string based on the current session (e.g., "$10.00", "10,00 EUR"). Once the checkout has reached Ready, it keeps working in every state, including Loading during refresh(), using the currency of the last Ready session.