Skip to content

Change automatic top-up settings

POST
/billing/autotopup
curl --request POST \
--url https://api.sloose.com/billing/autotopup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "threshold": 1, "monthlyCapCents": 1, "packKey": "example" }'

Saving always clears a pause: if top-up stopped because a charge failed or the cap was hit, changing the settings is how you say you have dealt with it.

Media typeapplication/json
object
enabled
boolean | null
threshold

Top up when available credits fall below this. Non-negative.

number | null
monthlyCapCents

Never spend more than this per calendar month.

number | null
packKey

Which credit pack to buy. Must be a pack we sell.

string | null
key
additional properties
Examplegenerated
{
"enabled": true,
"threshold": 1,
"monthlyCapCents": 1,
"packKey": "example"
}

Settings as they now stand.

Media typeapplication/json
object
enabled
required
boolean
threshold
required

Top up when the available balance falls below this.

number | null
monthlyCapCents
required

Never spend more than this in a calendar month.

number | null
packKey
required
string | null
spentCentsThisMonth
required
number
spentMonth
required
string | null
pausedReason
required

Why automatic top-up stopped — a failed charge, or the monthly cap. Saving settings clears it.

string | null
Examplegenerated
{
"enabled": true,
"threshold": 1,
"monthlyCapCents": 1,
"packKey": "example",
"spentCentsThisMonth": 1,
"spentMonth": "example",
"pausedReason": "example"
}

packKey is not a pack we sell.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The bearer’s role is too low, or it was issued for a different org.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}