API REFERENCE
Get Auto Top-up Settings
On this page
/api/accounts/{id}/auto-top-upRead the auto top-up settings for an account. Auto top-up is opt-in: it is off for every account until the account turns it on and chooses both the amount to buy and the balance that triggers it. When it is on, the api charges the default card on file for amountCents the first time a credit deduction leaves the balance below thresholdCents, then grants the credits and emails a receipt. id may be the authenticated account or an organization the caller belongs to.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/accounts/YOUR_ID/auto-top-up' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Path parameters
idstringrequiredThe unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.
Responses
200Auto top-up settings (defaults when never configured).+
application/json
account_idstringrequiredformat: uuid
enabledbooleanrequiredWhether auto top-up is on. Off by default.
amountCentsintegerrequirednullableAmount charged and granted per top-up, in cents. Null until set.
thresholdCentsintegerrequirednullableBalance, in cents, below which a top-up runs. Null until set.
lastRunAtstringrequirednullableWhen the last auto top-up was attempted. Null until the first run.
format: date-time
lastErrorstringrequirednullableStripe decline message from the attempt that turned auto top-up off. Null while healthy or once re-enabled.
401Unauthorized - invalid or missing authentication+
application/json
errorstringrequiredHuman-readable error message.
{
"error": "Unauthorized"
}403Forbidden - the account is not the caller's and not an organization they belong to (an unknown id also returns 403, never 404)+
application/json
errorstringrequiredHuman-readable error message.
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download accounts.jsonView operation source
{
"description": "Read the auto top-up settings for an account. Auto top-up is opt-in: it is off for every account until the account turns it on and chooses both the amount to buy and the balance that triggers it. When it is on, the api charges the default card on file for `amountCents` the first time a credit deduction leaves the balance below `thresholdCents`, then grants the credits and emails a receipt. `id` may be the authenticated account or an organization the caller belongs to.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Auto top-up settings (defaults when never configured).",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AutoTopUpResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing authentication",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AutoTopUpErrorResponse"
},
"example": {
"error": "Unauthorized"
}
}
}
},
"403": {
"description": "Forbidden - the account is not the caller's and not an organization they belong to (an unknown id also returns 403, never 404)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AutoTopUpErrorResponse"
}
}
}
}
}
}