Vatly
JavaScript SDK

Subscription Plans

Subscription plans define recurring products, prices, and billing intervals.

Subscription plans define recurring products, prices, and billing intervals. The API supports creation, updates, archive and unarchive.

For all fields and options, see the Subscription Plans API reference. The OpenAPI spec is also available for tooling.

The Subscription Plan resource

NameTypeDescription
idstringUnique identifier (subscription_plan_…).
resourcestringAlways subscription_plan.
namestringDisplay name.
descriptionstring | nullOptional description.
basePriceMoneyPrice per interval, e.g. { value: "29.00", currency: "EUR" }.
interval / intervalCountstring / numberBilling cadence (e.g. month × 1).
statusstringactive, pending, or rejected. Archive state is separate in archivedAt.
createdAtstringCreation timestamp (ISO 8601).
testmodebooleanWhether this is a test plan.

Retrieve a subscription plan

GET /v1/subscription-plans/{subscriptionPlanId}

const plan = await vatly.subscriptionPlans.get("subscription_plan_abc123");
console.log(plan.basePrice.value, plan.basePrice.currency);

List subscription plans

GET /v1/subscription-plans

const page = await vatly.subscriptionPlans.list({ limit: 25 });

for await (const plan of vatly.subscriptionPlans.listAll()) {
  // ...
}

To sell a plan, pass its id in a checkout's products.

Create, update and archive

const plan = await vatly.subscriptionPlans.create({
  name: "Pro Monthly", description: "Pro features", productType: "saas",
  basePrice: { value: "29.00", currency: "EUR" }, interval: "month", intervalCount: 1,
});
await vatly.subscriptionPlans.update(plan.id, { interval: "week", intervalCount: 2 });
await vatly.subscriptionPlans.archive(plan.id); // 204: no return value
const restored = await vatly.subscriptionPlans.unarchive(plan.id);
const all = await vatly.subscriptionPlans.list({ includeArchived: true });

New prices are EUR-only. taxBehavior defaults to exclusive and is immutable. Plans sell saas only; day intervals are test-mode-only. Creation and updates may require approval; inspect status, pendingUpdates, and updateStatus.

Copyright © 2026