查询订阅列表

查询账户最近创建的订阅及其周期、价格和权益,最多返回 1000 条。

GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/subscriptions

调用前准备

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

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

请求参数

将示例中的 $ACCOUNT_ID、$MOI_PERSONAL_ACCESS_TOKEN 替换为实际值。

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

参数

类型

是否必填

说明

accountID

string

是

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

成功响应

{
  "items": [],
  "total": 0
}

字段

类型

说明

items

array of object

按创建时间从新到旧返回的记录,最多 1000 条。

items[].subscription_id

string

订阅 ID。

items[].billing_account_id

string

计费账户 ID。

items[].product_code

string

订阅产品代码。

items[].product_price_id

string

产品价格 ID。

items[].price_credit_per_month

string

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

items[].status

string

订阅状态。

items[].current_period_start

string

当前订阅周期起点。

items[].current_period_end

string

当前订阅周期终点。

items[].next_charge_at

string

下一次扣费时间。

items[].cancel_at_period_end

boolean

是否在当前周期结束时取消。

items[].entitlement_version

integer

权益版本号。

items[].entitlements

object

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

items[].entitlements.enterprise_sso

boolean

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

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

string

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

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

boolean

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

items[].initial_charge_id

string

首次扣费记录 ID,可能省略。

items[].usage_event_id

string

订阅关联的用量事件 ID,可能省略。

items[].charged_credit

string

已扣费 Credit,可能省略。

items[].created_at

integer

创建时间,Unix 秒。

items[].updated_at

integer

更新时间,Unix 秒。

total

integer

本次返回的记录数,最多 1000。

错误响应

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

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

字段

类型

说明

code

string

错误代码。

message

string

错误说明。

error

string

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

最后更新于