Set or update auto-recharge config for a customer
curl --request PUT \
--url https://api.example.com/v1/sdk/auto-recharge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"customerRef": "<string>",
"enabled": true,
"triggerType": "balance",
"customerEmail": "jsmith@example.com",
"customerName": "<string>",
"deferSetupIntent": true,
"maxMonthlySpendMajor": 5000,
"thresholdAmountMajor": 5000,
"topupAmountMajor": 5000
}
'import requests
url = "https://api.example.com/v1/sdk/auto-recharge"
payload = {
"currency": "<string>",
"customerRef": "<string>",
"enabled": True,
"triggerType": "balance",
"customerEmail": "jsmith@example.com",
"customerName": "<string>",
"deferSetupIntent": True,
"maxMonthlySpendMajor": 5000,
"thresholdAmountMajor": 5000,
"topupAmountMajor": 5000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: '<string>',
customerRef: '<string>',
enabled: true,
triggerType: 'balance',
customerEmail: 'jsmith@example.com',
customerName: '<string>',
deferSetupIntent: true,
maxMonthlySpendMajor: 5000,
thresholdAmountMajor: 5000,
topupAmountMajor: 5000
})
};
fetch('https://api.example.com/v1/sdk/auto-recharge', 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.example.com/v1/sdk/auto-recharge",
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([
'currency' => '<string>',
'customerRef' => '<string>',
'enabled' => true,
'triggerType' => 'balance',
'customerEmail' => 'jsmith@example.com',
'customerName' => '<string>',
'deferSetupIntent' => true,
'maxMonthlySpendMajor' => 5000,
'thresholdAmountMajor' => 5000,
'topupAmountMajor' => 5000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/v1/sdk/auto-recharge"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"customerRef\": \"<string>\",\n \"enabled\": true,\n \"triggerType\": \"balance\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerName\": \"<string>\",\n \"deferSetupIntent\": true,\n \"maxMonthlySpendMajor\": 5000,\n \"thresholdAmountMajor\": 5000,\n \"topupAmountMajor\": 5000\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/v1/sdk/auto-recharge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"customerRef\": \"<string>\",\n \"enabled\": true,\n \"triggerType\": \"balance\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerName\": \"<string>\",\n \"deferSetupIntent\": true,\n \"maxMonthlySpendMajor\": 5000,\n \"thresholdAmountMajor\": 5000,\n \"topupAmountMajor\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sdk/auto-recharge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"<string>\",\n \"customerRef\": \"<string>\",\n \"enabled\": true,\n \"triggerType\": \"balance\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerName\": \"<string>\",\n \"deferSetupIntent\": true,\n \"maxMonthlySpendMajor\": 5000,\n \"thresholdAmountMajor\": 5000,\n \"topupAmountMajor\": 5000\n}"
response = http.request(request)
puts response.read_body{
"config": {
"enabled": true,
"failureCount": 0,
"monthlySpendMinor": 4500,
"topup": {
"amountMinor": 2000,
"currency": "USD",
"mode": "fixed"
},
"trigger": {
"thresholdAmountMinor": 500,
"type": "balance"
},
"updatedAt": "<string>",
"inFlightPaymentIntentId": "<string>",
"lastChargeAt": "<string>",
"lockAcquiredAt": "<string>",
"maxMonthlySpendMinor": 10000,
"monthlySpendPeriod": "2026-07",
"paymentMethodId": "<string>"
},
"display": {
"currency": "USD",
"exchangeRate": 1,
"formatted": {
"threshold": "$5.00",
"topup": "$20.00"
},
"rateSource": "live",
"thresholdAmountMajor": 5,
"topupAmountMajor": 20
},
"publishableKey": "<string>",
"setupClientSecret": "<string>",
"stripeAccountId": "<string>"
}Auto Recharge
Set or update auto-recharge config for a customer
Persists the auto-recharge configuration for a customer. When no reusable card is on file, a Stripe SetupIntent client secret is returned so the caller can collect one.
PUT
/
v1
/
sdk
/
auto-recharge
Set or update auto-recharge config for a customer
curl --request PUT \
--url https://api.example.com/v1/sdk/auto-recharge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "<string>",
"customerRef": "<string>",
"enabled": true,
"triggerType": "balance",
"customerEmail": "jsmith@example.com",
"customerName": "<string>",
"deferSetupIntent": true,
"maxMonthlySpendMajor": 5000,
"thresholdAmountMajor": 5000,
"topupAmountMajor": 5000
}
'import requests
url = "https://api.example.com/v1/sdk/auto-recharge"
payload = {
"currency": "<string>",
"customerRef": "<string>",
"enabled": True,
"triggerType": "balance",
"customerEmail": "jsmith@example.com",
"customerName": "<string>",
"deferSetupIntent": True,
"maxMonthlySpendMajor": 5000,
"thresholdAmountMajor": 5000,
"topupAmountMajor": 5000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: '<string>',
customerRef: '<string>',
enabled: true,
triggerType: 'balance',
customerEmail: 'jsmith@example.com',
customerName: '<string>',
deferSetupIntent: true,
maxMonthlySpendMajor: 5000,
thresholdAmountMajor: 5000,
topupAmountMajor: 5000
})
};
fetch('https://api.example.com/v1/sdk/auto-recharge', 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.example.com/v1/sdk/auto-recharge",
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([
'currency' => '<string>',
'customerRef' => '<string>',
'enabled' => true,
'triggerType' => 'balance',
'customerEmail' => 'jsmith@example.com',
'customerName' => '<string>',
'deferSetupIntent' => true,
'maxMonthlySpendMajor' => 5000,
'thresholdAmountMajor' => 5000,
'topupAmountMajor' => 5000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/v1/sdk/auto-recharge"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"customerRef\": \"<string>\",\n \"enabled\": true,\n \"triggerType\": \"balance\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerName\": \"<string>\",\n \"deferSetupIntent\": true,\n \"maxMonthlySpendMajor\": 5000,\n \"thresholdAmountMajor\": 5000,\n \"topupAmountMajor\": 5000\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/v1/sdk/auto-recharge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"customerRef\": \"<string>\",\n \"enabled\": true,\n \"triggerType\": \"balance\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerName\": \"<string>\",\n \"deferSetupIntent\": true,\n \"maxMonthlySpendMajor\": 5000,\n \"thresholdAmountMajor\": 5000,\n \"topupAmountMajor\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sdk/auto-recharge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"<string>\",\n \"customerRef\": \"<string>\",\n \"enabled\": true,\n \"triggerType\": \"balance\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerName\": \"<string>\",\n \"deferSetupIntent\": true,\n \"maxMonthlySpendMajor\": 5000,\n \"thresholdAmountMajor\": 5000,\n \"topupAmountMajor\": 5000\n}"
response = http.request(request)
puts response.read_body{
"config": {
"enabled": true,
"failureCount": 0,
"monthlySpendMinor": 4500,
"topup": {
"amountMinor": 2000,
"currency": "USD",
"mode": "fixed"
},
"trigger": {
"thresholdAmountMinor": 500,
"type": "balance"
},
"updatedAt": "<string>",
"inFlightPaymentIntentId": "<string>",
"lastChargeAt": "<string>",
"lockAcquiredAt": "<string>",
"maxMonthlySpendMinor": 10000,
"monthlySpendPeriod": "2026-07",
"paymentMethodId": "<string>"
},
"display": {
"currency": "USD",
"exchangeRate": 1,
"formatted": {
"threshold": "$5.00",
"topup": "$20.00"
},
"rateSource": "live",
"thresholdAmountMajor": 5,
"topupAmountMajor": 20
},
"publishableKey": "<string>",
"setupClientSecret": "<string>",
"stripeAccountId": "<string>"
}Authorizations
Provider secret API key (sk_live_… / sk_test_…) supplied as a Bearer token.
Body
application/json
Minimum string length:
1Available options:
balance Required range:
0 < x < 10000Required range:
0 < x < 10000Required range:
0 < x < 10000Response
Saved auto-recharge config and optional SetupIntent details.
⌘I