Vatly
Php

Subscription Plans

Vatly PHP SDK - Subscription Plans

Subscription plans define recurring billing products. Create them in the Vatly dashboard or through the API, then use them in checkouts. Live plans are reviewed and approved by Vatly before they can be added to checkouts.

The Subscription Plan Resource

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

Properties

NameTypeDescription
idstringUnique identifier for the plan (subscription_plan_...).
namestringDisplay name of the plan.
descriptionstring | nullDescription of the plan.
basePriceMoneyPrice per interval as a Money object — read ->value (decimal string) and ->currency (ISO 4217 code).
intervalstringBilling interval: day, week, month, or year.
intervalCountintegerNumber of intervals between billings.
testmodeboolWhether this is a test plan.
statusstringThe status: active (subscribable), pending (awaiting approval), or rejected.
createdAtstringCreation timestamp (ISO 8601).

Create a plan

POST /v1/subscription-plans

Create a subscription plan. A plan created with a live_ token starts in pending status and must be approved by Vatly before it can be added to checkouts; a plan created with a test_ token is auto-approved (active).

Required attributes

NameTypeDescription
namestringDisplay name (3–255 characters).
descriptionstringDetailed description of the plan.
basePricearrayPrice per interval as ['value' => '29.00', 'currency' => 'EUR'].
productTypestringTax classification. Only saas is billable on a recurring basis.
intervalstringBilling interval unit. day is sandbox-only; live plans support week, month, year.
intervalCountintegerInterval units between billings (≤ 365 days / 52 weeks / 12 months). For year, billing is always annual and this is ignored.
$plan = $vatly->subscriptionPlans->create([
    'name' => 'Pro Monthly',
    'description' => 'Full access to all Pro features, billed monthly',
    'basePrice' => ['value' => '29.00', 'currency' => 'EUR'],
    'productType' => 'saas',
    'interval' => 'month',
    'intervalCount' => 1,
]);

echo $plan->id;      // subscription_plan_...
echo $plan->status;  // 'pending' (live) or 'active' (test)

Retrieve a plan

GET /v1/subscription-plans/:id

Retrieve a subscription plan by its ID.

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

echo $plan->name;
echo $plan->basePrice->value . ' ' . $plan->basePrice->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