You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Plan versions. Plan has version and is_current; plans() returns current versions only.
subscribe(customerId, planCode, { planVersion }) sells a chosen version of the plan code instead of the current one (needs Engine 2.7.0). The same customer and code again keep the subscription's version; another version of an existing subscription throws NozleApiError 422 (plan_version_change_not_supported), an unknown version 404 (plan_version_not_found).
client.planVersions (secret keys): list(code) lists every version with its price and active subscriptions, get(code, version) reads one, and previewMigration, createMigration, listMigrations, getMigration and cancelMigration move the subscriptions of one version to another, each at the end of its billing period. Migration items carry move_status (pending, moved, canceled). A second migration of a code while one runs throws NozleApiError 409 (plan_version_migration_running).
The billing handler's subscription route includes subscription.plan_version, the version the customer is billed on, and subscription.entitlements, that version's entitlements with its usage limits (read from Core with the secret key; null when they cannot be read).