自动充值
Updated:
自动充值:当余额低于阈值时,系统将从已保存的支付方式中扣除配置的金额。支持以下地区:仅限 API v2 — 没有 v1 版本。
需要在服务器上启用此功能。如果该功能处于关闭状态,两个端点都会返回Auto top-up is not available.
终点:
此请求将返回当前的自动充值配置以及最近一次触发结果。
GEThttps://proxy-seller.com/personal/api/v2/{YourApiKey}/balance/autotopup/get
路径参数
姓名 | 值 | 描述 |
|---|---|---|
授权 |
| 您的个人 API 密钥 (如何获取) |
示例
https://proxy-seller.com/personal/api/v2/fj4948ffhg58gh843gh/balance/autotopup/get回复
{
"status": "success",
"data": {
"configured": true,
"enabled": true,
"state": "ACTIVE",
"threshold": 10,
"amount": 25,
"subscriptionId": "sub_01hx9k2m4p",
"paymentMethod": {
"id": "sub_01hx9k2m4p",
"status": "active",
"paymentMethod": "card",
"brand": "visa",
"last4": "1234",
"exp": "05/2027"
},
"dailyCountCap": 5,
"monthlyAmountCap": 500,
"failCount": 0,
"lastAttemptAt": "2026-08-14T09:12:44.000+00:00",
"lastEvent": {
"status": "SUCCEEDED",
"amount": 25,
"at": "2026-08-14T09:12:46.000+00:00",
"reason": null
}
},
"errors": []
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Auto top-up is not available",
"code": 49,
"customData": null
}
]
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Error api key",
"code": 503,
"customData": null
},
{
"message": "IP not allowed",
"code": 503,
"customData": null
},
{
"message": "Request limit reached",
"code": 503,
"customData": null
}
]
}更改设置
终点:
此请求用于更新自动充值配置。部分更新: 您省略的任何字段都会保留其存储的值,因此若要仅更改阈值,只需发送threshold.
POSThttps://proxy-seller.com/personal/api/v2/{YourApiKey}/balance/autotopup/set
路径参数
姓名 | 值 | 描述 |
|---|---|---|
授权 |
| 您的个人 API 密钥 (如何获取) |
请求正文
姓名 | 类型 | 描述 |
|---|---|---|
已启用 | 布尔 | 开启或关闭自动充值功能 |
阈值 | 数字 | 当余额低于此数值时进行充值。最低金额 |
金额 | 数字 | 单次充值金额。最低 |
订阅ID | 字符串 | 用于扣款的支付方式,来源为 |
dailyCountCap | 数字 | 您自己设定的每24小时充值次数上限(更严格)。最低 |
monthlyAmountCap | 数字 | 您自己设定的每30天总金额限额。该限额必须大于或等于 |
示例
https://proxy-seller.com/personal/api/v2/fj4948ffhg58gh843gh/balance/autotopup/set回复
{
"status": "success",
"data": {
"configured": true,
"enabled": true,
"state": "ACTIVE",
"threshold": 10,
"amount": 25,
"subscriptionId": "sub_01hx9k2m4p",
"paymentMethod": {
"id": "sub_01hx9k2m4p",
"status": "active",
"paymentMethod": "card",
"brand": "visa",
"last4": "4242",
"exp": "05/2027"
},
"dailyCountCap": 5,
"monthlyAmountCap": 500,
"failCount": 0,
"lastAttemptAt": null,
"lastEvent": {
"status": "SETTINGS_SAVED",
"amount": null,
"at": "2026-08-14T10:03:11.000+00:00",
"reason": "enabled: false -> true"
}
},
"errors": []
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Top-up amount must be #min_amount# or more",
"code": 51,
"customData": {
"minAmount": 5
}
}
]
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Top-up amount must cover the threshold, otherwise it will trigger again",
"code": 52,
"customData": null
}
]
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Auto top-up requires a saved payment method",
"code": 53,
"customData": null
}
]
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Your saved card has expired — update it to enable auto top-up",
"code": 56,
"customData": null
}
]
}{
"status": "error",
"data": null,
"errors": [
{
"message": "Threshold must be #min_threshold# or more",
"code": 50,
"customData": {
"minThreshold": 1
}
}
]
}针对该的验证运行已合并 结果,而不仅仅是对该请求本身。发送
threshold如果存储的amount最终结果低于新的阈值。只有在以下情况下,连续多次冲锋失败后的暂停才会结束:
enabled: true是显式发送的。在已暂停的配置上编辑其他字段时,暂停状态将保持不变。即使用户设置为“none”,有效上限依然适用:
5每24小时的充值次数以及500按每30天计算。