Saltar al contenido principal
POST
Change subscription version
Move a subscription to a newer published version of its plan, now or at the end of the period, without proration; an older version is rejected with version_not_newer, and a subscription on a running experiment moves only to a later version of that experiment. The subscription keeps its currency and its price: a destination that does not sell its currency is rejected with missing_regional_price, and one that does not sell the price it pays with price_not_found. A free version moves only to a free version and a paid one only to a paid version; any other destination is rejected with validation_error. A subscription whose usage does not fit the destination, or with an active add-on the destination does not sell, is not moved either, and the error says why. Each change is recorded as a move of this one subscription in the plan’s moves. Repeating the same request changes nothing; a new one replaces the pending move. With effective: "now", features, limits and the included credits or balance change at once and the new price is charged from the next renewal. With effective: "period_end", nothing changes before the next renewal, everything changes at it, and the subscription shows the pending move in scheduledVersionChange. A trialing subscription moves when its trial ends, and a past-due one at the end of the period it is paying for once it pays. A subscription that ends or changes to another plan first never moves. A one-time subscription never renews, so period_end returns 409 invalid_subscription_status; move it with now. subscription.version_changed fires when the move takes effect.

Autorizaciones

x-api-key
string
header
requerido

Encabezados

Idempotency-Key
string

Unique key used to safely retry this write for 24 hours without applying it twice.

Required string length: 1 - 200
Commet-Version
string
predeterminado:2026-08-27

API version used by this reference. Send this header to select this contract explicitly.

Parámetros de ruta

id
string
requerido

Cuerpo

application/json
planVersionId
string
requerido

A published version of the subscription's plan.

effective
enum<string>
requerido

now changes features, limits and the included credits or balance at once (the included difference is added to or subtracted from the plan credits or plan balance: an increase first pays any plan-part debt, a decrease never creates new debt, and purchased credits and purchased balance are untouched) and charges the new price from the next renewal. period_end changes everything at the next renewal. There is never a proration charge or refund.

Opciones disponibles:
now,
period_end

Respuesta

Success

id
string
requerido
customerId
string
requerido
plan
object
requerido
name
string
requerido
description
string | null
requerido
status
enum<string>
requerido
Opciones disponibles:
draft,
pending_payment,
trialing,
active,
past_due,
paused,
canceled
billingInterval
enum<string> | null
requerido
Opciones disponibles:
weekly,
monthly,
quarterly,
semiannual,
yearly,
one_time
trialEndsAt
string<date-time> | null
requerido
currentPeriod
object | null
requerido
cancellation
object | null
requerido
cancelAtPeriodEnd
boolean
requerido
scheduledPlanChange
object | null
requerido
startDate
string<date-time>
requerido
endDate
string<date-time> | null
requerido
billingDayOfMonth
integer | null
requerido
Rango requerido: -9007199254740991 <= x <= 9007199254740991
nextBillingDate
string<date-time> | null
requerido
checkoutUrl
string | null
requerido
hasPaymentMethod
boolean
requerido

Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false.

createdAt
string<date-time>
requerido
updatedAt
string<date-time>
requerido
planVersion
object | null
requerido

The plan version whose terms the subscription has now. It keeps paying and receiving everything from this version until it is moved.

offerApplications
object[]
requerido
pause
object
requerido
scheduledVersionChange
object | null
requerido

A move to another version of the plan pending for the next renewal.

consumptionModel
enum<string> | null
requerido
Opciones disponibles:
metered,
credits,
balance
features
object[]
requerido
credits
object | null
requerido
balance
object | null
requerido
priceId
string | null
requerido
object
string
requerido
Allowed value: "subscription"
livemode
boolean
requerido
planGrant
object