Skip to main content
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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
feature_id
string
required

The feature ID to create the balance for

customer_id
string
required

The customer ID to assign the balance to

entity_id
string

Entity ID for entity-scoped balances

granted_balance
number

The initial balance amount to grant

unlimited
boolean

Whether the balance is unlimited

reset
object

Reset configuration for the balance

expires_at
number

Unix timestamp (milliseconds) when the balance expires

Response

200 - application/json

Balance created successfully

success
boolean
required