Get automatic top-up settings
const url = 'https://api.sloose.com/billing/autotopup';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.sloose.com/billing/autotopup \ --header 'Authorization: Bearer <token>'Threshold, monthly cap, chosen pack, what has been spent this month, and why it is paused if it is.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Current settings.
object
Top up when the available balance falls below this.
Never spend more than this in a calendar month.
Why automatic top-up stopped — a failed charge, or the monthly cap. Saving settings clears it.
Examplegenerated
{ "enabled": true, "threshold": 1, "monthlyCapCents": 1, "packKey": "example", "spentCentsThisMonth": 1, "spentMonth": "example", "pausedReason": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The bearer’s role is too low, or it was issued for a different org.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}This org is a sandbox. Billing is managed on its production org.
object
Example
{ "code": "SANDBOX_ORG"}