Php

Subscription Plans

Vatly PHP SDK - Subscription Plans

Subscription Plans

Subscription plans define recurring billing products. Create and manage plans in the Vatly dashboard, then use the API to retrieve them.

The Subscription Plan Resource

Below you'll find all properties for the Vatly Subscription Plan resource.

Properties

NameTypeDescription
idstringUnique identifier for the plan (plan_...).
namestringDisplay name of the plan.
description`stringnull`
amountintegerPrice in cents.
currencystringThree-letter ISO currency code.
intervalstringBilling interval: day, week, month, or year.
intervalCountintegerNumber of intervals between billings.
trialDays`integernull`
testmodeboolWhether this is a test plan.
statusstringThe status: approved, draft, or archived.
createdAtstringCreation timestamp (ISO 8601).

Retrieve a plan

GET /v1/subscription-plans/:id

Retrieve a subscription plan by its ID.

$plan = $vatly->subscriptionPlans->get('plan_abc123');

echo $plan->name;
echo $plan->amount / 100 . ' ' . $plan->currency;
echo $plan->interval;

List all plans

GET /v1/subscription-plans

Retrieve a paginated list of all subscription plans.

Optional attributes

NameTypeDescription
limitintegerThe number of plans to return (default: 10, max: 100).
startingAfterstringA cursor for pagination.
$plans = $vatly->subscriptionPlans->list();

foreach ($plans as $plan) {
    echo $plan->name . ': ' . ($plan->amount / 100) . ' ' . $plan->currency;
}
Copyright © 2026