方法路径摘要认证
GET/v1/admin/traffic-packages/grantsList grants for one explicit tenant登录会话
POST/v1/admin/traffic-packages/grants/{grant_id}/disablePause deduction without changing remaining bytes or expiry登录会话
POST/v1/admin/traffic-packages/grants/{grant_id}/enableResume deduction for an unexpired active grant登录会话
GET/v1/admin/traffic-packages/grants/{grant_id}/reconciliationCompare one grant's cached and ledger-recomputed balance登录会话
GET/v1/admin/traffic-packages/optionsSearch base or traffic product names for management selectors登录会话
GET/v1/admin/traffic-packages/productsList current product revisions登录会话
GET/v1/admin/traffic-packages/products/{product_id}Get the current revision of one product登录会话
POST/v1/admin/traffic-packages/products/{product_id}/archiveRemove a product from sale while preserving sold entitlements and history登录会话
POST/v1/admin/traffic-packages/products/{product_id}/disableDisable a product登录会话
POST/v1/admin/traffic-packages/products/{product_id}/enableEnable a product登录会话
GET/v1/admin/traffic-packages/products/{product_id}/revisionsList immutable product revision history登录会话
POST/v1/admin/traffic-packages/products/{product_id}/revisionsCreate an immutable product revision登录会话
GET/v1/admin/traffic-packages/soldList sold grants across tenants with server-side filters and count登录会话

契约文件:api/control-traffic-packages.openapi.yaml

接口详情

GET /v1/admin/traffic-packages/grants

List grants for one explicit tenant

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

全部需要:traffic_packages.read

参数

listTenantTrafficPackageGrants 参数
名称位置类型必填说明
tenant_idquerystring(uuid)是Explicit access-scope UUID of the target tenant.
limitqueryinteger否—
cursorquerystring否Opaque HMAC-signed cursor bound to endpoint, principal scope, target tenant, owner user, UTC-microsecond snapshot_at, and the applicable migration-066 catalog/usage snapshot_version or grant-state watermark.

响应

listTenantTrafficPackageGrants 响应
状态码说明
200Grants visible under the derived or explicit tenant scope.

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

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
408Read context was cancelled.
502Stored or core facts did not satisfy the public response contract.
503Read storage is unavailable.
504Read deadline expired.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/traffic-packages/grants/{grant_id}/disable

Pause deduction without changing remaining bytes or expiry

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

全部需要:traffic_packages.manage

参数

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

响应

disableSoldTrafficPackage 响应
状态码说明
200Immutable audited command receipt; identical retries return the same fact.

字段:id: string(uuid) target_id: string(uuid) operation: string: archive_product / enable_grant / disable_grant revision: integer replayed: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
409Idempotency, refund amount, grant-state, or bounded automatic-expiry backlog conflict. For traffic_package_expiry_backlog the original key replays the frozen result and a new caller-generated key advances at most the next 100 due grants.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/traffic-packages/grants/{grant_id}/enable

Resume deduction for an unexpired active grant

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

全部需要:traffic_packages.manage

参数

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

响应

enableSoldTrafficPackage 响应
状态码说明
200Immutable audited command receipt; identical retries return the same fact.

字段:id: string(uuid) target_id: string(uuid) operation: string: archive_product / enable_grant / disable_grant revision: integer replayed: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
409Idempotency, refund amount, grant-state, or bounded automatic-expiry backlog conflict. For traffic_package_expiry_backlog the original key replays the frozen result and a new caller-generated key advances at most the next 100 due grants.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/traffic-packages/grants/{grant_id}/reconciliation

Compare one grant's cached and ledger-recomputed balance

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

全部需要:traffic_packages.read

参数

reconcileTenantTrafficPackageGrant 参数
名称位置类型必填说明
grant_idpathstring(uuid)是—
tenant_idquerystring(uuid)是Explicit access-scope UUID of the target tenant.

响应

reconcileTenantTrafficPackageGrant 响应
状态码说明
200Cached and recomputed grant balance comparison.

