Payments & Subscriptions > Paystack Subscription Plans
Payments & Subscriptions > Paystack Subscription PlansKroxt BaaS SDK v1.0.5

Paystack Subscription Plans

Create and manage recurring subscription plans programmatically using the Kroxt SDK or directly inside the Kroxt Console. Created plans automatically sync with Paystack's Plan API (PLN_xxx).

1. Create a Subscription Plan

Call baas.payment.createPlan(options):

create-plan.ts
1
2
3
4
5
6
7
8
9
10
const plan = await baas.payment.createPlan({
  name: "Pro Monthly Subscription",
  amount: 1000000, // 10,000 NGN in kobo
  interval: "monthly", // "hourly" | "daily" | "weekly" | "monthly" | "quarterly" | "biannually" | "annually"
  currency: "NGN",
  description: "Access to all premium features and unlimited storage",
});

console.log("Plan Code:", plan.planCode); // e.g. PLN_v83k1sa
console.log("Plan Name:", plan.name);
Plan PropertyTypeDescription
namestringDisplay name for the subscription plan. Required.
amountnumberRecurring charge amount in minor units (kobo). Required.
intervalstringBilling interval: "hourly" | "daily" | "weekly" | "monthly" | "quarterly" | "biannually" | "annually". Required.
currencystringPlan currency code (defaults to "NGN").
descriptionstringSummary description of what the plan includes.

2. List All Subscription Plans

Call baas.payment.listPlans():

list-plans.ts
1
2
3
4
const plans = await baas.payment.listPlans();
plans.forEach((p) => {
  console.log(`Plan: ${p.name} (${p.planCode}) - ${p.currency} ${p.amount / 100}/${p.interval}`);
});