List current accounts

List Billing accounts accessible to the current user and their Credit balances. On the first query, the service provisions the Billing account from the current user identity.

GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/current

Before you begin

Prepare a valid personal access token.

Request example

Replace $MOI_PERSONAL_ACCESS_TOKEN in the example with your personal access token.

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

Successful response

Returns HTTP 200 with the Billing accounts accessible to the current user and their Credit balances.

{
  "items": [
    {
      "billing_account_id": "billing_account_example",
      "owner_type": "uc_account",
      "owner_id": "owner_example",
      "display_name": "Example account",
      "region": "cn",
      "status": "active",
      "default_currency": "CNY",
      "credit_balance": "100.000000000000",
      "credit_cash_balance": "80.000000000000",
      "credit_grant_balance": "20.000000000000",
      "credit_reserved": "10.000000000000",
      "credit_available": "90.000000000000",
      "credit_overdraft_balance": "0.000000000000",
      "risk_level": "normal",
      "created_at": 1788739200,
      "updated_at": 1788739200
    }
  ],
  "total": 1
}

Field

Type

Description

items

array of object

Records returned by this request.

items[].billing_account_id

string

Billing account ID.

items[].owner_type

string

Account owner type.

items[].owner_id

string

Account owner ID.

items[].display_name

string

Account display name.

items[].region

string

Account region.

items[].status

string

Account status.

items[].default_currency

string

Default payment currency.

items[].credit_balance

string

Credit balance.

items[].credit_cash_balance

string

Cash Credit balance.

items[].credit_grant_balance

string

Granted Credit balance.

items[].credit_reserved

string

Reserved Credit.

items[].credit_available

string

Available Credit.

items[].credit_overdraft_balance

string

Overdraft wallet balance.

items[].risk_level

string

Account risk level.

items[].status_reason

string

Account status reason, when available.

items[].suspended_at

integer

Suspension time in Unix seconds, when available.

items[].closed_at

integer

Closure time in Unix seconds, when available.

items[].created_at

integer

Creation time in Unix seconds.

items[].updated_at

integer

Update time in Unix seconds.

total

integer

Total number of returned records.

In field paths, [] denotes each array item. For example, items[].billing_account_id refers to the corresponding field in each item.

Error response

Missing authentication returns HTTP 401; provide a valid personal access token.

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

Field

Type

Description

code

string

Error code.

message

string

Error message.

error

string

Compatibility error message, with the same content as message.

Select an account

Select an account from items and retain its billing_account_id for account-scoped queries.

Use that account ID to get account overview or get billing settings.

Last updated on