Select an optional item
Adds an optional (upsell) item to the session. The session must be open. After
selection, the item’s id appears in selected_optional_item_ids and amount_total
increases by the item’s amount. Secrets are stripped from the response.
Authorizations
A merchant secret key (sk_…) sent as Authorization: Bearer <key>.
Headers
A unique key that makes retries safe: the same key with the same request body returns the original response instead of repeating the operation.
255Path Parameters
The checkout session id (cs_…).
The line item id.
Response
The updated checkout session.
A checkout session.
Checkout session id (cs_…).
checkout_session Merchant id that owns this session (mer_…).
True for live-mode sessions; false for test-mode.
Checkout mode.
payment, subscription, setup Presentation mode.
hosted, embedded Checkout button label mode.
auto, pay, book, donate open — active, buyer can continue. complete — the hosted payment or subscription activation finished; inspect payment_status and process webhooks. expired — timed out, buyer must start a new session.
open, complete, expired Payment outcome.
paid, unpaid, no_payment_required URL to redirect the buyer after successful payment.
URL to redirect the buyer if they cancel.
Checkout page locale.
Linked customer id (cus_…).
Pre-filled email address.
Merchant-supplied reference id.
Required line items.
Field-collection requirements for this session.
Sum of required line item amounts in minor units.
Subtotal plus the amounts of selected optional items in minor units.
Uppercase three-letter ISO currency code, derived from the first line item.
The payment intent created to collect this session (pi_…). Null until the session is confirmed.
Unix epoch seconds when this session expires.
Custom key-value pairs attached to this session.
Unix epoch seconds.
Merchant display details. Present when the session was retrieved from the hosted checkout page context.
SDK initialization token for embedded mode. Present only on the create response when ui_mode is embedded; absent on all other responses.
Optional upsell items offered on the checkout form. Absent when none were configured.
Ids of optional items the buyer selected. Absent when none are selected.
Payment intent client secret. Present only on the confirm response so the frontend can initialize the card form.
Set when the merchant enabled saving the payment method. The hosted form shows a save-card checkbox to the buyer.
on_session, off_session Error returned to the buyer surface after a declined charge attempt. Absent when no decline occurred.
Back-reference to the payment link that spawned this session (pl_…). Absent for API-created sessions.
Card-fields configuration used by Ionic Checkout. Present when the session includes browser tokenization access.
Card-fields configuration used by Ionic Checkout. No integration action is required.
Hosted checkout URL (ui_mode: hosted only). Redirect the buyer here to begin payment.
Embedded checkout iframe URL (ui_mode: embedded only).