字段:grant_id: string(uuid) cached_remaining: integer(int64) recomputed_remaining: integer(int64) cached_revision: integer(int64) entry_count: integer(int64) consistent: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
408Read context was cancelled.
502Stored or core facts did not satisfy the public response contract.
503Read storage is unavailable.
504Read deadline expired.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/traffic-packages/options

Search base or traffic product names for management selectors

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

全部需要:traffic_packages.read

参数

listTrafficPackageManagementOptions 参数
名称位置类型必填说明
kindquerystring: base / traffic是—
searchquerystring否—

响应

listTrafficPackageManagementOptions 响应
状态码说明
200Up to 100 matching names; traffic options include archived products for historical sold filters.

字段:items: array<object>

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/traffic-packages/products

List current product revisions

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

全部需要:traffic_packages.read

参数

listCurrentTrafficPackageProducts 参数
名称位置类型必填说明
limitqueryinteger否—
cursorquerystring否Opaque HMAC-signed cursor bound to endpoint, principal scope, target tenant, owner user, UTC-microsecond snapshot_at, and the applicable migration-066 catalog/usage snapshot_version or grant-state watermark.

响应

listCurrentTrafficPackageProducts 响应
状态码说明
200Current products or immutable revision history.

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

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
408Read context was cancelled.
502Stored or core facts did not satisfy the public response contract.
503Read storage is unavailable.
504Read deadline expired.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/traffic-packages/products/{product_id}

Get the current revision of one product

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

全部需要:traffic_packages.read

参数

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

响应

getCurrentTrafficPackageProduct 响应
状态码说明
200Current product revision.

字段:id: string(uuid) product_id: string(uuid) revision: integer(int64) audience: string: global / tenant owner_tenant_scope_id?: string(uuid) name: string remark?: string allowed_package_ids?: array<string(uuid)> quota_bytes: integer(int64) validity_days: integer expiry_timezone: string priority: integer currency: string price_minor: integer(int64) metering_scope: string metering_version: string created_at: string(date-time) enabled: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
408Read context was cancelled.
502Stored or core facts did not satisfy the public response contract.
503Read storage is unavailable.
504Read deadline expired.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/traffic-packages/products/{product_id}/archive

Remove a product from sale while preserving sold entitlements and history

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

全部需要:traffic_packages.manage

参数

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

响应

archiveTrafficPackageProduct 响应
状态码说明
200Immutable audited command receipt; identical retries return the same fact.

字段:id: string(uuid) target_id: string(uuid) operation: string: archive_product / enable_grant / disable_grant revision: integer replayed: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
409Idempotency, refund amount, grant-state, or bounded automatic-expiry backlog conflict. For traffic_package_expiry_backlog the original key replays the frozen result and a new caller-generated key advances at most the next 100 due grants.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/traffic-packages/products/{product_id}/disable

Disable a product

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

全部需要:traffic_packages.manage

说明(契约原文)

Appends a disabled lifecycle fact. Disabled products disappear from tenant current-product lists and cannot receive new grants; immutable revision history remains readable.

参数

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

响应

disableTrafficPackageProduct 响应
状态码说明
200Appended lifecycle fact or identical committed replay.

字段:product_id: string(uuid) product_revision: integer(int64) revision: integer(int64) sequence: integer(int64) enabled: boolean replayed: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
409Idempotency, refund amount, grant-state, or bounded automatic-expiry backlog conflict. For traffic_package_expiry_backlog the original key replays the frozen result and a new caller-generated key advances at most the next 100 due grants.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/traffic-packages/products/{product_id}/enable

Enable a product

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

全部需要:traffic_packages.manage

说明(契约原文)

Appends an enabled lifecycle fact. Reusing the same idempotency key and payload returns the original receipt; a changed payload returns 409.

参数

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

响应

enableTrafficPackageProduct 响应
状态码说明
200Appended lifecycle fact or identical committed replay.

