Creates a checkout session with the configured payment provider (e.g., Stripe) and returns a URL to redirect the user to.
Request Body
The user ID from your application (required for D2C; used as externalTenantId)
The workspace/tenant ID (required for B2B orgs)
The Crovver plan ID to subscribe to
Payment provider name (e.g., stripe, khalti, esewa)
Number of seats to purchase (seat-based plans only)
Pre-fills the payment provider’s checkout form
URL to redirect to after successful payment
URL to redirect to if the user cancels checkout
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"
}
}