curl --request PUT \
--url https://api.recoupable.dev/api/accounts/{id}/auto-top-up \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"enabled": true,
"amountCents": 10000,
"thresholdCents": 100
}
'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
payload = {
"enabled": True,
"amountCents": 10000,
"thresholdCents": 100
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, amountCents: 10000, thresholdCents: 100})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'amountCents' => 10000,
'thresholdCents' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
payload := strings.NewReader("{\n \"enabled\": true,\n \"amountCents\": 10000,\n \"thresholdCents\": 100\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.recoupable.dev/api/accounts/{id}/auto-top-up")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"amountCents\": 10000,\n \"thresholdCents\": 100\n}")
.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::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"amountCents\": 10000,\n \"thresholdCents\": 100\n}"
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": "Add a payment method before turning on auto top-up"
}{
"error": "Unauthorized"
}{
"error": "Add a payment method before turning on auto top-up"
}{
"error": "Add a payment method before turning on auto top-up"
}Update Auto Top-up Settings
Set the auto top-up settings for an account. All three fields are required on every call; there is no partial update. Turning it on requires a card on file (GET /api/accounts/{id}/payment-method returns a card), an amount between 5.00 and 1,000.00 USD, and a threshold below the amount. Turning it off keeps the last amount and threshold so the account can turn it back on without retyping them. Guardrails that apply once it is on: at most one top-up per account per 10 minutes; a card decline turns enabled back to false, records lastError, and emails the account instead of retrying; removing the card turns it off. id may be the authenticated account or an organization the caller belongs to.
curl --request PUT \
--url https://api.recoupable.dev/api/accounts/{id}/auto-top-up \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"enabled": true,
"amountCents": 10000,
"thresholdCents": 100
}
'import requests
url = "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
payload = {
"enabled": True,
"amountCents": 10000,
"thresholdCents": 100
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, amountCents: 10000, thresholdCents: 100})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'amountCents' => 10000,
'thresholdCents' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/accounts/{id}/auto-top-up"
payload := strings.NewReader("{\n \"enabled\": true,\n \"amountCents\": 10000,\n \"thresholdCents\": 100\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.recoupable.dev/api/accounts/{id}/auto-top-up")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"amountCents\": 10000,\n \"thresholdCents\": 100\n}")
.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::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"amountCents\": 10000,\n \"thresholdCents\": 100\n}"
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": "Add a payment method before turning on auto top-up"
}{
"error": "Unauthorized"
}{
"error": "Add a payment method before turning on auto top-up"
}{
"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.
Body
Auto top-up settings
true
Amount to charge and grant per top-up, in cents (5.00 to 1,000.00 USD).
500 <= x <= 10000010000
Balance, in cents, below which a top-up runs. Must be below amountCents.
x >= 0100
Response
Settings saved.
"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?
