Installation
Upgrading to 2.0
2.0 removesrecordUsage() and checkUsageLimit(), which were deprecated in 1.x and whose usage was never counted. Use consumeCredits() and getCreditsBalance(). It also adds Plan::$seatTiers and Plan::periodCharge() for tiered seat plans, and ProrationCheckoutResponse::$prorationId can be null.
Initialize the Client
Configuration Options
Tenant Management
externalTenantId is your own ID for the customer. The dashboard lists the tenant under Customers. Pass ownerEmail: it becomes the customer’s billing email, which the customer needs to sign in to their billing page. An email set in the dashboard is never overwritten.
Plans
periodCharge() rather than reading perSeatPrice, which is 0 on a tiered plan. The bands are in $plan->seatTiers.
Subscriptions
Feature Entitlements
Credits
Credits meter usage against a plan’s allowances. Each pool is keyed by a meter key, such asai_tokens.
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
Checkout
Seat Management
Use these methods on seat-based plans to track which users occupy seats. Seat allocation is for per-user billing, not credit 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.