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
}Update Balance
Update a customer balance.
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
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).
Set the remaining balance to this exact value. Cannot be combined with add_to_balance.
Add this amount to the current balance. Use negative values to subtract. Cannot be combined with current_balance.
The usage amount to update. Cannot be combined with remaining or add_to_balance.
Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.
one_off, minute, hour, day, week, month, quarter, semi_annual, year Set the granted balance to this exact value.
Target a specific balance by its ID (set on create). Use when the customer has multiple balances for the same feature.
The next reset time for the balance. If there are multiple breakdowns, this will update the breakdown with the next reset time.
Response
OK