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 sessionId and a clientSecret needed to initialise the SDK
  • Calculates the carbon footprint and compensation amounts in the background to be used in the SDK renderer
  • Returns a calcReference to feed into the Funds endpoint after a contribution/ compensation

Key fields explained

  • productId → associates the session with your configured product and projects
  • amount → object with value and currencyCode used for calculation and display
  • checkoutSessionId → the session identifier returned by the API
  • clientSecret → short‑lived token passed to the SDK to authenticate the session
  • calcReference → A reference to uniquely identify the impact calculation

Best practices

  • Create sessions server‑side and pass only the clientSecret to the frontend
  • Render early in checkout so customers see impact context before confirming payment

What’s Next

How to integrate using the SDK