Skip to main content
POST
/
api
/
public
/
checkout
curl -X POST "https://api.crovver.com/api/public/checkout" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "requestingUserId": "user_123",
    "planId": "plan_pro",
    "provider": "stripe",
    "successUrl": "https://app.com/welcome",
    "cancelUrl": "https://app.com/pricing"
  }'
{
  "success": true,
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/pay/cs_test_...",
    "sessionId": "cs_test_...",
    "subscriptionId": "sub_crovver_abc"
  }
}
Creates a checkout session with the configured payment provider (e.g., Stripe) and returns a URL to redirect the user to.

Request Body

requestingUserId
string
required
The user ID from your application (required for D2C; used as externalTenantId)
requestingTenantId
string
The workspace/tenant ID (required for B2B orgs)
planId
string
required
The Crovver plan ID to subscribe to
provider
string
required
Payment provider name (e.g., stripe, khalti, esewa)
totalCapacityUnits
number
Number of seats to purchase (seat-based plans only)
userEmail
string
Pre-fills the payment provider’s checkout form
successUrl
string
required
URL to redirect to after successful payment
cancelUrl
string
required
URL to redirect to if the user cancels checkout
metadata
object
Arbitrary key-value pairs passed through to the payment provider

Authentication

Requires a secret key (Authorization: Bearer sk_live_...) or service key (x-service-key + ?orgId=).
curl -X POST "https://api.crovver.com/api/public/checkout" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "requestingUserId": "user_123",
    "planId": "plan_pro",
    "provider": "stripe",
    "successUrl": "https://app.com/welcome",
    "cancelUrl": "https://app.com/pricing"
  }'
{
  "success": true,
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/pay/cs_test_...",
    "sessionId": "cs_test_...",
    "subscriptionId": "sub_crovver_abc"
  }
}