import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.balances.create({
customerId: "cus_123",
featureId: "api_calls",
reset: {
interval: "month",
},
});{
"success": true
}Create Balance
Create a balance for a customer feature.
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.balances.create({
customerId: "cus_123",
featureId: "api_calls",
reset: {
interval: "month",
},
});{
"success": true
}Body Parameters
Response
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
The ID of the customer.
The ID of the feature.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
The initial balance amount to grant. For metered features, this is the number of units the customer can use.
If true, the balance has unlimited usage. Cannot be combined with 'included_grant'.
Reset configuration for the balance. If not provided, the balance is a one-time grant that never resets.
Show child attributes
Show child attributes
Rollover configuration for the balance.
Show child attributes
Show child attributes
Unix timestamp (milliseconds) when the balance expires. Mutually exclusive with reset.
A unique identifier for this balance. Use this to target the balance in future update / delete calls.
Response
OK