查詢自動儲值設定
使用系統存取權杖讀取目前帳戶的資料
中國大陸用戶請注意: 中國大陸用戶請使用 https://toapis.cn 作為接口地址 (Base URL). 文檔示例中的 https://toapis.com 請替換為 https://toapis.cn.
驗證, 分頁及錯誤處理請參閱接入說明.
使用說明
僅主帳戶可查詢自身帳單. 子帳戶存取時回傳 HTTP 403, 主帳戶也不能查詢成員帳單.
enabled 是設定開關, status 也反映暫停, 缺卡, 驗證及重試狀態. threshold_credits 為觸發門檻, configured_amount_usd 為設定的 USD 金額, 不保證最終扣款或入帳. 未知時間為 null. reason 可為 card_unbound, charge_failed, verification_required, failure_limit, missing_payment_method, billing_not_linked, configuration_review_required 或 null. action_required 表示需要互動處理, GET 不嘗試扣款.
驗證
Authorizationstring請求頭必填使用系統存取權杖, 格式為 Bearer YOUR_SYSTEM_ACCESS_TOKEN. 此介面不接受模型 API Key, 不需要 X-User-Id.
請求參數
此介面不接受路徑或查詢參數, 不需要請求主體.
請求示例
curl --request GET \
--url 'https://toapis.com/api/v1/account/billing/auto-topup' \
--header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'import requests
response = requests.get(
"https://toapis.com/api/v1/account/billing/auto-topup",
headers={"Authorization": "Bearer YOUR_SYSTEM_ACCESS_TOKEN"},
timeout=30,
)
response.raise_for_status()
print(response.json())const url = new URL("https://toapis.com/api/v1/account/billing/auto-topup");
const response = await fetch(url, {
headers: { Authorization: "Bearer YOUR_SYSTEM_ACCESS_TOKEN" },
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(await response.json());回應欄位
範例使用虛構資料, 並假設 credits_per_usd="100". 實際換算請以回應為準.
codeinteger業務狀態碼, 成功時為 0.
messagestring回應訊息, 成功時為空字串. 錯誤訊息依請求語言回傳.
dataobject本次查詢的結果物件.
data.enabledboolean自動儲值的設定開關, 與執行狀態 status 分開表達.
data.statusstring自動儲值執行狀態, 反映啟用, 暫停, 驗證, 缺卡或等待重試. 可選值: active, paused, requires_action, missing_payment_method, retry_wait.
data.threshold_creditsstring觸發自動儲值的餘額門檻, 單位為 credits. 以十進位字串回傳以保留精度.
data.configured_amount_usdstring設定的自動儲值 USD 金額, 不保證最終扣款或入帳值. 以十進位字串回傳以保留精度.
data.last_attempt_atstring | null最近一次自動儲值嘗試時間. 時間格式為含時區的 RFC 3339. 無法確認或不適用時為 null.
data.last_success_atstring | null最近一次自動儲值成功時間. 時間格式為含時區的 RFC 3339. 無法確認或不適用時為 null.
data.next_retry_atstring | null下一次自動儲值重試時間. 時間格式為含時區的 RFC 3339. 無法確認或不適用時為 null.
data.action_requiredboolean是否需要使用者互動處理. 本次 GET 不會發起付款.
data.reasonstring | null自動儲值狀態的原因代碼, 無額外原因時為 null.
data.sourcestring資料來源. 本地設定或帳本快照不代表 Stripe 即時狀態. 固定值: "local_configuration".
響應示例
{
"code": 0,
"message": "",
"data": {
"enabled": true,
"status": "active",
"threshold_credits": "100",
"configured_amount_usd": "10",
"last_attempt_at": "2026-11-01T08:00:00Z",
"last_success_at": "2026-11-01T08:01:00Z",
"next_retry_at": null,
"action_required": false,
"reason": null,
"source": "local_configuration"
}
}