/admin/billing/subscription/{tenant_id}/apps/{app_id}/pricing
为租户的某个应用单独配置资源定价方案(每个资源类型独立定价),覆盖默认套餐定价。支持设置包含单位数、单价和超额单价。
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|---|---|
tenant_id |
path |
string |
是 | 租户ID | |||
app_id |
path |
string |
是 | 应用ID |
请求体
Schema: service-billing/internal/handler/dto.ConfigureAppPricingRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
pricings |
array of 参见 |
是 |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 应用定价配置成功 | service-billing/internal/handler/dto.AppSubscriptionDetailResponse |
| 400 | 请求参数错误 | object |
| 401 | 未授权 | object |
| 403 | 无权限 | object |
| 500 | 服务器内部错误 | object |
引用的 Schema
service-billing/internal/handler/dto.AppResourcePricingInputDTO
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
resource_type |
string |
是 | api_calls |
||
included_units |
integer |
否 | 10000 |
||
overage_unit_price |
number |
否 | 0.05 |
||
unit_label |
string |
否 | 次 |
||
unit_price |
number |
否 | 0.01 |
service-billing/internal/handler/dto.AppResourcePricingResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
id |
string |
否 | arp_001 |
||
included_units |
integer |
否 | 10000 |
||
overage_unit_price |
number |
否 | 0.05 |
||
resource_type |
string |
否 | api_calls |
||
subscription_app_id |
string |
否 | sa_001 |
||
unit_label |
string |
否 | 次 |
||
unit_price |
number |
否 | 0.01 |
service-billing/internal/handler/dto.AppSubscriptionDetailResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-billing/internal/handler/dto.SubscriptionAppResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-billing/internal/handler/dto.SubscriptionAppResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
app_id |
string |
否 | app_001 |
||
created_at |
string |
否 | 2026-04-01T00:00:00Z |
||
id |
string |
否 | sa_001 |
||
pricings |
array of 参见 |
否 | |||
status |
string |
否 | active |
||
subscription_id |
string |
否 | sub_001 |
||
tenant_id |
string |
否 | tnt_xyz789 |