curl --request GET \
--url https://api.recoupable.dev/api/accounts/{id}/auto-top-up \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/accounts/{id}/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.recoupable.dev/api/accounts/{id}/auto-top-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.recoupable.dev/api/accounts/{id}/auto-top-up")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/accounts/{id}/auto-top-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"enabled": true,
"amountCents": 10000,
"thresholdCents": 100,
"lastRunAt": "2026-09-04T15:05:00Z",
"lastError": "Your card was declined."
}{
"error": "Unauthorized"
}{
"error": "Add a payment method before turning on auto top-up"
}Get Auto Top-up Settings
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.
curl --request GET \
--url https://api.recoupable.dev/api/accounts/{id}/auto-top-up \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/accounts/{id}/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.recoupable.dev/api/accounts/{id}/auto-top-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.recoupable.dev/api/accounts/{id}/auto-top-up")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/accounts/{id}/auto-top-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"enabled": true,
"amountCents": 10000,
"thresholdCents": 100,
"lastRunAt": "2026-09-04T15:05:00Z",
"lastError": "Your card was declined."
}{
"error": "Unauthorized"
}{
"error": "Add a payment method before turning on auto top-up"
}Authorizations
Your Recoup API key. Learn more.
Path Parameters
The unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.
Response
Auto top-up settings (defaults when never configured).
"550e8400-e29b-41d4-a716-446655440000"
Whether auto top-up is on. Off by default.
true
Amount charged and granted per top-up, in cents. Null until set.
10000
Balance, in cents, below which a top-up runs. Null until set.
100
When the last auto top-up was attempted. Null until the first run.
"2026-09-04T15:05:00Z"
Stripe decline message from the attempt that turned auto top-up off. Null while healthy or once re-enabled.
"Your card was declined."
Was this page helpful?
