curl --request GET \
--url https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge \
--header 'Authorization: Bearer <token>'import requests
url = "https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/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://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"available": true,
"enabled": true,
"threshold_credits": 4503599627370495,
"top_up_credits": 4503599627370495,
"top_up_amount_cents": 1,
"currency": "<string>",
"failure": {
"code": "<string>",
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_request",
"type": "invalid_request",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"retryable": true
}
}{
"error": {
"code": "invalid_request",
"type": "invalid_request",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"retryable": true
}
}{
"error": {
"code": "invalid_request",
"type": "invalid_request",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"retryable": true
}
}Whether this account tops itself up, and on what terms
The account’s auto-recharge setting and the figures it would use.
The figures are per tier and not chosen by the caller. The threshold is a tenth of the tier’s included allowance and the top-up is one more month of it at that month’s price, so the same rule reads sensibly from a 1,200-credit plan to a 30,000-credit one, where any flat number would be a rounding error at one end and the whole allowance at the other. It also means a top-up needs no Stripe product that a subscription does not already have.
available is false on the free tier, whose grant is one-time and which has no price to charge; every figure is then null.
failure carries the provider’s decline code and when it happened, and nothing else — the message beside it at Stripe quotes the card. A recorded failure also pauses auto-recharge, because an account below its floor would otherwise re-present a dead card on every confirm; the customer clears it by switching the setting back on.
A read, so it stays open in every account state.
curl --request GET \
--url https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge \
--header 'Authorization: Bearer <token>'import requests
url = "https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/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://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod/v1/billing/auto-recharge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"available": true,
"enabled": true,
"threshold_credits": 4503599627370495,
"top_up_credits": 4503599627370495,
"top_up_amount_cents": 1,
"currency": "<string>",
"failure": {
"code": "<string>",
"at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_request",
"type": "invalid_request",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"retryable": true
}
}{
"error": {
"code": "invalid_request",
"type": "invalid_request",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"retryable": true
}
}{
"error": {
"code": "invalid_request",
"type": "invalid_request",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"retryable": true
}
}Authorizations
A Cognito access token, issued through the dashboard's own sign-up and sign-in pages (a backend-for-frontend; there is no Cognito Hosted UI) and sent as Authorization: Bearer <jwt>. Dashboard operations require this scheme and cannot be called with an API key, with no exception. GET /v1/usage and GET /v1/limits offered both schemes from 0.8.0; 0.8.1 withdrew that, because the control-plane API serves them alone and its authorizer has no API-key branch. An account_id supplied by the client is ignored; all reads/writes are scoped server-side to the authenticated account.
Response
The setting and its terms.
Whether this account tops itself up, and the figures it would use. Every figure is null when available is false, which is the free tier: its grant is one-time and it has no price to charge.
Whether this account's tier can auto-recharge at all.
Whether the customer has switched it on.
The settled balance at which a top-up is triggered — a floor crossed downward, not a total spent. It is a tenth of the tier's included allowance.
0 <= x <= 9007199254740991The credits a top-up adds — one more month of the tier's allowance.
0 <= x <= 9007199254740991What a top-up costs, in the currency's smallest unit.
x >= 0ISO 4217 code for top_up_amount_cents.
The last decline, or null. A recorded failure pauses auto-recharge; switching it on again clears this.
Show child attributes
Show child attributes

