v4

latestOpenAPI 3.1.02026-08-03427198448.4 KB

Get Org Subscription

Fetch the billing subscription for the authenticated user's organization.

This endpoint requires authentication and uses the org_id from the user's session. Returns subscription data including trial dates, status, plan details, and subscription items.

Args: request: FastAPI request object user_id: User ID (injected by @require_auth) org_id: Organization ID (injected by @require_auth)

Returns: Dictionary containing: - status: Subscription status (e.g., "trialing", "active", "past_due") - trial_starts_at: ISO 8601 timestamp when trial started (if applicable) - trial_ends_at: ISO 8601 timestamp when trial ends (if applicable) - plan_id: ID of the billing plan - plan_name: Name of the billing plan - subscription_items: List of subscription item details - server_time: Current server time in ISO 8601 format

Raises: HTTPException: If org_id is missing or subscription cannot be fetched

get/api/billing/org-subscription

Query parameters

user_idstring
org_idstring

Response

Successful Response

object required