Change seat count
Once a contract is created, you can edit the amount of seats on the subscription using the edit contract end point. The mechanism for changing seat count depends on whether you are using thequantity field to adjust count or the seat_config.
Quantity change for standard subscriptions and credit pools
Schedule a change of the quantity of a subscription using theupdate_subscription action on the edit contract endpoint. Either pass the new total count through quantity or the difference between the previous count through quantity_delta. Updates scheduled with the same starting_at are applied in the order they are submitted in. Quantity changes are invoiced based on the proration settings in the subscription configuration on the contract.
For subscriptions linked to recurring credits, the change in quantity will also release new credit balance. The balance amount depends the proration settings and access_amount on the recurring credit configuration.
This call shows an example of using /contracts/edit to change a subscription seat count:
Quantity change for seat-based credit subscriptions
BETAIndividual seat credits are currently in Beta. Breaking changes may occur.
quantity, specify the seat_ids which are being added or removed from the subscription. Optionally add or remove unassigned seats. Invoices are billed and credits are released based on the settings of the subscription and recurring credits configs.
See an example of changing the seat count for seat-based credit subscriptions:
Monitor credit balance
You can set threshold notifications on credit balance to receive webhooks when the customer’s balance reaches a certain level. Upon receiving these webhooks, you can gate the customer’s access until they purchase a top-up credit pack or the next billing period begins. This alert will only evaluate credits at the customer or contract level - seat scoped credits are not included in the calculation. This API call shows how to create a threshold notification when the customer has 10 AI credits remaining using the /alerts/create end point.COMING SOONSet up a credit balance alert scoped to a
group_key. This can be used to alert when a seat falls below a certain balance in order to restrict access at the seat level.Visualize seat history
As part of your product experience, you may want to present the change in seat quantity over time to provide transparency to your customer:- Quantity history: To poll the changes to subscription quantity, use the /getSubscriptionQuantityHistory end point.
- Seat id history: If managing seats using the
seat_config, you can poll the history of eachseat_idusing the /get-subscription-seats-history end point.
Visualize seat balance
If building a seat-scoped subscription billing model, you likely will want to display the active balance per seat and seat’s balance over time. To query this information, use the/contracts/seatBalance/list end point:
- Current seat balance: Passing the
customer_idandcontract_idwill return the currentbalancefor all seats. Passing aseat_idto the request body will scope the results to an individual seat. - Seat ledger history: To create a view which shows the history of credit grants and associated burn-down, pass
include_ledgers: trueto the request body. Optionally pass in thestarting_atandending_beforedates to filter the response to a specified time period.