Saltar al contenido principal
PUT
cURL
Apply a direct Offer to a subscription. On a pending checkout it quotes or replaces the checkout discount, which starts after the plan price trial when there is one, and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases.

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
offerId
string
requerido
Minimum string length: 1
expiresAt
string<date-time>

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