Flow Overview
Step 1 — Trigger from Your App
UseuseBillingRedirect in your React frontend:
Step 2 — Checkout Token
The SDK calls the Crovver API to mint a short-lived JWT (10 minutes):Step 3 — Plan Selection
The ecom app renders your available plans. The token carries the tenant context so the correct org’s plans are shown.Step 4 — Create Checkout Session
The ecom app calls Crovver to create a Stripe session:Step 5 — Stripe Webhook
After payment, Stripe calls your webhook. Crovver processescheckout.session.completed and activates the subscription. The subscription status moves from pending → active (or trialing if the plan has a trial).
Step 6 — Back in Your App
The user returns tosuccessUrl. Calling refresh() from useSubscription will re-fetch the now-active subscription:
Seat-Based Checkout
For seat-based plans, includetotalCapacityUnits: