Skip to main content

Installation

Requirements: PHP 8.0+, Composer.

Upgrading to 2.0

2.0 removes recordUsage() 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

The ID you pass as 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

Use 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 as ai_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.
If the workspace is at capacity and the plan is seat-based, Crovver returns a proration preview instead of allocating the seat:

AllocateSeatRequest Parameters

AllocateSeatResponse Fields

GetSeatCountResponse Fields

Bulk Allocate Seats

Allocate up to 100 users in one atomic call. Users beyond capacity_units are returned in rejected — no proration is triggered. Already-active users are silently skipped (idempotent).
bulkAllocateSeats is never retried automatically to prevent duplicate allocations on network errors.
Returns HTTP 207 when at least one user was rejected; 200 otherwise.

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 by allocateSeat(). 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.