Skip to content

Get Subscription

GET
/api/billing/subscription

An org’s per-product entitlement state plus month-to-date usage.

Entitlement state is dunning-ladder normalized (_normalize_entitlement_state, app/core/deps.py) rather than the raw DB value, so this endpoint can never show a stale trial/grace row that the sweep job (entitlement_sweep.py) hasn’t persisted yet — same posture as RequireEntitlement.

Usage covers every (product, meter) with at least one organization_usage_counters row this UTC calendar month; limit is the trial monthly ceiling (app/config.py’s billing_trial_* settings, via ingest_gate._trial_limit — the exact function the ingest gate itself enforces against) when the product is currently in trial state, and None/omitted otherwise — a paid org has no hard ceiling on that meter, only a billed overage.

Authorizations

Parameters

Query Parameters

organization_id
required
string format: uuid

Responses

200

Successful Response

GET /api/billing/subscription — org-scoped entitlement + usage summary.

object
entitlements
required
Array<object>

One product’s current entitlement state for an organization.

object
plan_code
Any of:
string
product
required
string
state
required
string
trial_ends_at
Any of:
string format: date-time
organization_id
required
string format: uuid
usage
required
Array<object>

Month-to-date usage for one (product, meter) with any activity this month.

object
limit
Any of:
integer
meter
required
string
month_to_date
required
integer
period_resets_at
required
string format: date-time
product
required
string

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string