Skip to main content
POST
/
api
/
public
/
auth
/
checkout-token
curl -X POST "https://app.crovver.com/api/public/auth/checkout-token" \
  -H "x-public-key: pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "externalTenantId": "workspace_123",
    "returnUrl": "https://app.com/dashboard"
  }'
{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiJ9...",
    "expiresAt": "2025-01-01T00:10:00Z"
  },
  "meta": {
    "checkoutUrl": "https://portal.crovver.com/pricing?token=eyJhbGci...",
    "expiresIn": 600
  }
}
Creates a signed JWT that the portal uses to identify the tenant during checkout. The React SDK calls this automatically when you invoke redirectToCheckout().

Request Headers

x-public-key
string
required
Your public key (pk_live_...)

Request Body

externalTenantId
string
required
The tenant ID from your application
returnUrl
string
required
URL to return to after checkout completes
externalUserId
string
The user ID from your application. Used for D2C tenant auto-provisioning.
externalTenantName
string
Display name for the tenant. Used when auto-provisioning a new tenant.
requiredFeature
string
Pre-selects a plan that includes this feature on the pricing page.
requiredPlan
string
Pre-selects a specific plan ID on the pricing page.
metadata
object
Additional context passed into the JWT. Supports userEmail, userName, and custom fields.

Response

data.token
string
Signed JWT (valid for 10 minutes)
data.expiresAt
string
ISO 8601 expiry timestamp
meta.checkoutUrl
string
The full portal URL with token appended — redirect the user here
curl -X POST "https://app.crovver.com/api/public/auth/checkout-token" \
  -H "x-public-key: pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "externalTenantId": "workspace_123",
    "returnUrl": "https://app.com/dashboard"
  }'
{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiJ9...",
    "expiresAt": "2025-01-01T00:10:00Z"
  },
  "meta": {
    "checkoutUrl": "https://portal.crovver.com/pricing?token=eyJhbGci...",
    "expiresIn": 600
  }
}