Top up credits automatically from the saved card
const url = 'https://api.global.stillbox.example/v1/billing/auto-topup';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"below_usd":1,"amount_usd":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.global.stillbox.example/v1/billing/auto-topup \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true, "below_usd": 1, "amount_usd": 1 }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Top up when the balance falls below this (0 to 1,000).
Credits added each time (10 to 1,000), before tax.
Example generated
{ "enabled": true, "below_usd": 1, "amount_usd": 1}Responses
Section titled “Responses”Billing
object
Whether this region takes card payments; otherwise credits are added by invoice.
Sandboxes can’t run until a card is verified (the free tier’s card check) or credits are added.
Whether owners can save a card without a payment (POST /billing/card-check); automatic top-ups charge
the saved card.
The saved card, which automatic top-ups charge.
object
object
Top up when the balance falls below this (0 to 1,000).
Credits added each time (10 to 1,000), before tax.
object
Example
{ "payments": [ { "kind": "checkout", "state": "open" } ]}The request is invalid
object
Example
{ "code": "not_found"}The API key is missing or invalid
object
Example
{ "code": "not_found"}Only an owner can do this (owner_only), or the invitation is for another address (not_invited)
object
Example
{ "code": "not_found"}No such sandbox in your organization (or no such file)
object
Example
{ "code": "not_found"}No saved card yet
object
Example
{ "code": "not_found"}