List subscriptions
Lists the plans the caller holds, with the count beside them.
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 | billing.Subscriptions | ok |
default | problem-details | refused |
200 body — 28 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
count | body | integer (int64) | — | Count is the row count beside the rows, which is the shape this address has always answered with. |
subscriptions | body | billing.Subscription[] | — | |
subscriptions[].cancelAtPeriodEnd | body | boolean | — | CancelAtPeriodEnd reports that the plan ends at CurrentPeriodEnd. |
subscriptions[].canceledAt | body | string | — | CanceledAt is when it was canceled; absent when it was not. |
subscriptions[].chargedCents | body | integer (int64) | — | ChargedCents is what the period in hand was actually paid, after any discount and net of refunds. |
subscriptions[].createdAt | body | string | — | CreatedAt is when the row was written, RFC 3339. |
subscriptions[].currentPeriodEnd | body | string | — | CurrentPeriodEnd is when it ends, RFC 3339. |
subscriptions[].currentPeriodStart | body | string | — | CurrentPeriodStart is when the period in hand began, RFC 3339. |
subscriptions[].defaultPaymentMethod | body | string | — | DefaultPaymentMethod is the saved method a renewal would use. |
subscriptions[].endedAt | body | string | — | EndedAt is when it ended; absent while it runs. |
subscriptions[].id | body | string | — | ID is the subscription's own id, the one cancel and reactivate take. |
subscriptions[].mrrCents | body | integer (int64) | — | 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 from price and interval. |
subscriptions[].plan | body | billing.SubscriptionPlan | — | |
subscriptions[].plan.currency | body | string | — | Currency is the ISO code the price is in, lower-cased. |
subscriptions[].plan.id | body | string | — | ID is the plan row the subscription was opened on. |
subscriptions[].plan.interval | body | string | — | Interval is the billing period: "month" or "year". |
subscriptions[].plan.name | body | string | — | Name is the plan's display name, e.g. "Max 20x". |
subscriptions[].plan.price | body | integer (int64) | — | Price is what one period costs per seat, in cents, as the subscription snapshotted it: a later catalog price change does not move it. |
subscriptions[].planId | body | string | — | PlanID is the plan slug, e.g. "max-20x". |
subscriptions[].providerType | body | string | — | ProviderType is who collects it: a processor ("square"), "credit" for a plan bought with credits, "internal" or "bundle" for a row nobody paid for. |
subscriptions[].quantity | body | integer (int64) | — | Quantity is the seat count; a flat plan holds 1. |
subscriptions[].seats | body | integer (int64) | — | Seats is the seat count the period in hand was paid for — its paid invoice's quantity, or the quantity recorded with an external period — never the row's live Quantity, which the holder may change. |
subscriptions[].settled | body | string | — | Settled is how the period in hand was paid: "card" (a card paid all of it), "external:<processor>" (a payment recorded as collected outside commerce), "balance", "credit" or "mixed" (prepaid money). |
subscriptions[].status | body | string | — | Status is trialing, active, past_due, canceled or unpaid. |
subscriptions[].trialEnd | body | string | — | TrialEnd is when that trial ends; absent when there was none. |
subscriptions[].trialStart | body | string | — | TrialStart is when a trial began; absent when there was none. |
subscriptions[].updatedAt | body | string | — | UpdatedAt is when the row last changed, RFC 3339. |
subscriptions[].userId | body | string | — | UserID is the billing account that holds it: the org slug for an org's own plan, "<org>/<name>" for a member's. |
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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.BillingAPI.GetBillingSubscriptions(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::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.setBearerToken(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 39 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": "list_billing_accounts"
}
}
}'