方法路径摘要认证
GET/v1/admin/package-commerce/ordersList all package orders for one explicit tenant登录会话
GET/v1/admin/package-commerce/orders/{order_id}Get one order in an explicit tenant scope登录会话
GET/v1/admin/package-commerce/orders/{order_id}/eventsList sanitized events for one tenant order登录会话
POST/v1/admin/package-commerce/orders/{order_id}/refundApply an approved partial or cumulative refund登录会话
POST/v1/admin/package-commerce/orders/{order_id}/voidVoid an eligible order using a one-time approval fact登录会话
GET/v1/admin/package-commerce/soldList sold packages across tenants登录会话
POST/v1/admin/package-commerce/sold/commands—登录会话
GET/v1/admin/package-commerce/sold/{subscription_id}—登录会话
GET/v1/admin/package-commerce/sold/{subscription_id}/sync—登录会话
GET/v1/admin/package-commerce/subscriptionsList effective sold subscriptions for one explicit tenant登录会话
POST/v1/admin/package-commerce/subscriptionsOpen a package subscription for an active tenant member without an order登录会话
POST/v1/admin/package-commerce/subscriptions/{subscription_id}/cancelCancel a tenant subscription as administrator登录会话
POST/v1/admin/package-commerce/subscriptions/{subscription_id}/suspendSuspend one package subscription as an administrator登录会话
POST/v1/admin/package-commerce/subscriptions/{subscription_id}/unsuspendUnsuspend one package subscription as an administrator登录会话
GET/v1/admin/package-commerce/traffic-purchases/{order_id}Get one sanitized traffic-purchase result for an explicit tenant登录会话

契约文件:api/control-package-commerce.openapi.yaml api/control-package-sold.openapi.yaml

接口详情

GET /v1/admin/package-commerce/orders

List all package orders for one explicit tenant

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

全部需要:billing.adjustments.manage

参数

listTenantPackageOrdersAsPlatform 参数
名称位置类型必填说明
tenant_idquerystring(uuid)是Target tenant access-scope UUID; platform routes never infer it.
limitqueryinteger否—
cursorquerystring否Versioned base64url HMAC-SHA256 envelope bound to endpoint, target tenant, and owner user where applicable. Tampering or cross-scope reuse returns package_commerce_validation_error.
operationquerystring: upgrade / downgrade否Optional platform-only filter for package upgrade or downgrade orders.
product_kindquerystring: package_subscription / traffic_package否Optional order product filter shared by tenant and platform order reads.
statequerystring: created / paid / fulfilled / cancelled / refund_applied / void_applied / failed否Optional latest order state filter shared by tenant and platform order reads.
request_idquerystring否Optional X-Request-ID the order was created with, so a buyer can confirm the outcome of the original command.

响应

listTenantPackageOrdersAsPlatform 响应
状态码说明
200Stable keyset page ordered by created_at and order UUID descending.

字段:items: array<Order> next_cursor?: string

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
408Caller cancelled the query.
502Stored facts or encoded response violate the public response contract.
503Query storage or required callback verification is unavailable.
504Query deadline elapsed.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/package-commerce/orders/{order_id}

Get one order in an explicit tenant scope

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

全部需要:billing.adjustments.manage

参数

getTenantPackageOrderAsPlatform 参数
名称位置类型必填说明
order_idpathstring(uuid)是—
tenant_idquerystring(uuid)是Target tenant access-scope UUID; platform routes never infer it.

响应

getTenantPackageOrderAsPlatform 响应
状态码说明
200Sanitized visible order.

字段:id: string(uuid) display_id: string tenant_scope_id: string(uuid) user_id: string(uuid) user_display_id: string operation: string: purchase / renew / upgrade / downgrade / traffic_package_purchase subscription_id?: string(uuid) product_kind: string: package_subscription / traffic_package product_id: string(uuid) product_revision: integer(int64) protection?: object traffic_product_snapshot_id?: string(uuid) package_period?: string: month / quarter / year currency: string original_amount_minor: integer(int64) discount_amount_minor: integer(int64) payable_amount_minor: integer(int64) settlement_direction: string: debit / credit / hold funding_source: string: balance / provider / reseller effective_mode: string: immediate / next_cycle effective_at: string(date-time) state: string: created / paid / fulfilled / cancelled / refund_applied / void_applied / failed revision: integer(int64) created_at: string(date-time) seller_scope_id?: object wholesale_minor?: integer(int64) product_name?: string

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
408Caller cancelled the query.
502Stored facts or encoded response violate the public response contract.
503Query storage or required callback verification is unavailable.
504Query deadline elapsed.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表

