Version

Plans

A project's plans as a connector's creator surface lists, creates, edits, publishes and deletes them — subscription plans drafted field by field, with the options a draft picks from and the dashboard's own rules.

Subscriby\Connector\Core\Plans. Where Storefront is the plans as a member meets them, this is the plans as the creator manages them, for a platform that has a conversation with creators. Every call takes the CreatorRef of the account talking and runs as that creator with the dashboard's own rules: the name unique in the project, the price at or above the floor, a free plan only on a tier that allows it. A draft names a subscription plan, paid once or renewing on a cycle; passes and seasons keep their dated schedules on the dashboard. Every refusal reaches you as PlanRefused with a stable reason.

options()

$options = $this->plans->options($creator, $project);

$options->currencies;    // list<PlanOption>: a currency's id and ISO code
$options->resources;     // list<PlanOption>: a place's id and title
$options->cycles;        // list<PlanOption>: a cycle's value and label
$options->maxTrialDays;  // the longest trial the core accepts

What a conversation needs before it asks its first question, so a wizard refuses an answer in place instead of after the save. The currencies are the ones an active payment method of the project supports; the places are the project's resources on sale; the cycles are the core's own (day, week, month, year, lifetime).

listForProject() and find()

foreach ($this->plans->listForProject($creator, $project) as $plan) {
    // $plan->name, ->price, ->currency, ->cadence, ->active, ->resourceTitles, ->kind
}

$plan = $this->plans->find($creator, $planId);   // null when no plan the creator may manage has the id

Each PlanDetails carries the plan's id and project, name and description, its PlanKind, the price as a decimal string with the currency's ISO code, the cadence in the dashboard's words, whether it is on sale, the sales cap and what counts towards it, the places it grants by id and by title, and the billing fields a draft that edits one of them starts from: the cycle, its count, whether it renews, the trial's length, and why the core paused it, if it did.

create(), update(), setPublished() and delete()

$draft = (new PlanDraft)
    ->with(PlanDraft::NAME, 'Lounge Pass')
    ->with(PlanDraft::PRICE, '9.00')
    ->with(PlanDraft::CURRENCY_ID, $currencyId)
    ->with(PlanDraft::BILLING_CYCLE, 'month')
    ->with(PlanDraft::BILLING_CYCLE_COUNT, 1)
    ->with(PlanDraft::RECURRING, true)
    ->with(PlanDraft::TRIAL_DAYS, 7)
    ->with(PlanDraft::RESOURCE_IDS, [$loungeId]);

$plan = $this->plans->create($creator, $project, $draft);
$plan = $this->plans->update($creator, $plan->id, (new PlanDraft)->with(PlanDraft::PRICE, '12.50'));
$plan = $this->plans->setPublished($creator, $plan->id, false);
$this->plans->delete($creator, $plan->id);

A create needs the name, the price, the currency, the cycle and at least one place; the rest takes the core's defaults. An update names only what changes, and the places replace the current list when named. setPublished() puts a plan on sale or takes it off; existing memberships keep running either way. The draft's other fields are DESCRIPTION, ACTIVE, SALES_CAP and the eligibility flags NEWCOMERS_ONLY, CUSTOMERS_ONLY, CHURNED_ONLY (one at a time), SINGLE_USE and ACCESS_CODES_ONLY.

Refusals

PlanRefused carries a stable reason: creator_unknown, project_unknown, plan_unknown, invalid (a field the core refused: the name taken or too short, no place, a lifetime plan with more than one cycle, a cycle the core does not know; the message is the core's translated sentence), tier_required (a free plan on a tier without them) and not_permitted.

A surface shows the price and the cadence the details carry rather than pricing arithmetic of its own, so a plan reads the same on the dashboard, the portal and the bot.

How is this guide?

Last updated on

Version

On this page

Subscriby is a product
designed by you — for you.
No boardroom full of executives deciding what we ships next. Our roadmap always shaped by you with your feedback.

Share feedback or a request

For AI agents: llms.txt · llms-full.txt