Owostack

plans()

List and retrieve plans for your organization

plans()

Query your organization's plans programmatically. Useful for building pricing pages, plan selection UIs, and dynamic upgrade flows.

owo.plans(params?)

List all active plans for the organization. Supports filtering by group, interval, and currency.

const { plans } = await owo.plans();

for (const plan of plans) {
  console.log(plan.name, plan.price, plan.currency);
}

Parameters

ParameterTypeRequiredDescription
params.groupstringNoFilter by plan group (e.g. "support")
params.intervalPlanIntervalNoFilter by billing interval (e.g. "monthly")
params.currencystringNoFilter by currency code (e.g. "USD")
params.includeInactivebooleanNoInclude inactive plans (default: false)

Returns Promise<PlansResult>

interface PlansResult {
  success: boolean;
  plans: PublicPlan[];
}

Filtering examples

// Only monthly plans
const { plans: monthly } = await owo.plans({ interval: "monthly" });

// Only plans in the "support" group
const { plans: support } = await owo.plans({ group: "support" });

// Only USD plans
const { plans: usd } = await owo.plans({ currency: "USD" });

// Combine filters
const { plans: filtered } = await owo.plans({
  group: "support",
  interval: "monthly",
  currency: "USD",
});

owo.plans.get(slug)

Retrieve a single plan by its slug.

const plan = await owo.plans.get("pro-monthly");

console.log(plan.name); // "Pro"
console.log(plan.price); // 500000
console.log(plan.features); // [{ slug: "api-calls", limit: 50000, ... }]

Parameters

ParameterTypeRequiredDescription
slugstringYesThe plan slug

Returns Promise<PublicPlan>


Response types

PublicPlan

interface PublicPlan {
  id: string;
  slug: string;
  name: string;
  description: string | null;
  price: number; // Minor currency units (e.g. kobo, cents)
  currency: string;
  interval: PlanInterval; // "monthly" | "yearly" | "weekly" | "quarterly"
  type: string; // "free" | "paid"
  billingType: string; // "recurring" | "one_time"
  isAddon: boolean;
  planGroup: string | null;
  trialDays: number;
  features: PublicPlanFeature[];
}

PublicPlanFeature

interface PublicPlanFeature {
  slug: string;
  name: string;
  type: "metered" | "boolean" | "static";
  enabled: boolean;
  limit: number | null; // null = unlimited
  trialLimit?: number | null; // limit during trial period
  resetInterval: string | null;
  unit: string | null; // "call", "message", "GB", etc.
  usageModel?: "included" | "usage_based" | "prepaid";
  pricePerUnit?: number | null;
  billingUnits?: number | null;
  ratingModel?: "package" | "graduated" | "volume";
  tiers?: Array<{
    upTo: number | null;
    unitPrice: number;
    flatFee?: number;
  }> | null;
  overage?: "block" | "charge";
  overagePrice?: number | null;
}

usageModel, ratingModel, and tiers let you render richer pricing pages from your live catalog without hardcoding volumetric pricing rules in the app.

On this page

AI Chat

Owostack docs assistant

Start a new chat below.