Skip to content

Support trial-period pre-fill on subscription create #35

Description

@sandervanhooft

Problem

The SubscriptionEndpoint::create() payload accepts redirectUrlSuccess, redirectUrlCanceled, and optional billingAddress, but has no way to pre-fill a trial period when creating a subscription. Yet Subscription::\$trialUntil and SubscriptionStatus::TRIAL already exist on the read side — so the read shape models trials but the write shape can't initiate them.

This blocks fluent from offering trial helpers (see vatly/vatly-fluent-php#66). Consumers building SaaS pricing pages with "14-day free trial" CTAs have no way to wire it through.

Surface change

Add a trialUntil (ISO-8601 timestamp) or trialDays (int) field on the subscription-create endpoint request payload. The endpoint docblock currently reads:

Pre-fill data (redirectUrlSuccess, redirectUrlCanceled, optional billingAddress).

Extending to:

Pre-fill data (redirectUrlSuccess, redirectUrlCanceled, optional billingAddress, optional trialUntil).

Precedent

Subscription::\$trialUntil and Subscription::isTrial() already exist — the read shape exists, the write shape doesn't.

Open question

Does Vatly's HTTP API accept a trial parameter on POST /subscriptions today? If yes, this is purely an api-php DTO/endpoint addition. If no, this is upstream-blocked on the API itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions