Skip to main content
POST
/
api
/
public
/
checkout
curl -X POST "https://app.crovver.com/api/public/checkout" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_123",
    "planId": "7b79a62c-e82e-405f-9719-7314f3d6e7f2",
    "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 (Stripe, Khalti, eSewa) and returns a URL to redirect the user to.

Request Body

planId
string
required
The Crovver plan ID to subscribe to
externalUserId
string
The user ID from your application. Required for D2C orgs — becomes the tenant identity.
externalTenantId
string
The workspace/tenant ID. Required for B2B orgs.
provider
string
Payment provider name (stripe, khalti, esewa). Defaults to the org’s configured provider.
currency
string
3-letter ISO currency code (e.g. USD, NPR). Defaults to the plan’s first active price currency.
totalCapcityUnits
integer
Number of seats to purchase. Required for seat-based plans.
userEmail
string
Pre-fills the payment provider’s checkout form with this email.
userName
string
Pre-fills the payment provider’s checkout form with this name.
successUrl
string
URL to redirect to after successful payment. Defaults to the org’s configured success URL.
cancelUrl
string
URL to redirect to if the user cancels checkout. Defaults to the org’s configured cancel URL.
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://app.crovver.com/api/public/checkout" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_123",
    "planId": "7b79a62c-e82e-405f-9719-7314f3d6e7f2",
    "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"
  }
}