POST /admin/billing/subscription/{tenant_id}/change-plan
将指定租户当前订阅切换到另一个套餐(升级或降级),自动计算按比例(proration)费用。差额为正时产生应收账单,为负时计入信用余额。
计费服务 `bearerAuth` application/json
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
tenant_id |
path |
string |
Yes |
|
|
|
租户ID |
Request Body
Schema: dto.PlanChangeRequest
| Field | Type | Required | Example | Constraints | Description |
new_plan |
string |
Yes |
enterprise |
|
|
billing_cycle |
string |
No |
monthly |
|
|
Responses
| Status | Description | Schema |
| 200 | 套餐变更成功,含按比例费用 | object |
| 400 | 请求参数错误 | object |
| 401 | 未授权 | object |
| 403 | 无权限 | object |
| 500 | 服务器内部错误 | object |