Skip to main content
POST
创建定价方案

授权

Authorization
string
header
必填

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

请求头

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

请求的唯一标识符

请求体

application/json

创建定价方案请求

name
string
必填

定价方案名称

product_id
string
必填

关联商品 ID

product_version_id
string
必填

商品版本 ID

billing_type
string
必填

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

description
string
必填

定价描述

price_type
string
必填

定价价格结构,取值之一:flat_price | package_price | tiers_price;based_on_usage 已废弃(存量只读),新建不可传

price_val
string

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

has_trial
boolean

是否启用试用期

trial_period
object

试用期配置

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

定价模型二级类型(已废弃,逻辑并入 price_type + billing_dimension + quantity_tier_type/price_tier_type,新建不再使用)

billing_threshold
string

扣费金额阈值(已废弃,新建改用 usage_threshold;存量只读回显)

trial_type
integer<int32>

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

trial_amount
string

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

status
string

状态:

  • draft:草稿
  • active:已激活
  • frozen:已冻结
payment_timing
string

付费时机,取值之一:prepaid-预付费 / postpaid-后付费;默认 prepaid。 本期维度互斥:仅 (prepaid, quantity) 与 (postpaid, usage) 允许,其余组合拒绝

billing_dimension
string

计费维度,取值之一:quantity-按购买量(席位) / usage-按用量 / mixed-混合(预留,本期拒绝);默认 quantity

usage_threshold
string

用量阈值(新口径,替代金额口径 billing_threshold);后付费用量路线(billing_cycle_unit=over_threshold)时填写

quantity_unit
string

数量单位名称(商品级展示用,默认 unit)

响应

200 - application/json

OK

创建定价方案响应

code
string

error code

message
string

error message

data
object

创建定价方案响应