Checkout
Create a checkout session
Create a hosted checkout session that wraps the Juice Reel purchase flow. Redirect the user's browser to checkoutUrl; after checkout succeeds, Juice Reel shows the OAuth consent screen and then redirects to successUrl with a short-lived authorization code and the supplied state. A cancelled checkout redirects to cancelUrl with its status and state. Exchange the authorization code at /oauth2/token; access tokens and client secrets must never be placed in URLs.
POST
/checkout/sessionsSECURITY WARNING: Call this endpoint only from your backend. Never call it from browser or mobile frontend code. Your client secret must never be included in frontend application bundles, shipped to users, or exposed to clients.
Request body
| Field | Type | Description |
|---|---|---|
successUrlrequired | string | Exact redirect URI registered on the OAuth application for a successful checkout. |
cancelUrlrequired | string | Exact redirect URI registered on the OAuth application for a cancelled checkout. |
scopesrequired | string[] | Requested OAuth scopes. May be an empty array for identity-only access; otherwise scopes must be unique and a subset of the scopes approved for the OAuth application. |
staterequired | string | Opaque value generated by your backend and returned unchanged to your successUrl or cancelUrl. |
codeChallengerequired | string | PKCE S256 code challenge generated by your backend for the authorization-code exchange. |
Response
201 · application/json| Field | Type | Description |
|---|---|---|
checkoutSessionId | string | Unique identifier for the checkout session. |
checkoutUrl | string | URL to open in the user's browser to begin checkout. |
expiresAt | string (ISO 8601) | Time at which the checkout session expires. |