字段:product_id: string(uuid) product_revision: integer(int64) revision: integer(int64) sequence: integer(int64) enabled: boolean replayed: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
409Idempotency, refund amount, grant-state, or bounded automatic-expiry backlog conflict. For traffic_package_expiry_backlog the original key replays the frozen result and a new caller-generated key advances at most the next 100 due grants.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/traffic-packages/products/{product_id}/revisions

List immutable product revision history

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

全部需要:traffic_packages.read

参数

listTrafficPackageProductRevisions 参数
名称位置类型必填说明
product_idpathstring(uuid)是—
limitqueryinteger否—
cursorquerystring否Opaque HMAC-signed cursor bound to endpoint, principal scope, target tenant, owner user, UTC-microsecond snapshot_at, and the applicable migration-066 catalog/usage snapshot_version or grant-state watermark.

响应

listTrafficPackageProductRevisions 响应
状态码说明
200Current products or immutable revision history.

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

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
408Read context was cancelled.
502Stored or core facts did not satisfy the public response contract.
503Read storage is unavailable.
504Read deadline expired.

失败时怎么办

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

↑ 回到列表

POST /v1/admin/traffic-packages/products/{product_id}/revisions

Create an immutable product revision

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

全部需要:traffic_packages.manage

说明(契约原文)

Publishes the next immutable revision with transactional platform IAM. The quoted If-Match value is the expected current revision (zero creates a new product). Reusing the same Idempotency-Key with the same canonical payload returns the original 201 receipt and Idempotency-Replayed: true; different input returns 409 and a stale expected revision returns 412.

参数

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

请求体

application/json · 必填:是

createTrafficPackageProductRevision 请求体
名称类型必填说明
audiencestring: global / tenant是—
owner_tenant_scope_idstring(uuid)否—
namestring是—
remarkstring否Maximum 1024 UTF-8 bytes; no control characters.
allowed_package_idsarray<string(uuid)>否Empty means all base packages. Restrictions are captured per immutable revision and checked for purchase and consumption.
quota_bytesinteger(int64)是—
validity_daysinteger是—
expiry_timezonestring是—
priorityinteger是—
currencystring是—
price_minorinteger(int64)是—
metering_scopestring是—
metering_versionstring是—
enabledboolean否Omit to retain current status; defaults to enabled for new products.

响应

createTrafficPackageProductRevision 响应
状态码说明
201New immutable revision or the identical committed replay.

字段:product_snapshot_id: string(uuid) product_id: string(uuid) revision: integer(int64) replayed: boolean

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
404Resource is absent or not visible in the authorized scope.
408Write result is unknown. Retry only with the same Idempotency-Key and identical payload.
409Idempotency, refund amount, grant-state, or bounded automatic-expiry backlog conflict. For traffic_package_expiry_backlog the original key replays the frozen result and a new caller-generated key advances at most the next 100 due grants.
412The quoted If-Match revision is stale.
502The command committed but its bounded receipt could not be delivered. Recover only by retrying the same Idempotency-Key and identical payload.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.
504Write result is unknown. Retry only with the same Idempotency-Key and identical payload.

失败时怎么办

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

↑ 回到列表

GET /v1/admin/traffic-packages/sold

List sold grants across tenants with server-side filters and count

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

全部需要:traffic_packages.read

参数

listSoldTrafficPackages 参数
名称位置类型必填说明
pagequeryinteger否—
limitqueryinteger否—
searchquerystring否User name
product_idquerystring(uuid)否—
statusquerystring: active / disabled / exhausted / expired / reversed否—

响应

listSoldTrafficPackages 响应
状态码说明
200Count and items use one database statement snapshot; pages reflect live state.

字段:items: array<SoldItem> total: integer page: integer limit: integer

400Malformed headers, query, JSON, UUID, cursor, unit, or range.
401Ordinary session authentication is required.
403Principal scope or required permission is absent.
503The stable error code distinguishes an unavailable dependency or authenticator (no write attempted) from an unknown or committed result. Unknown results require same-key, identical-payload recovery.

失败时怎么办

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

↑ 回到列表