44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
---
|
|
title: "Update Balance"
|
|
openapi: "openapi POST /v1/balances.update"
|
|
---
|
|
|
|
import { DynamicParamField } from "/components/dynamic-param-field.jsx";
|
|
import { DynamicResponseField } from "/components/dynamic-response-field.jsx";
|
|
import { DynamicResponseExample } from "/components/dynamic-response-example.jsx";
|
|
|
|
### Body Parameters
|
|
|
|
<DynamicParamField body="customer_id" type="string" required>
|
|
The ID of the customer.
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="feature_id" type="string" required>
|
|
The ID of the feature.
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="entity_id" type="string">
|
|
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="remaining" type="number">
|
|
Set the remaining balance to this exact value. Cannot be combined with add_to_balance.
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="add_to_balance" type="number">
|
|
Add this amount to the current balance. Use negative values to subtract. Cannot be combined with current_balance.
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="usage" type="number">
|
|
The usage amount to update. Cannot be combined with remaining or add_to_balance.
|
|
</DynamicParamField>
|
|
|
|
<DynamicParamField body="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
|
|
Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.
|
|
</DynamicParamField>
|
|
|
|
|
|
### Response
|
|
|
|
<DynamicResponseField name="success" type="boolean" />
|