Moonborn — API · billing
Fetch the caller org's active subscription
Returns the active subscription for the caller org. Free orgs return a synthetic `free` snapshot with `subscriptionId = "sub_free_<orgId>"` and no Stripe-backed identifiers.
GET/v1/billing/subscriptionscope · Bearer (API key or session JWT)
Responses
200OK
Body
| Field | Type | Description |
|---|---|---|
| subscriptionIdreq | string | |
| orgIdreq | string | |
| planTierreq | string · "free" | "pro" | "team" | "enterprise" | |
| statusreq | string · "trialing" | "active" | "past_due" | "canceled" | "incomplete" | "unpaid" | |
| intervalreq | string · "month" | "year" | |
| currencyreq | string | |
| recurringAmountMinorreq | number | |
| trialEndsAtreq | string | |
| currentPeriodStartreq | string | |
| currentPeriodEndreq | string | |
| cancelAtPeriodEndreq | boolean | |
| createdAtreq | string | |
| updatedAtreq | string |
401Unauthenticated
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
404No subscription row found (rare; org seed missing)
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X GET https://api.moonborn.co/v1/billing/subscription \ -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.billing.getSubscription();Python
import os from moonborn import Moonborn client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"]) result = client.billing.get_subscription()