Skip to main content
POST
/
api
/
public
/
tenants
/
{tenantId}
/
addons
/
purchase
curl -X POST "https://app.crovver.com/api/public/tenants/workspace_123/addons/purchase" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "addonId": "uuid",
    "currency": "USD",
    "idempotencyKey": "addon-purchase-1778423112701",
    "successUrl": "https://app.com/settings?addon=purchased",
    "cancelUrl": "https://app.com/settings"
  }'
{
  "success": true,
  "data": {
    "purchaseId": "uuid",
    "checkoutUrl": "https://checkout.stripe.com/pay/cs_...",
    "requiresPayment": true,
    "addonName": "API Call Pack",
    "creditQty": 500,
    "amount": 5,
    "currency": "USD"
  }
}
Creates a Stripe checkout session for the tenant to purchase an add-on. Credits are granted automatically after payment confirmation via webhook (event_type: addon_purchase). The call is idempotent — passing the same idempotencyKey twice returns the original result without creating a duplicate checkout.

Path Parameters

tenantId
string
required
The external tenant ID from your application

Request Body

addonId
string
required
The add-on ID to purchase (from the available add-ons list)
currency
string
required
3-letter ISO currency code. Must match the tenant’s subscription currency.
idempotencyKey
string
required
Unique key for this purchase event. Duplicate calls with the same key return the original result.
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.
metadata
object
Optional context stored on the purchase record.

Authentication

Requires a secret key (Authorization: Bearer sk_live_...) or service key (x-service-key).
curl -X POST "https://app.crovver.com/api/public/tenants/workspace_123/addons/purchase" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "addonId": "uuid",
    "currency": "USD",
    "idempotencyKey": "addon-purchase-1778423112701",
    "successUrl": "https://app.com/settings?addon=purchased",
    "cancelUrl": "https://app.com/settings"
  }'
{
  "success": true,
  "data": {
    "purchaseId": "uuid",
    "checkoutUrl": "https://checkout.stripe.com/pay/cs_...",
    "requiresPayment": true,
    "addonName": "API Call Pack",
    "creditQty": 500,
    "amount": 5,
    "currency": "USD"
  }
}