GET /v1/admin/package-commerce/orders/{order_id}/events

List sanitized events for one tenant order

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

全部需要:billing.adjustments.manage

参数

listTenantPackageOrderEventsAsPlatform 参数
名称位置类型必填说明
order_idpathstring(uuid)是—
tenant_idquerystring(uuid)是Target tenant access-scope UUID; platform routes never infer it.
limitqueryinteger否—
cursorquerystring否Versioned base64url HMAC-SHA256 envelope bound to endpoint, target tenant, and owner user where applicable. Tampering or cross-scope reuse returns package_commerce_validation_error.

响应

listTenantPackageOrderEventsAsPlatform 响应
状态码说明
200Stable event page ordered by revision ascending.

字段:items: array<OrderEvent> next_cursor?: string

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
408Caller cancelled the query.
502Stored facts or encoded response violate the public response contract.
503Query storage or required callback verification is unavailable.
504Query deadline elapsed.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表

POST /v1/admin/package-commerce/orders/{order_id}/refund

Apply an approved partial or cumulative refund

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

全部需要:billing.adjustments.manage

说明(契约原文)

Requires a platform principal with billing.adjustments.manage and an explicit tenant_id. The core requires a matching unexpired, unused two-person approval fact; this endpoint neither creates nor weakens that approval. gross_amount_minor is the gross amount for this refund action.

参数

refundPackageOrder 参数
名称位置类型必填说明
order_idpathstring(uuid)是—
Idempotency-Keyheaderstring是One bounded business-action key. Exact retries preserve the original payload, target, principal, and If-Match precondition. Reuse with changed input returns idempotency_conflict.
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

refundPackageOrder 请求体
名称类型必填说明
tenant_idstring(uuid)是—
gross_amount_minorinteger(int64)是—
revoke_entitlementboolean是—
approval_idstring(uuid) | string否Optional. Refunds no longer require a second administrator's approval. When supplied it must be a canonical UUID of an unexpired, unused manual approval for this order and operation; it is then validated and consumed as before. An empty string is treated as absent.

响应

refundPackageOrder 响应
状态码说明
200Applied command result or identical committed replay.

字段:order: Order fulfillment?: Fulfillment replayed: boolean

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
409Idempotency, provider event, state, approval, refund, or traffic-use conflict.
422Funding, promotion, arithmetic, or fulfillment policy rejected the command.
408The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.
502Stored facts or encoded response violate the public response contract.
503The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.
504The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/package-commerce/orders/{order_id}/void

Void an eligible order using a one-time approval fact

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

全部需要:billing.adjustments.manage

说明(契约原文)

Requires billing.adjustments.manage and an explicit tenant_id. The approval must match the order, tenant, operation, executor, and validity window. Existing refunds or a consumed approval remain hard failures.

参数

voidPackageOrder 参数
名称位置类型必填说明
order_idpathstring(uuid)是—
Idempotency-Keyheaderstring是One bounded business-action key. Exact retries preserve the original payload, target, principal, and If-Match precondition. Reuse with changed input returns idempotency_conflict.
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

voidPackageOrder 请求体
名称类型必填说明
tenant_idstring(uuid)是—
approval_idstring(uuid) | string否Optional. Voids no longer require a second administrator's approval. When supplied it is validated and consumed as before; an empty string is treated as absent.

响应

voidPackageOrder 响应
状态码说明
200Applied command result or identical committed replay.

字段:order: Order fulfillment?: Fulfillment replayed: boolean

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
409Idempotency, provider event, state, approval, refund, or traffic-use conflict.
408The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.
502Stored facts or encoded response violate the public response contract.
503The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.
504The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/package-commerce/sold

List sold packages across tenants

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

全部需要:billing.adjustments.manage

说明(契约原文)

