List subscriptions
Lists the plans the caller holds, with the count beside them. It is scoped to the caller's own org, so a query cannot widen it to another customer's.
GET /v1/billing/subscriptions
| Address | https://api.hanzo.ai/v1/billing/subscriptions |
| Method | GET |
| Operation | get_billing_subscriptions |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Lists the plans the caller holds, with the count beside them.
It is scoped to the caller's own org, so a query cannot widen it to another customer's. An org on nothing is an empty list, not a refusal — being on no plan is an answer.
A named handler, not a closure, so zipdoc can lift this prose into the registry.
Request
GET /v1/billing/subscriptions takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | Subscriptions | ok |
200 body — 25 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
count | body | integer | — | Count is the row count beside the rows, which is the shape this address has always answered with. |
subscriptions | body | Subscription[] | — | |
subscriptions[].cancelAtPeriodEnd | body | boolean | — | |
subscriptions[].canceledAt | body | string | — | |
subscriptions[].createdAt | body | string | — | |
subscriptions[].currentPeriodEnd | body | string | — | |
subscriptions[].currentPeriodStart | body | string | — | |
subscriptions[].defaultPaymentMethod | body | string | — | |
subscriptions[].endedAt | body | string | — | |
subscriptions[].id | body | string | — | |
subscriptions[].mrrCents | body | integer | — | MRRCents is what this subscription contributes per month — commerce's own figure, interval-normalized and multiplied by its seats, so no reader re-derives it… |
subscriptions[].plan | body | SubscriptionPlan | — | |
subscriptions[].plan.currency | body | string | — | |
subscriptions[].plan.id | body | string | — | |
subscriptions[].plan.interval | body | string | — | |
subscriptions[].plan.name | body | string | — | |
subscriptions[].plan.price | body | integer | — | |
subscriptions[].planId | body | string | — | |
subscriptions[].providerType | body | string | — | |
subscriptions[].quantity | body | integer | — | |
subscriptions[].status | body | string | — | |
subscriptions[].trialEnd | body | string | — | |
subscriptions[].trialStart | body | string | — | |
subscriptions[].updatedAt | body | string | — | |
subscriptions[].userId | body | string | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo billing subscriptions listimport { Configuration, BillingApi } from 'hanzoai';
const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBillingSubscriptions();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BillingApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BillingApi(client).get_billing_subscriptions()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BillingAPI.GetBillingSubscriptions(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, billing_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = billing_api::get_billing_subscriptions(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BillingApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new BillingApi(client).getBillingSubscriptions();curl https://api.hanzo.ai/v1/billing/subscriptions \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches billing through the billing tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_billing_balance"
}
}
}'How is this guide?