You need to enable JavaScript to run this app.
费用中心

费用中心

复制全文
实例
SetRenewalType - 设置实例续费类型
复制全文
SetRenewalType - 设置实例续费类型

为一个实例设置续费类型,包括自动续费、手动续费、到期不续费

使用说明

  1. 使用此接口设置自动续费时,仅支持续费符合续费规则的包年包月实例或包月预留实例券
  2. 续费规则可参考续费规则概览--费用中心-火山引擎,机器学习平台暂不支持OpenAPI设置自动续费
  3. 已到期、即将关停/已关停实例,仅支持设置为手动续费
  4. 预留实例券到期后不支持设置续费类型
  5. 包年包月实例到期回收后不支持设置续费类型,退订关停实例不支持设置续费类型

注意事项

  1. 单账号QPS上限为30
  2. 子用户使用该接口时,应具备BillingCenterFullAccess或BillingCenterRenewAccess权限策略

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

SetRenewalType

要执行的操作,取值:SetRenewalType。

Version
String

2022-01-01

API的版本,取值:2022-01-01。

InstanceID
String

ins123

实例ID,仅支持指定一个

Product
String

ECS

实例ID对应的商品编码

RenewType
String

AutoRenewal

续费类型
手动续费:ManualRenewal
自动续费:AutoRenewal
到期不续费:NonRenewal

RenewalDurationUnit
String

Year

自动续费周期单位
当 RenewType = AutoRenewal 时,必须设置
天:Day
月:Month
年:Year

RenewalDuration
Long

1

单次自动续费时长
当 RenewType = AutoRenewal 时,必须设置
如果是天,支持:1~365
如果是月,支持:1~12,24,36
如果是年,支持:1~3

RenewalTimes
Long

1

自动续费次数
不填写时,默认永久有效
如果限制续费次数,支持:1~100

SetRenewalRelatedInstance
Boolean

true

是否同一实例组内的强关系实例一起设置续费类型
true : 一起设置
false: 不一起设置(若存在强绑定关系实例则报错)

ClientToken
String

t12345ghfj

幂等token, (36 字符)多次调用传入同样的值,会返回第一次请求的响应。多次请求使用同一个token 请求内容却发生了变化会报错

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
SuccessInstanceList
Array of Object

[
{
"InstanceID": "ins23",
"Product": "p1"
}
]

设置续费类型成功实例列表

请求示例

POST /?Action=SetRenewalType&Version=2022-01-01 HTTP/1.1
Host: billing.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20250311T063207Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250311/cn-beijing/billing/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{
  "InstanceID": "ins123",
  "Product": "ecs",
  "RenewType": "AutoRenewal",
  "RenewalDurationUnit": "Year",
  "RenewalDuration": 1,
  "RenewalTimes": 1,
  "SetRenewalRelatedInstance": true,
  "ClientToken": "t12345ghfj"
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "2025031114175308612821124786FDF9",
    "Action": "SetRenewalType",
    "Version": "2022-01-01",
    "Service": "billing",
    "Region": "cn-beijing"
  },
  "Result": {
    "SuccessInstanceList": [
      {
        "InstanceID": "b",
        "Product": "Z4yIpYlR"
      }
    ]
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MissingParameter

The request is missing %s parameter.

参数缺失

400
InvalidParam

The parameter %s is invalid.

参数无效

403
RequestReject

You have engaged in unauthorized operations, and the function is temporarily unavailable.

您涉及违规操作,暂时无法使用该功能

404
RecordNotFound

Record not found

记录未找到

409
IdempotentRequestConflict

The request is already being processed. Please try again later.

412
StatusWrong

The instance's status is unexpected.

412
CannotSetRenewalType

This instance can not set renewal type.

429
FrequentRequest

Frequent operations, please try again later.

操作频繁,请稍后尝试

500
InternalError

Service has some internal Error. Pls Contact With Admin.

服务内部异常

最近更新时间:2025.07.07 14:18:53
这个页面对您有帮助吗?
有用
有用
无用
无用