Requires a platform-scope principal. Empty optional parameters must be omitted; duplicate and unknown parameters are rejected. Product options include all sold products independent of filters, without a 100-item cap. Names come from the effective immutable product snapshot. User display IDs come from users.display_id. A subscription ID is its actual UUID, never its revision. Expiry week is the next 7 days; month is the next calendar month, both excluding already expired records. Expired includes ends_at equal to the query time. Status is the stored lifecycle status; an expired active subscription still has lifecycle_status active. Usage is currently null because the commerce read model has no authoritative settled per-cycle counter; unknown usage matches neither exhausted nor remaining. A traffic limit of -1 means unlimited. CNAME searches current and last-known-good hostname claims associated with the subscription or one of its sites. Search values are literal case-insensitive substrings, not SQL patterns.

参数

listAdminSoldPackages 参数
名称位置类型必填说明
pagequeryinteger否—
limitqueryinteger否—
expiryquerystring: all / month / week / expired否—
product_idquerystring(uuid)否—
sortquerystring: created_at_desc / ends_at_asc否—
statusquerystring: all / enabled / disabled / active / cancelled否—
usagequerystring: all / exhausted / remaining否—
user_idquerystring否Exact owner UUID or positive decimal user display ID.
qquerystring否Literal substring of the package snapshot name or (when not all digits) of the subscription UUID; a positive decimal also matches the package display ID exactly.
cnamequerystring否—

响应

listAdminSoldPackages 响应
状态码说明
200Globally filtered page with count and complete sold-product options.

字段:items: array<SoldPackage> count: integer(int64) products: array<object>

400Invalid parameters (package_commerce_validation_error).
401Authentication required.
403Platform scope and billing.adjustments.manage required.
408Request cancelled.
502Invalid stored facts or oversized response.
503Read store unavailable.
504Query deadline exceeded.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/package-commerce/sold/commands

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

全部需要:package_subscriptions.manage

说明(契约原文)

Executes all selected items in one transaction. The live session and RBAC are rechecked, including replay. A changed body under an existing key is rejected. Editing appends an entitlement snapshot without rewriting the purchased catalog version or historical prices. Enable/disable is independent of cancellation. Safe deletion rejects live resources; cascade deletion uses audited resource deletion and edge publication. Neither mode refunds money; unsettled orders, held balances and scheduled entitlements block deletion. Sync copies only selected fields to bound websites and L4 forwarding resources, then persists signed edge publication, rollout and node command outbox. Publication receipts are polled separately and command success does not imply every node has applied it.

参数

administerSoldPackages 参数
名称位置类型必填说明
Idempotency-Keyheaderstring是—
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

administerSoldPackages 请求体
名称类型必填说明
actionstring: edit / enable / disable / delete / sync是—
itemsarray<object>是—
configSoldConfig否—
ends_atstring(date-time)否—
delete_modestring: safe / cascade否—
sync_fieldsarray<string: line_group / cname_domain / cname_mode>否—

响应

administerSoldPackages 响应
状态码说明
200Persisted command or exact idempotent replay.

字段:items: array<SoldDetail> publications: array<SoldPublication> replayed: boolean

400Invalid or duplicate fields/items; edit requires one item and a full config.
401A live platform session is required.
403Required package/resource/DNS/publication permission denied.
409package_sold_dependencies, package_sold_financial_dependencies, package_sold_setting_unsupported, package_sold_invalid_state or idempotency_conflict.
412revision_conflict; no item was modified.
503package_sold_runtime_unavailable; no item was modified.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 412 版本已变:回读最新 ETag 后重新判断,再带新的 If-Match 提交。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表

GET /v1/admin/package-commerce/sold/{subscription_id}

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

全部需要:billing.adjustments.manage

参数

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

响应

getAdminSoldPackage 响应
状态码说明
200Effective sold snapshot and complete authorized reference options.

字段:id: string(uuid) tenant_scope_id: string(uuid) owner_user_id: string(uuid) revision: integer enabled: boolean deleted: boolean ends_at: string(date-time) config: SoldConfig options: object

403Platform read permission required.
404Subscription not found.

失败时怎么办

  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。

↑ 回到列表

GET /v1/admin/package-commerce/sold/{subscription_id}/sync

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

全部需要:billing.adjustments.manage

参数

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

响应

