Checkout sessions
POST: /checkout/sessions
The Checkout Sessions endpoint creates a pre‑purchase session for the Checkout SDK. Use it to surface real‑time footprint insights and simple contribution options directly in your checkout flow.
See the API reference for example payloads.
What it does
- Creates the
sessionIdand aclientSecretneeded to initialise the SDK - Calculates the carbon footprint and compensation amounts in the background to be used in the SDK renderer
- Returns a
calcReferenceto feed into the Funds endpoint after a contribution/ compensation
Key fields explained
productId→ associates the session with your configured product and projectsamount→ object withvalueandcurrencyCodeused for calculation and displaycheckoutSessionId→ the session identifier returned by the APIclientSecret→ short‑lived token passed to the SDK to authenticate the sessioncalcReference→ A reference to uniquely identify the impact calculation
Best practices
- Create sessions server‑side and pass only the
clientSecretto the frontend - Render early in checkout so customers see impact context before confirming payment
Updated 7 months ago
