Skip to main content
POST
cURL
Create a subscription for a customer. Commet selects the default price when priceId is omitted and resolves its market from the customer’s billing country. Without an offer override, Commet applies the price’s automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID.

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.

Cuerpo

application/json
customerId
string
requerido
Required string length: 1 - 200
planId
string
requerido
Minimum string length: 1
billingInterval
enum<string> | null
Opciones disponibles:
weekly,
monthly,
quarterly,
yearly,
one_time
priceId
string

Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing.

Minimum string length: 1
initialSeats
object
provider

Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present.

Opciones disponibles:
stripe,
commet,
dlocal
name
string
startDate
string<date-time>
successUrl
string<uri>
offerId
any
promoCode
string
Minimum string length: 1
customTrialDays
integer
Rango requerido: 0 <= x <= 9007199254740991
skipTrial
boolean
predeterminado:false

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,
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
createdAt
string<date-time>
requerido
updatedAt
string<date-time>
requerido
offerApplications
object[]
requerido
pause
object
requerido
checkoutProvider
enum<string> | null
requerido

Payment provider resolved for this checkout when the subscription response was created. This is an informational snapshot and may differ when the checkout is loaded if its country or the organization's routing changes.

Opciones disponibles:
stripe,
commet,
dlocal
priceId
string | null
requerido
object
string
requerido
Allowed value: "subscription"
livemode
boolean
requerido