Skip to main content

Installation

Requirements: PHP 8.0+, Composer.

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)

recordUsage and checkUsageLimit are deprecated. They write to a simple event log with no idempotency and do not integrate with the credit pool system. Use consumeCredits instead.

Checkout

Seat Management

Use these methods on seat-based plans to track which users occupy seats. This is separate from recordUsage — 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.
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.