TypeScript
import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.balances.create({
customer_id: 'cus_123',
feature_id: 'api_tokens',
granted_balance: 100,
reset: { interval: 'month' }
});{
"success": true
}Features
Create Balance
Create a new balance for a specific feature for a customer.
POST
/
balances
/
create
TypeScript
import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.balances.create({
customer_id: 'cus_123',
feature_id: 'api_tokens',
granted_balance: 100,
reset: { interval: 'month' }
});{
"success": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The feature ID to create the balance for
The customer ID to assign the balance to
Entity ID for entity-scoped balances
The initial balance amount to grant
Whether the balance is unlimited
Reset configuration for the balance
Show child attributes
Show child attributes
Unix timestamp (milliseconds) when the balance expires
Response
200 - application/json
Balance created successfully
⌘I

