PUT /v1/admin/resellers/{scope_id}
Open a tenant as a reseller, suspend or resume it, set its parameters
- operationId
putReseller- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
全部需要:identity.users.manage
说明(契约原文)
revision 0 opens the tenant as a reseller (status must be active); otherwise revision is the current one. An active reseller's tenant_owner role holds reseller.packages.manage, reseller.customers.manage and reseller.customers.read; suspending takes them away (customers and sold subscriptions stay). A tenant under a reseller cannot become one (422 reseller_one_level). Prepaid wholesale: each order of the reseller's package charges its wholesale cost W (by wholesale_price_list) from the prepaid balance; when an order takes the balance below low_balance_minor the reseller is notified (reseller.prepaid.low_balance).
参数
putReseller 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
scope_id | path | string(uuid) | 是 | — |
|---|
请求体
application/json · 必填:是
putReseller 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
status | string: active / suspended | 是 | — |
|---|
customer_limit | integer | null | 否 | null = unlimited |
|---|
wholesale_price_list | string | 否 | — |
|---|
low_balance_minor | integer(int64) | 否 | — |
|---|
revision | integer(int64) | 是 | — |
|---|
响应
putReseller 响应| 状态码 | 说明 |
|---|
200 | The profile after the write. 字段:scope_id: string(uuid) tenant_name: string status: string: active / suspended customer_limit: integer | null customer_count: integer(int64) wholesale_price_list: string prepaid_account_id: string(uuid) | null(uuid) low_balance_minor: integer(int64) currency: string revision: integer(int64) created_at: string(date-time) updated_at: string(date-time) suspended_at: string(date-time) | null(date-time) |
|---|
400 | The request body or parameters are invalid. |
|---|
401 | Authentication failed or the session is invalid. |
|---|
403 | The authenticated principal is not allowed to perform the action. |
|---|
404 | The requested resource was not found. |
|---|
409 | The requested state conflicts with an existing resource or idempotency fact. |
|---|
422 | The request is well formed but breaks a business rule (error.code names it). |
|---|
500 | The request could not be completed because of an internal failure. |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表