Skip to main content
This guide explains what happens from the moment a user clicks “Upgrade” to when their subscription is active in your app.

Flow Overview

Step 1 — Trigger from Your App

Use useBillingRedirect 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 processes checkout.session.completed and activates the subscription. The subscription status moves from pendingactive (or trial if the plan has a trial).

Step 6 — Back in Your App

The user returns to successUrl. Calling refresh() from useSubscription will re-fetch the now-active subscription:

Seat-Based Checkout

For seat-based plans, include totalCapacityUnits:
Crovver calculates the prorated price and creates the session accordingly.