getAdminSoldPackageSync 响应
状态码说明
200Latest 20 publications with authoritative rollout and latest node attempt counts.

字段:publications: array<object>

403Platform read permission required.
404Subscription not found.

失败时怎么办

  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。

↑ 回到列表

GET /v1/admin/package-commerce/subscriptions

List effective sold subscriptions for one explicit tenant

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

全部需要:billing.adjustments.manage

说明(契约原文)

Uses the fixed-time effective entitlement projection. Each subsequent page reuses all three values from the endpoint- and tenant-bound signed cursor, so later entitlement backfills, renewals, or cancellations cannot create mixed facts.

参数

listSoldPackageSubscriptionsAsPlatform 参数
名称位置类型必填说明
tenant_idquerystring(uuid)是Target tenant access-scope UUID; platform routes never infer it.
limitqueryinteger否—
cursorquerystring否Versioned base64url HMAC-SHA256 envelope bound to endpoint, target tenant, and owner user where applicable. Tampering or cross-scope reuse returns package_commerce_validation_error.
statusquerystring: active / expired / cancelled否Effective status at the frozen snapshot. active ends after snapshot_at; expired ends at or before snapshot_at; cancelled always follows the immutable cancelled lifecycle fact regardless of end_at.
end_at_fromquerystring(date-time)否Inclusive canonical UTC microsecond lower bound for end_at.
end_at_toquerystring(date-time)否Exclusive canonical UTC microsecond upper bound for end_at.
include_product_namequerystring: true / false否Accepts exactly one lowercase true or false. Empty, repeated, or other values return 400. Omitted or false preserves the legacy response shape. true includes product_name only when the selected effective entitlement's immutable product_snapshot.name is a JSON string, preserved without normalization. Missing, null, or non-string names are omitted. The current product catalog is never used. This projection does not change subscription membership, ordering, or the cursor's tenant, owner, time, and high-water bounds.

响应

listSoldPackageSubscriptionsAsPlatform 响应
状态码说明
200Stable effective-subscription projection page.

字段:items: array<Subscription> next_cursor?: string total?: integer(int64)

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
408Caller cancelled the query.
502Stored facts or encoded response violate the public response contract.
503Query storage or required callback verification is unavailable.
504Query deadline elapsed.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/package-commerce/subscriptions

Open a package subscription for an active tenant member without an order

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

全部需要:package_subscriptions.manage

说明(契约原文)

Creates the subscription, immutable revision-one state, and active manual_open entitlement atomically. It never fabricates an order, payment, or fulfillment. Unknown outcomes may be retried only with the exact original body and Idempotency-Key.

参数

openPackageSubscriptionAsPlatform 参数
名称位置类型必填说明
Idempotency-Keyheaderstring是One bounded business-action key. Exact retries preserve the original payload, target, principal, and If-Match precondition. Reuse with changed input returns idempotency_conflict.
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

openPackageSubscriptionAsPlatform 请求体
名称类型必填说明
tenant_idstring(uuid)是—
owner_user_idstring(uuid)是—
product_idstring(uuid)是—
product_revisioninteger(int64)是—
site_limitinteger(int64)是-1 means unlimited; otherwise 0 through 1,000,000,000.
node_limitinteger(int64)是-1 means unlimited; otherwise 0 through 1,000,000,000.
durationstring: month / quarter / year否—
end_atstring(date-time)否—
timezonestring是—
cycle_policyobject | object是—
traffic_factorTrafficFactor是—

响应

openPackageSubscriptionAsPlatform 响应
状态码说明
201Subscription and entitlement created, or an identical committed replay returned.

字段:subscription_id: string(uuid) tenant_scope_id: string(uuid) owner_user_id: string(uuid) product_id: string(uuid) product_revision: integer(int64) starts_at: string(date-time) ends_at: string(date-time) lifecycle_status: string revision: integer(int64) replayed: boolean

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
409Idempotency, provider event, state, approval, refund, or traffic-use conflict.
408The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.
502Stored facts or encoded response violate the public response contract.
503The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.
504The write outcome is unknown. Retry only the exact original request with the same Idempotency-Key and If-Match value where present.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/package-commerce/subscriptions/{subscription_id}/cancel

Cancel a tenant subscription as administrator

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

