Proxy-seller

自动充值

Updated:

自动余额充值:当余额低于阈值时,系统将从已保存的支付方式中扣除预设金额。该功能可在仅限 API v2 — 没有 v1 版本。

需在服务器端启用该功能。若该功能处于关闭状态,两个端点均返回Auto top-up is not available.

最终目标:

此请求将返回当前的自动充值配置以及上次触发结果。

GEThttps://proxy-seller.com/personal/api/v2/{YourApiKey}/balance/autotopup/get

路径参数

名称

价值

描述

授权

<Your_API_Key>

您的个人 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

路径参数

名称

价值

描述

授权

<Your_API_Key>

您的个人 API 密钥(获取方法)

请求正文

名称

类型

描述

已启用

布尔值

开启或关闭自动充值功能

阈值

编号

当余额低于此数值时扣费。最低1

数量

编号

单次充值金额。最低5,且必须大于或等于threshold

subscriptionId

字符串

要收取费用的支付方式,摘自paymentMethod.id. 仅有一张卡片时,此项为可选

dailyCountCap

编号

您自己设定的24小时内充值次数上限。最低1

monthlyAmountCap

编号

您自己设定的30天内总金额上限。该数值必须大于或等于amount

示例

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 会明确发送。在暂停的配置上编辑其他字段时,暂停状态将保持不变。

  • 即使用户未设置,以下大写规则同样适用:5 每24小时充值次数以及500 每30天为一个周期。

On this page