查询订阅产品

查询订阅产品、每月 Credit 价格和产品权益。

GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/subscription-products

调用前准备

  1. 准备计费账户所属用户的有效个人访问令牌

  2. 调用查询当前账户接口,获取目标账户的 ID。

请求示例

将示例中的 $MOI_PERSONAL_ACCESS_TOKEN$ACCOUNT_ID 分别替换为个人访问令牌和所选账户的 ID。

curl -X GET \
  "https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/subscription-products" \
  -H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"

路径参数

参数

类型

是否必填

说明

accountID

string

目标账户的 ID,取自“查询当前账户”响应中的 items[].billing_account_id

成功响应

请求成功时返回 HTTP 200 和可用的订阅产品及其价格和权益。

{
  "items": [
    {
      "product_code": "enterprise_sso",
      "plan_code": "enterprise_identity",
      "name": "Enterprise Identity",
      "description": "SSO/SAML integration for enterprise identity management.",
      "product_price_id": "price_example",
      "price_credit_per_month": "300.000000000000",
      "currency": "CREDIT",
      "status": "active",
      "entitlement_version": 1,
      "entitlements": {
        "enterprise_sso": true,
        "support.priority": "priority"
      },
      "sort_order": 30
    }
  ],
  "total": 1
}

字段

类型

说明

items

array of object

本次返回的记录。

items[].product_code

string

订阅产品代码。

items[].plan_code

string

套餐代码,可能省略。

items[].name

string

产品名称。

items[].description

string

产品说明,可能省略。

items[].product_price_id

string

产品价格 ID。

items[].price_credit_per_month

string

每月订阅价格,单位为 Credit,以十进制字符串返回。

items[].currency

string

价格单位,返回 CREDIT

items[].status

string

产品状态。

items[].entitlement_version

integer

权益版本号。

items[].entitlements

object

产品权益,键按产品返回。

items[].entitlements.enterprise_sso

boolean

企业身份集成权益,适用时返回。

items[].entitlements["support.priority"]

string

支持优先级。键名包含句点。

items[].entitlements["model.private.deploy"]

boolean

私有模型部署权益,适用时返回。键名包含句点。

items[].sort_order

integer

产品展示排序值。

total

integer

返回的总记录数。

字段路径中的 [] 表示数组中的每一项。例如,items[].product_code 表示数组中每一项的对应字段。

错误响应

缺少认证信息时返回 HTTP 401,请提供有效的个人访问令牌。

{
  "code": "unauthenticated",
  "message": "missing bearer token",
  "error": "missing bearer token"
}

字段

类型

说明

code

string

错误代码。

message

string

错误说明。

error

string

兼容错误说明,与 message 内容相同。

最后更新于