查询账户概览¶
查询账户的可用 Credit、预留额度、透支额和近期消费。
GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/overview
调用前准备¶
请求示例¶
将示例中的 $MOI_PERSONAL_ACCESS_TOKEN 和 $ACCOUNT_ID 分别替换为个人访问令牌和所选账户的 ID。
curl -X GET \
"https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/overview" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
路径参数¶
参数 |
类型 |
是否必填 |
说明 |
|---|---|---|---|
|
string |
是 |
目标账户的 ID,取自“查询当前账户”响应中的 |
成功响应¶
请求成功时返回 HTTP 200 和账户的 Credit 余额、可用额度和近期消费。
{
"billing_account_id": "billing_account_example",
"credit_balance": "100.000000000000",
"credit_available": "90.000000000000",
"credit_reserved": "10.000000000000",
"credit_cash_balance": "80.000000000000",
"credit_grant_balance": "20.000000000000",
"credit_overdraft_balance": "0.000000000000",
"outstanding_credit": "0.000000000000",
"today_spend_credit": "1.000000000000",
"month_spend_credit": "5.000000000000",
"last_month_spend_credit": "20.000000000000",
"estimated_days_remaining": "90",
"billing_timezone": "Asia/Shanghai"
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
Billing 账户 ID。 |
|
string |
Credit 余额。 |
|
string |
可用 Credit。 |
|
string |
已预留的 Credit。 |
|
string |
充值 Credit 余额。 |
|
string |
赠送 Credit 余额。 |
|
string |
透支钱包余额。 |
|
string |
待偿还的透支 Credit。 |
|
string |
计费时区当日已扣费 Credit。 |
|
string |
计费时区本月已扣费 Credit。 |
|
string |
计费时区上月已扣费 Credit。 |
|
string |
按最近 7 天平均消费估算的可用天数;可用额度或消费不足以计算时返回 0。 |
|
string |
计算日、月消费的 IANA 时区。 |
错误响应¶
缺少认证信息时返回 HTTP 401,请提供有效的个人访问令牌。
{
"code": "unauthenticated",
"message": "missing bearer token",
"error": "missing bearer token"
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
错误代码。 |
|
string |
错误说明。 |
|
string |
兼容错误说明,与 message 内容相同。 |