Skip to main content
POST
/
api
/
public
/
capacity
/
proration-checkout
curl -X POST "https://app.crovver.com/api/public/capacity/proration-checkout" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "externalTenantId": "workspace_123",
    "newCapacity": 15,
    "successUrl": "https://app.com/settings?upgraded=1",
    "cancelUrl": "https://app.com/settings/seats"
  }'
{
  "success": true,
  "data": {
    "prorationId": "uuid",
    "checkoutUrl": "https://checkout.stripe.com/pay/cs_...",
    "requiresPayment": true,
    "prorationAmount": 1750,
    "prorationDetails": {
      "description": "Prorated charge for 5 additional seats",
      "calculation": "5 seats × $1.00/seat × 17/30 days"
    },
    "message": "Checkout session created. Capacity will be upgraded after payment confirmation."
  }
}
When a tenant needs more seats mid-billing cycle, this endpoint calculates the prorated charge for the remaining days and creates a Stripe checkout session for that amount. The actual capacity upgrade happens after payment confirmation via the Stripe webhook (event_type: seat_proration). For non-Stripe providers (Khalti, eSewa), an invoice is generated instead.

Request Body

externalTenantId
string
required
The external tenant/workspace ID from your application
newCapacity
integer
required
The new total seat count (must be greater than current capacityUnits)
planId
string
The plan ID to upgrade. Defaults to the tenant’s current active plan.
successUrl
string
URL to redirect to after payment. Defaults to the org’s configured success URL.
cancelUrl
string
URL to redirect to if the user cancels. Defaults to the org’s configured cancel URL.

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/capacity/proration-checkout" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "externalTenantId": "workspace_123",
    "newCapacity": 15,
    "successUrl": "https://app.com/settings?upgraded=1",
    "cancelUrl": "https://app.com/settings/seats"
  }'
{
  "success": true,
  "data": {
    "prorationId": "uuid",
    "checkoutUrl": "https://checkout.stripe.com/pay/cs_...",
    "requiresPayment": true,
    "prorationAmount": 1750,
    "prorationDetails": {
      "description": "Prorated charge for 5 additional seats",
      "calculation": "5 seats × $1.00/seat × 17/30 days"
    },
    "message": "Checkout session created. Capacity will be upgraded after payment confirmation."
  }
}