Set the spend limit, auto top-up and invoice details
/billing/account/{team_id}
The team's own monthly cap on usage spend, its auto top-up, and the name, email and address on its invoices. The spend limit and auto top-up are only for teams whose usage is paid from a prepaid balance (usage_payment prepaid). The invoice details are written to the team's Stripe customer (created first for a self-serve team that has none) and the cached account is re-synced. Send at least one field; unknown fields are a 400. Values out of range are a 400, never clamped. null puts a value back to its default (or clears a name or address).
Path Parameters
Request Body
The billing address on invoices. Null clears it. Sent whole, not merged.
ISO 3166-1 alpha-2 code, for example US.
What each auto top-up charges, in whole dollars ($50 to $10,000), plus any negative balance. Must be at least auto_top_up_below_cents when both are set (the value sent, or the one saved). Null for the default, max($50, 7 days of usage) in $50 steps, raised to the trigger when the trigger is higher.
Charge a top-up when the balance falls below this, in whole dollars ($15 to $10,000). Null for the default, max($15, 3 days of usage).
Where invoices are sent (Stripe customer email). Cannot be cleared.
Company or person name on invoices (Stripe customer name). Trimmed. Null clears it.
At least 500 ($5). Null removes the cap.
Response Body
The team's own auto top-up amount, in cents, charged as set plus any negative balance. Null for the default, max($50, 7 days of usage) in $50 steps. A default amount is raised to the trigger when the trigger is higher, so one top-up always lifts the balance over it.
The team's own auto top-up trigger, in cents. A top-up is charged when the prepaid balance falls below it. Null for the default, max($15, 3 days of usage).
State of the prepaid balance. past_due means a top-up failed and is being retried; action_required means the card needs to be replaced or authenticated; restricted (14 days unpaid) refuses new connections only; review (30 days unpaid) is with Truto staff. Existing traffic and inbound webhooks keep running in every state. Always active for invoice teams.
activerechargingpast_dueaction_requiredrestrictedreview
Why the balance is in its state, for example a decline code or stripe_unavailable.
The name on invoices (Stripe customer name).
Informational; nothing is enforced on it today.
activepast_duesuspendedexempt
usdvisa4242cardThe team's own monthly cap on usage spend, in cents. Null for no cap. Alerts at 80% and 100%.
When true, outbound API calls get 429 spend_limit_reached once the month's spend reaches spend_limit_cents, until the month ends. Inbound webhooks are always accepted.
Stripe tax ID (txi_…); pass it to DELETE /billing/account/{team_id}/tax-id/{tax_id}. Absent on a row cached before ids were stored, until the next sync.
txi_1Abcus_einHow usage is paid. prepaid teams (self-serve signups) pay usage from a prepaid balance topped up in $50 steps; invoice teams get usage invoices.
invoiceprepaid
Errors
| Status | Description |
|---|---|
400 | Invalid or unknown field, a value out of range or not whole dollars, an auto top-up amount under its "below" value, an invalid email or address, a value Stripe refuses, no field sent, or a spend limit sent for a team that does not pay usage from a prepaid balance |
403 | Forbidden if the caller is not an admin of the team |
404 | Invoice details sent for a team with no Stripe customer |
curl -X PATCH 'https://api.truto.one/billing/account/{team_id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"spend_limit_cents": 0,
"spend_limit_hard_stop": true,
"auto_top_up_below_cents": 0,
"auto_top_up_amount_cents": 0,
"billing_name": "your_billing_name",
"billing_email": "your_billing_email",
"billing_address": {}
}'const body = {
"spend_limit_cents": 0,
"spend_limit_hard_stop": true,
"auto_top_up_below_cents": 0,
"auto_top_up_amount_cents": 0,
"billing_name": "your_billing_name",
"billing_email": "your_billing_email",
"billing_address": {}
};
const response = await fetch('https://api.truto.one/billing/account/{team_id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/billing/account/{team_id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"spend_limit_cents": 0,
"spend_limit_hard_stop": True,
"auto_top_up_below_cents": 0,
"auto_top_up_amount_cents": 0,
"billing_name": "your_billing_name",
"billing_email": "your_billing_email",
"billing_address": {}
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())