跳转到主要内容
POST
编辑定价
全量覆盖编辑定价方案,请求体与创建一致。编辑生效中定价会生成新版本并返回新版本 ID,已有订阅仍绑定旧版本不受影响;不支持修改状态、所属商品、币种。price_plan 中未暴露的计划名称、计划描述、有限期配置保留当前值。billing_dimension 留空时保留当前维度、付费时机与用量阈值;仅修改 billing_dimension 时付费时机按新维度推导。试用期单位支持 day / week / month;has_trial 置为 false 时 trial_type、trial_amount 重置,试用期单位与时长保留。

授权

Authorization
string
header
必填

Bearer API Key 鉴权。格式:Authorization: Bearer {your_api_key}

请求头

Request-Id
string
默认值:008e3967-a1b5-48bb-be14-d5bff5092e61
必填

请求的唯一标识符

路径参数

price_id
string
必填

定价方案 ID

请求体

application/json

编辑定价方案请求(全量覆盖:请求体与创建一致;币种取定价自身币种,不可修改; price_plan 中契约未暴露的计划名称、计划描述、有限期配置(is_infinite / billing_cycle_count)保留当前值)

price_id
string
必填

定价方案 ID

name
string
必填

定价方案名称

billing_type
string
必填

计费类型:one_time-一次性 / recurring-周期性

description
string
必填

定价描述

price_type
string
必填

定价价格结构,取值之一:flat_price | package_price | tiers_price

price_val
string

一次性支付价格,当 billing_type 为 one_time 时必填

has_trial
boolean

是否启用试用期。置为 false 时 trial_type、trial_amount 重置为默认值,trial_period 的单位与时长保留

trial_period
object

试用期配置;has_trial 为 true 时必填。trial_period_unit 目前仅支持 day,不传按 day 保存;has_trial 为 false 时可不传,原试用时长保留

price_plan
object

定价计划,当 billing_type 为 recurring 时必填

usage_amount
string

资源包用量(套餐含量),当 price_type 为 package_price 时必填

usage_unit
string

用量单位,当 price_type 为 package_price 时必填

features
object[]

定价权益列表

model_type
string

定价模型二级类型(已废弃)

billing_threshold
string

扣费金额阈值(已废弃,改用 usage_threshold)

trial_type
integer<int32>

试用类型:0-免费试用 | 1-付费试用

trial_amount
string

试用价格,当 trial_type 为 1(付费试用)时必填

payment_timing
string

付费时机:prepaid / postpaid。 billing_dimension 也留空时保留当前值;billing_dimension 显式传入而本字段留空时,按新维度推导(quantity→prepaid,usage→postpaid)

billing_dimension
string

计费维度:quantity / usage;留空保留当前维度

usage_threshold
string

用量阈值;留空时保留当前值(不支持通过本接口清空)

once_trial
boolean

试用期是否限制每个客户仅可享受一次。不传保留当前值;仅在 has_trial 为 true 时生效

响应

200 - application/json

OK

编辑定价方案响应

code
string

error code

message
string

error message

data
object

编辑定价方案响应