List subscriptions
const url = 'http://localhost:8080/v1/subscriptions?sort=created_at&dir=desc&limit=50&offset=0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/v1/subscriptions?sort=created_at&dir=desc&limit=50&offset=0' \ --header 'Authorization: Bearer <token>'Lists the subscriptions of this account and mode, newest first unless you sort otherwise. The filters combine.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only this customer’s subscriptions (hc_).
Only the subscriptions on this plan now (plan_id; a scheduled change does not count).
Exact status. Any other value is a 422 with param: status.
failing returns only subscriptions that carry a
billing_: those waiting for their next billing attempt
and those that are parked (set aside after eight failed billing
attempts, until someone retries them). Any other value is a 422 with
param: billing.
Case-insensitive substring match on display name or code.
The order of the list. created_ (the default),
next_, status or display_ (or name). Any
other value is a 422 with param: sort. Ties
are broken by id in the same direction.
Example
created_atSort direction: desc (the default) or asc, in lower case. Any
other value is a 422 with param: dir.
Example
descRows per page, from 1 to 100. Default 50. Any other value, one that
is not a whole number, or limit sent twice is a 422 with
param: limit. It is never clamped.
Rows to skip, 0 or more. Default 0. A negative value, one that is
not a whole number, or offset sent twice is a 422 with
param: offset.
Responses
Section titled “Responses”Subscription list
object
A customer’s subscription: the plan it bills, a plan change
scheduled for the end of the current period, its status and its
current billing period. Every route under / that
returns a subscription returns this object.
A subscription bills in one currency, the currency of its plan. A
customer who needs two plans has two subscriptions. A customer has
at most one active subscription on a plan, and two may not bill
the same meter. Usage, and a base fee billed in arrears, are
invoiced when a period
ends. A base fee billed in advance is invoiced when its period
starts: the first one in the same transaction that creates the
subscription, each later one on the invoice that closes the period
before.
object
The subscription’s ID (hc_).
The account the subscription belongs to.
Your code for the subscription: letters, digits, hyphens and underscores. Unique in your account and mode (live or test).
The subscription’s name, as shown in the dashboard.
The customer the subscription bills (hc_).
The plan the subscription bills now (hc_): its base fee
and its usage prices. A scheduled plan change shows in
pending_ until it takes effect. Absent only on a
canceled subscription that an earlier release left with no plan.
The plan the subscription moves to at
pending_ (hc_). Absent when no change
is scheduled.
When the scheduled plan change takes effect: the end of the period in which it was scheduled. Absent when no change is scheduled.
Where the subscription is in its life.
active: billing, from the start of the day it is created (in the account’s time zone). Usage and base fees billed in arrears are invoiced when each period ends; a base fee billed in advance when its period starts.canceled: ended atcanceled_. It bills nothing more, and no route makes itat activeagain. A subscription canceled before it started has nostarted_and no billing period.at
How monthly periods line up. The first period starts on the day
the subscription is created.
calendar: every period ends on the 1st of a month, in your
account’s billing time zone, so the first period runs from that
day to the next 1st. anniversary: each period starts on the
same day of the month as the first one (the last day of a
shorter month). A plan billed yearly always bills a year from
that first day, whatever this says.
The moment the subscription was created. Its first period, and the usage it bills, start at the beginning of that day in the account’s time zone. A subscription that an earlier release activated from a draft has the moment of that activation instead.
When the subscription was canceled. Absent until then.
True when the subscription cancels at the end of the current period. False after the subscription is canceled.
When a scheduled cancel takes effect: with
cancel_, current_. Absent
when no cancel is scheduled.
Start of the current billing period, the beginning of a day in your account’s billing time zone. On a canceled subscription it keeps its last value.
End of the current period (exclusive): the start of the next one. On a canceled subscription it keeps its last value.
The current period as text, with the last day included, in your account’s billing time zone, for example “Oct 1, 2026 – Oct 31, 2026”. Absent when the subscription has no current period, or when the time zone could not be read.
When the current period’s invoice is due to be built: the end of the current period. The billing run builds it once the invoice grace after that time has passed. A canceled subscription keeps its last value, and nothing is billed at that time.
Day of the month the subscription bills on (1-31): the day its first period started, or the day an earlier release switched it to a plan with another billing interval. Absent for calendar-monthly subscriptions.
Present on a subscription while the billing run is failing on the
work that subscription has due now: the close of its current period,
which also cancels it when a cancel is scheduled. Absent otherwise: a
subscription that bills cleanly, or whose due work changed, carries
no billing_.
After each failed attempt the billing run waits before the next one:
15 minutes, 1 hour, 4 hours, 12 hours, then 24 hours three times.
The eighth failure parks the subscription (parked: true, no
next_). A parked subscription is not attempted again
until POST / is called.
object
Failed attempts on the work that is due now. At least 1.
The attempt at which the subscription parks (8).
Why the latest attempt failed: a sentence an operator can act on, or a generic line carrying the subscription id as the reference to search the server log for. Never raw error text.
When the latest attempt failed.
The billing run does not attempt the subscription before this instant. The attempt happens on the first run at or after it, so on an hourly schedule it can be up to an hour later. Absent when parked.
True when automatic attempts have stopped.
When the subscription was created.
When the subscription last changed.
How many rows match the request’s filters, on every page, not only this one. The audit log and the customer list’s search and name or email sort say where they stop counting.
Example
{ "data": [ { "id": "hc_sub_dauq502q3gpgqfoq5c2g", "tenant_id": "hc_ten_dajqj02q3gpgqfoq5c00", "code": "acme-pro", "display_name": "Acme Pro", "customer_id": "hc_cus_dakhnk2q3gpgqfoq5c0g", "plan_id": "hc_pln_dajr5o2q3gpgqfoq5c1g", "status": "active", "billing_time": "calendar", "started_at": "2026-10-01T09:12:44Z", "cancel_at_period_end": false, "current_billing_period_start": "2026-10-01T00:00:00Z", "current_billing_period_end": "2026-11-01T00:00:00Z", "current_billing_period_display": "Oct 1, 2026 – Oct 31, 2026", "next_billing_at": "2026-11-01T00:00:00Z", "created_at": "2026-10-01T09:12:44Z", "updated_at": "2026-10-01T09:12:44Z" } ], "total": 1}No valid credential: the API key or session is missing, wrong,
expired or revoked. With no API key and no valid session cookie, the
message starts with missing credentials. A wrong, expired and
revoked key all get the same message, invalid or expired API key.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "unauthorized", "message": "invalid or expired API key", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}The credential is valid but may not call this route. A usage-only
key (hc_) can only send usage, read a customer’s live
credit balance and call GET /; use a secret key. The message names the permission the key
lacks. A browser request that would change data (POST, PUT, PATCH
or DELETE) from a page on another site gets this 403 too, with the
message cross-site request blocked.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "forbidden", "message": "insufficient permissions: this key type does not have customer:read access", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}Code validation_. A status, billing or collection
filter the API does not know, limit or offset out of range
or not a whole number, the removed after cursor, or a sort or
dir that is not one of its values. param names it, and for
the filters, sort and dir the message lists the allowed
values.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "invalid_request_error", "code": "validation_error", "message": "status must be one of active, canceled", "request_id": "req_dbjg652q3gpgqfoq5cd0", "param": "status" }}Too many requests. Wait for the number of seconds in Retry-After,
then retry. The answers that pass the limit carry the
X-RateLimit-* headers too.
Each API key has its own limit, by default 1,000 requests a minute
(HARDCOUNT_), and 1,000 a second on the
usage routes (HARDCOUNT_). The dashboard
sessions of one account share one limit per mode. The routes under
/ and / (sign-in, password reset, invite
accept, setup) count per client address, by default 100 a minute
(HARDCOUNT_). The public invoice,
payment-update and cost-dashboard pages allow 60 a minute per client
address.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "rate_limit_error", "code": "rate_limited", "message": "too many requests — please retry after the rate limit resets", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}Headers
Section titled “Headers”Example
12Seconds to wait before the next request can pass, rounded up to a whole second and at least 1.
Example
1000How many requests the limit allows in its period (a minute, or a second on the usage routes).
Example
0How many requests are left in the current period.
Example
1793870460When the whole limit is available again, as Unix seconds. One
request may pass sooner; Retry-After says when.
Stuck, or found a bug? Ask in Discussions · Open an issue