Get Started

Billing Data Structures

All data structures used in the Billing API endpoint.

View API:Billing API

Billing Info

Workspace billing information

Billing Info

object

Workspace billing information

workspaceIdstringrequired

Unique workspace identifier

planPlanrequired
planStatusPlanStatusrequired
stripeCustomerIdstring | null

Stripe customer ID if billing is set up

stripeSubscriptionIdstring | null

Stripe subscription ID if subscription exists

createdAtstring (date-time)required

ISO 8601 timestamp of when the workspace was created

Billing Response

Billing Response in snake_case format

Billing Response

object

Billing Response in snake_case format

Plan

Subscription plan tier

Plan

string

Subscription plan tier

startergrowthscaleagency

Plan Status

Plan status

Plan Status

string

Plan status

activeinactivetrial

Subscription Status

Live subscription status from Stripe

Subscription Status

object

Live subscription status from Stripe

workspaceIdstringrequired

Unique workspace identifier

planPlanrequired
stripeStatusstringrequired

Stripe subscription status (e.g., active, canceled, past_due, etc.)

Example: "active"

nextBillingDatestring (date-time) | null

Next billing date in ISO 8601 format

cancelAtPeriodEndbooleanrequired

Whether the subscription is set to cancel at the end of the current period

trialEndstring (date-time) | null

Trial end date in ISO 8601 format, if applicable

currentPeriodEndstring (date-time) | null

Current billing period end date in ISO 8601 format

stripeCustomerIdstring | null

Stripe customer ID

stripeSubscriptionIdstring | null

Stripe subscription ID

interface BillingInfo {
  /** Unique workspace identifier */
  workspaceId: string;
  plan: Plan;
  planStatus: PlanStatus;
  /** Stripe customer ID if billing is set up */
  stripeCustomerId?: string;
  /** Stripe subscription ID if subscription exists */
  stripeSubscriptionId?: string;
  /** ISO 8601 timestamp of when the workspace was created */
  createdAt: string;
}

interface BillingResponse {
  billing_info: BillingInfo;
  subscription_status: SubscriptionStatus;
}

type Plan = "starter" | "growth" | "scale" | "agency";

type PlanStatus = "active" | "inactive" | "trial";

interface SubscriptionStatus {
  /** Unique workspace identifier */
  workspaceId: string;
  plan: Plan;
  /** Stripe subscription status (e.g., active, canceled, past_due, etc.) */
  stripeStatus: string;
  /** Next billing date in ISO 8601 format */
  nextBillingDate?: string;
  /** Whether the subscription is set to cancel at the end of the current period */
  cancelAtPeriodEnd: boolean;
  /** Trial end date in ISO 8601 format, if applicable */
  trialEnd?: string;
  /** Current billing period end date in ISO 8601 format */
  currentPeriodEnd?: string;
  /** Payment method information */
  paymentMethod?: {
  type?: string;
  last4?: string;
  brand?: string;
};
  /** Stripe customer ID */
  stripeCustomerId?: string;
  /** Stripe subscription ID */
  stripeSubscriptionId?: string;
}