Billing Data Structures
All data structures used in the Billing API endpoint.
Billing Info
Workspace billing information
Billing Info
objectWorkspace billing information
workspaceIdstringrequiredUnique workspace identifier
planPlanrequiredplanStatusPlanStatusrequiredstripeCustomerIdstring | nullStripe customer ID if billing is set up
stripeSubscriptionIdstring | nullStripe subscription ID if subscription exists
createdAtstring (date-time)requiredISO 8601 timestamp of when the workspace was created
Billing Response
Billing Response in snake_case format
Billing Response
objectBilling Response in snake_case format
Plan
Subscription plan tier
Plan
stringSubscription plan tier
Plan Status
Plan status
Plan Status
stringPlan status
Subscription Status
Live subscription status from Stripe
Subscription Status
objectLive subscription status from Stripe
workspaceIdstringrequiredUnique workspace identifier
planPlanrequiredstripeStatusstringrequiredStripe subscription status (e.g., active, canceled, past_due, etc.)
Example: "active"
nextBillingDatestring (date-time) | nullNext billing date in ISO 8601 format
cancelAtPeriodEndbooleanrequiredWhether the subscription is set to cancel at the end of the current period
trialEndstring (date-time) | nullTrial end date in ISO 8601 format, if applicable
currentPeriodEndstring (date-time) | nullCurrent billing period end date in ISO 8601 format
stripeCustomerIdstring | nullStripe customer ID
stripeSubscriptionIdstring | nullStripe 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;
}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;
}