Installation
Initialize the Client
Configuration Options
Tenant Management
Plans
Subscriptions
Feature Entitlements
Credits
Credits are the preferred way to track and gate consumption in Crovver. Each credit pool has a key (e.g."ai_generations") and is refilled by plan entitlements or add-on purchases.
Check balance
Consume credits
consumeCredits is idempotent — passing the same $idempotencyKey twice returns the original result without double-deducting.
consumeCredits parameters:
ConsumeResponse fields:
Add-ons
Add-ons let tenants purchase extra credit packs without changing their base plan.List available add-ons
Purchase an add-on
AddonPurchaseResponse fields:
Get active add-on credits
Usage Tracking (deprecated)
Checkout
Seat Management
Use these methods on seat-based plans to track which users occupy seats. This is separate fromrecordUsage — seat allocation is for per-user billing, not credit/quota consumption.
Get Seat Count
Allocate a Seat
Call this when a user joins a workspace to record their seat allocation.AllocateSeatRequest Parameters
AllocateSeatResponse Fields
GetSeatCountResponse Fields
Bulk Allocate Seats
Allocate up to 100 users in one atomic call. Users beyondcapacity_units are returned in rejected — no proration is triggered. Already-active users are silently skipped (idempotent).
BulkAllocateSeatsRequest Parameters
BulkAllocateSeatUser Parameters
BulkAllocateSeatsResponse Fields
List Allocations
Returns a paginated list of users allocated to the tenant’s active subscription, along with a real-time capacity summary.getAllocations Parameters
AllocationUser Fields
Proration Checkout
Call this whenever a tenant needs more seats — proactively from a settings page, or after presenting the preview returned byallocateSeat(). Crovver calculates the prorated charge for the remaining days in the billing period and creates a checkout session using the same payment provider as the tenant’s original subscription.
createProrationCheckout Parameters
ProrationCheckoutResponse Fields
Proration checkout is never retried automatically to prevent duplicate Stripe sessions.
Error Handling
5xx errors, 429, and 408 responses are retried automatically with exponential backoff. Checkout endpoints are never retried to prevent duplicate charges.