全部需要:package_subscriptions.manage

说明(契约原文)

Physical deletion is not supported by cancellation. Use sold package commands for independent enable/disable and audited deletion.

参数

cancelPackageSubscriptionAsPlatform 参数
名称位置类型必填说明
subscription_idpathstring(uuid)是—
If-Matchheaderstring是—
Idempotency-Keyheaderstring是—
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

cancelPackageSubscriptionAsPlatform 请求体
名称类型必填说明
tenant_idstring(uuid)是—

响应

cancelPackageSubscriptionAsPlatform 响应
状态码说明
201Cancelled subscription or exact idempotent replay.

字段:subscription: object intent?: object

400Invalid request.
403Permission denied.
404Subscription not found.
409Invalid subscription state or idempotency conflict.
412Revision conflict.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 412 版本已变:回读最新 ETag 后重新判断,再带新的 If-Match 提交。

↑ 回到列表

POST /v1/admin/package-commerce/subscriptions/{subscription_id}/suspend

Suspend one package subscription as an administrator

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

全部需要:package_subscriptions.manage

说明(契约原文)

Stops publishing the subscription's sites and forwards (configuration kept) and republishes the scope at once. The term keeps running. Only this subscription is affected. Suspending an already suspended subscription succeeds without a change. reason is required.

参数

suspendPackageSubscriptionAsPlatform 参数
名称位置类型必填说明
subscription_idpathstring(uuid)是—
Idempotency-Keyheaderstring是One bounded business-action key. Exact retries preserve the original payload, target, principal, and If-Match precondition. Reuse with changed input returns idempotency_conflict.
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

suspendPackageSubscriptionAsPlatform 请求体
名称类型必填说明
tenant_idstring(uuid)是—
reasonstring是—

响应

suspendPackageSubscriptionAsPlatform 响应
状态码说明
200The subscription after the change (or unchanged when already in that state), or an exact idempotent replay.

字段:subscription: object

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
409Idempotency, provider event, state, approval, refund, or traffic-use conflict.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/package-commerce/subscriptions/{subscription_id}/unsuspend

Unsuspend one package subscription as an administrator

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

全部需要:package_subscriptions.manage

说明(契约原文)

Publishes the subscription's sites and forwards again at once. Unsuspending a subscription that is not suspended succeeds without a change.

参数

unsuspendPackageSubscriptionAsPlatform 参数
名称位置类型必填说明
subscription_idpathstring(uuid)是—
Idempotency-Keyheaderstring是One bounded business-action key. Exact retries preserve the original payload, target, principal, and If-Match precondition. Reuse with changed input returns idempotency_conflict.
X-Request-IDheaderstring是—
traceparentheaderstring是—

请求体

application/json · 必填:是

unsuspendPackageSubscriptionAsPlatform 请求体
名称类型必填说明
tenant_idstring(uuid)是—

响应

unsuspendPackageSubscriptionAsPlatform 响应
状态码说明
200The subscription after the change (or unchanged when already in that state), or an exact idempotent replay.

字段:subscription: object

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
409Idempotency, provider event, state, approval, refund, or traffic-use conflict.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/package-commerce/traffic-purchases/{order_id}

Get one sanitized traffic-purchase result for an explicit tenant

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

全部需要:billing.adjustments.manage

说明(契约原文)

The platform principal must name the target tenant. A purchase outside that tenant scope is indistinguishable from an unknown order.

参数

getTenantTrafficPackagePurchaseAsPlatform 参数
名称位置类型必填说明
order_idpathstring(uuid)是—
tenant_idquerystring(uuid)是Target tenant access-scope UUID; platform routes never infer it.

响应

getTenantTrafficPackagePurchaseAsPlatform 响应
状态码说明
200Sanitized traffic order and an optional grant while provider payment is pending.

字段:order: Order grant?: TrafficGrant

400Invalid JSON, UUID, enum, amount, time zone, query, cursor, or required header.
401Authentication is absent or invalid.
403Current scope or live permission does not authorize the operation.
404Resource is absent or outside the caller's visible tenant/owner scope.
408Caller cancelled the query.
502Stored facts or encoded response violate the public response contract.
503Query storage or required callback verification is unavailable.
504Query deadline elapsed.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表