List subscriptions

List the most recently created subscriptions for an account, with periods, prices, and entitlements, up to 1,000 entries.

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

Before you begin

  1. Prepare a valid personal access token for the account owner.

  2. Call List current accounts to obtain the target account’s ID.

Request example

Replace $MOI_PERSONAL_ACCESS_TOKEN and $ACCOUNT_ID in the example with your personal access token and the selected account’s ID.

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

Path parameters

Parameter

Type

Required

Description

accountID

string

Yes

Target account ID from items[].billing_account_id in the List current accounts response.

Successful response

Returns HTTP 200 with the account’s subscriptions; the list is empty when no subscriptions exist.

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

Field

Type

Description

items

array of object

Records ordered by creation time, newest first, up to 1,000.

items[].subscription_id

string

Subscription ID.

items[].billing_account_id

string

Billing account ID.

items[].product_code

string

Subscription product code.

items[].product_price_id

string

Product price ID.

items[].price_credit_per_month

string

Monthly subscription price in Credit, as a decimal string.

items[].status

string

Subscription status.

items[].current_period_start

string

Current subscription period start.

items[].current_period_end

string

Current subscription period end.

items[].next_charge_at

string

Next charge time.

items[].cancel_at_period_end

boolean

Whether cancellation is scheduled for the end of the current period.

items[].entitlement_version

integer

Entitlement version.

items[].entitlements

object

Product entitlements, with keys depending on the product.

items[].entitlements.enterprise_sso

boolean

Enterprise identity integration entitlement, when applicable.

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

string

Support priority. The period is part of the key.

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

boolean

Private model deployment entitlement, when applicable. Periods are part of the key.

items[].initial_charge_id

string

Initial charge ID; may be omitted.

items[].usage_event_id

string

Associated subscription usage event ID; may be omitted.

items[].charged_credit

string

Charged Credit; may be omitted.

items[].created_at

integer

Creation time in Unix seconds.

items[].updated_at

integer

Update time in Unix seconds.

total

integer

Number of returned records, up to 1,000.

In field paths, [] denotes each array item. For example, items[].subscription_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.

Last updated on