Skip to main content
POST
/
v1
/
balances.create
Typescript (SDK)
import { Autumn } from 'autumn-js'

const autumn = new Autumn()

const result = await autumn.balances.create({
  customerId: "cus_123",
  featureId: "api_calls",
  included: 1000,
  reset: {
    interval: "month",
  },
});
{
  "success": true
}

Body Parameters

Response

Authorizations

Authorization
string
header
required

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

Headers

x-api-version
string
default:2.1
required

Body

application/json
customer_id
string
required

The ID of the customer.

feature_id
string
required

The ID of the feature.

entity_id
string

The ID of the entity for entity-scoped balances (e.g., per-seat limits).

included
number

The initial balance amount to grant. For metered features, this is the number of units the customer can use.

unlimited
boolean

If true, the balance has unlimited usage. Cannot be combined with 'included'.

reset
object

Reset configuration for the balance. If not provided, the balance is a one-time grant that never resets.

expires_at
number

Unix timestamp (milliseconds) when the balance expires. Mutually exclusive with reset.

Response

200 - application/json

OK

success
boolean
required