lineItemsstringrequired
JSON array: [{"price": "price_xxx", "quantity": 1}]
modestringrequired
One ofpaymentsubscriptionsetup
uiModestring
"hosted" redirects to a page on Stripe's own domain (uses successUrl/cancelUrl). "embedded" mounts Stripe's whole checkout UI inline instead (uses returnUrl). Defaults to "hosted".
One ofhostedembedded
successUrlstring (uri)
Required when UI Mode is "hosted" (or left unset).
cancelUrlstring (uri)
Required when UI Mode is "hosted" (or left unset).
redirectOnCompletionstring
Only for UI Mode "embedded". "never" (the default here) keeps the customer inside the embedded checkout for card and Link payments and disables any payment method that needs a full-page redirect — right for a checkout mounted inside a chat widget, where there is no page of ours to redirect back to. Use "always" or "if_required" only if a Return URL below is genuinely reachable.
One ofalwaysif_requirednever
returnUrlstring (uri)
Only needed when Redirect On Completion is "always" or "if_required".
customerEmailstring (email)
allowPromotionCodesboolean