Sessions β Overview
Understanding what a Session is and does before you integrate. For the actual request/response steps, see Create a Session.
A Session is the entry point for the CCG UI (the checkout widget). It's a short-lived resource you create via POST v2/sessions that tells CCG what capability to present to the customer β a one-time payment, adding a payment method, managing a wallet β and what options are available while doing it (which payment methods, which channels, which language, whether the method can be saved).
Rather than configuring the widget directly, you configure it indirectly: the Session is a server-side declaration of intent, and the widget reads that declaration (via checkoutSessionId or hostedUrl) to render the right experience.
Wallet vs. Guest Experienceβ
Whether a Session presents a wallet experience (saved payment methods, enterprise identity) or a guest experience (one-off, no history) is determined by the customer object you send, not by an explicit flag:
- If
customer.hsid,customer.enterpriseId, or another valid merchant-specific identifier is present and matches an existing wallet, the wallet experience is shown. - Otherwise, the guest experience is shown.
See Widget Experience for how this plays out in the UI itself.
Embedded vs. Hostedβ
A Session response gives you two different integration paths, and you choose one based on how you want the checkout UI to appear:
checkoutSessionIdβ pass this to the Embedded Experience (OptumCCGWidgetInitializer), which renders the widget inline on your page.hostedUrlβ a full URL for the Hosted Experience, opened as a popup.
Both are the same underlying Session β the field you use just determines how the resulting UI is surfaced.
What a Session Controlsβ
- Mode (
config.modes) β the capability being exercised (payment, wallet management, method entry, etc.). See Session Modes. - Channels (
config.paymentMethodChannel/config.vendors) β which payment methods and entry channels (web form, Apple Pay, Google Pay, etc.) are available. See Configure Vendors. - Language and save behavior (
config.options) β display language and whether a payment method can be saved during checkout. - Processor routing β which payment processor (Stripe, Optum Bank) handles the transaction, resolved at session creation time. See Deterministic Processor Routing.
Lifecycle, In Briefβ
A Session moves through a small set of statuses from creation to a terminal outcome (COMPLETED, FAILED, EXPIRED, or CANCELED). See Session Lifecycle for the full status table, and Create a Session for how to track it.