方法路径摘要认证
GET/v1/admin/resellersList reseller profiles登录会话
GET/v1/admin/resellers/{scope_id}Read a reseller profile登录会话
PUT/v1/admin/resellers/{scope_id}Open a tenant as a reseller, suspend or resume it, set its parameters登录会话

契约文件:api/openapi/v1/control.yaml

接口详情

GET /v1/admin/resellers

List reseller profiles

operationId
listResellers
认证
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:identity.users.manage

响应

listResellers 响应
状态码说明
200Every reseller, active first.

字段:items: array<ResellerProfile>

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
500The request could not be completed because of an internal failure.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表

GET /v1/admin/resellers/{scope_id}

Read a reseller profile

operationId
getReseller
认证
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:identity.users.manage

参数

getReseller 参数
名称位置类型必填说明
scope_idpathstring(uuid)是—

响应

getReseller 响应
状态码说明
200The profile.

字段: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)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.
500The request could not be completed because of an internal failure.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表

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_idpathstring(uuid)是—

请求体

application/json · 必填:是

putReseller 请求体
名称类型必填说明
statusstring: active / suspended是—
customer_limitinteger | null否null = unlimited
wholesale_price_liststring否—
low_balance_minorinteger(int64)否—
revisioninteger(int64)是—

响应

putReseller 响应
状态码说明
200The 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)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.
409The requested state conflicts with an existing resource or idempotency fact.
422The request is well formed but breaks a business rule (error.code names it).
500The request could not be completed because of an internal failure.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表