方法路径摘要认证
GET/v1/reseller/customersA reseller lists its own customers登录会话
POST/v1/reseller/customersA reseller opens a customer tenant under itself登录会话
GET/v1/reseller/customers/{scope_id}/sitesA reseller lists one of its customers' sites (read only)登录会话
PUT/v1/reseller/customers/{user_id}/statusA reseller suspends (disabled) or resumes (active) one of its customers登录会话

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

接口详情

GET /v1/reseller/customers

A reseller lists its own customers

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

全部需要:reseller.customers.read

说明(契约原文)

Tenant session of an active reseller with reseller.customers.read or reseller.customers.manage. Items are the owner users of tenants whose parent_scope_id is the caller's scope (ManagedUser shape, metadata always set, group always null).

参数

listResellerCustomers 参数
名称位置类型必填说明
pagequeryinteger否—
limitqueryinteger否—
searchquerystring否Username, name, email, phone or display ID substring.
statusquerystring: active / disabled否—

响应

listResellerCustomers 响应
状态码说明
200One page of customers.

字段:items: array<ManagedUser> page: integer limit: integer total: integer(int64)

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 重试。

↑ 回到列表

POST /v1/reseller/customers

A reseller opens a customer tenant under itself

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

全部需要:reseller.customers.manage

说明(契约原文)

Creates tenant + tenant scope + owner user in one transaction with parent_scope_id = the caller's scope (the 480 guard re-checks the active reseller and customer_limit). Audit identity.user.create in both scopes. 422 reseller_customer_limit when the limit is reached; 409 username_conflict.

参数

createResellerCustomer 参数
名称位置类型必填说明
Idempotency-Keyheaderstring是—

请求体

application/json · 必填:是

createResellerCustomer 请求体
名称类型必填说明
usernamestring是—
passwordstring是8 to 1024 printable ASCII characters (no space) with at least two of upper case, lower case, digits and symbols; otherwise password_policy_unmet.
display_namestring是—
emailstring | null否—
phonestring | null否—
remarkstring | null否—
qqstring | null否—

响应

createResellerCustomer 响应
状态码说明
201The customer's owner user.

字段:id: string(uuid) display_id: string scope_id: string(uuid) tenant_id: string(uuid) username: string display_name: string email: string(email) | null(email) phone: string | null status: string: active / disabled role: string: tenant_owner / tenant_viewer group_id: string(uuid) | null(uuid) group_name: string | null metadata?: ManagedUserMetadata verification?: ManagedUserVerification reseller?: ManagedUserReseller revision: integer(int64) created_at: string(date-time) updated_at: string(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.
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 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表

GET /v1/reseller/customers/{scope_id}/sites

A reseller lists one of its customers' sites (read only)

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

全部需要:reseller.customers.read

说明(契约原文)

Tenant session of an active reseller with reseller.customers.read or reseller.customers.manage. The scope must be a customer tenant under the caller's active reseller scope (same check as the reseller package-commerce routes); any other scope, the caller's own included, is 403. Items carry only id, display_id and domain, newest first.

参数

listResellerCustomerSites 参数
名称位置类型必填说明
scope_idpathstring(uuid)是The customer's tenant scope ID.
pagequeryinteger否—
limitqueryinteger否—
domainquerystring否Case-insensitive domain substring.

响应

listResellerCustomerSites 响应
状态码说明
200One page of the customer's sites.

字段:items: array<object> page: integer limit: integer total: integer(int64)

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.
503A required dependency is unavailable.

失败时怎么办

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

↑ 回到列表

PUT /v1/reseller/customers/{user_id}/status

A reseller suspends (disabled) or resumes (active) one of its customers

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

全部需要:reseller.customers.manage

说明(契约原文)

Only the owner user of the caller's own customer tenant; anything else is 404. Disabling revokes the user's sessions. Audit reseller.customer.status in both scopes. 409 version_conflict on a stale expected_revision.

参数

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

请求体

application/json · 必填:是

setResellerCustomerStatus 请求体
名称类型必填说明
statusstring: active / disabled是—
expected_revisioninteger(int64)是—

响应

setResellerCustomerStatus 响应
状态码说明
200The customer's owner user after the change.

字段:id: string(uuid) display_id: string scope_id: string(uuid) tenant_id: string(uuid) username: string display_name: string email: string(email) | null(email) phone: string | null status: string: active / disabled role: string: tenant_owner / tenant_viewer group_id: string(uuid) | null(uuid) group_name: string | null metadata?: ManagedUserMetadata verification?: ManagedUserVerification reseller?: ManagedUserReseller revision: integer(int64) created_at: string(date-time) updated_at: string(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.
500The request could not be completed because of an internal failure.

失败时怎么办

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

↑ 回到列表