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

const autumn = new Autumn()

const result = await autumn.balances.update({
  customerId: "cus_123",
  featureId: "api_calls",
  remaining: 5,
});
{
  "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).

remaining
number

Set the remaining balance to this exact value. Cannot be combined with add_to_balance.

add_to_balance
number

Add this amount to the current balance. Use negative values to subtract. Cannot be combined with current_balance.

interval
enum<string>

Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.

Available options:
one_off,
minute,
hour,
day,
week,
month,
quarter,
semi_annual,
year

Response

200 - application/json

OK

success
boolean
required