App öffnen
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
FieldTypeDescription
subscriptionIdreqstring
orgIdreqstring
planTierreqstring · "free" | "pro" | "team" | "enterprise"
statusreqstring · "trialing" | "active" | "past_due" | "canceled" | "incomplete" | "unpaid"
intervalreqstring · "month" | "year"
currencyreqstring
recurringAmountMinorreqnumber
trialEndsAtreqstring
currentPeriodStartreqstring
currentPeriodEndreqstring
cancelAtPeriodEndreqboolean
createdAtreqstring
updatedAtreqstring
401Unauthenticated
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
404No subscription row found (rare; org seed missing)
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

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()