Saltar al contenido principal
POST
Create plan
This reference describes API version 2026-06-10. Send Commet-Version: 2026-06-10 with your request.

Autorizaciones

x-api-key
string
header
requerido

Encabezados

Commet-Version
string
predeterminado:2026-06-10

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

Cuerpo

application/json
name
string
requerido
Minimum string length: 1
code
string
requerido
Minimum string length: 1
Pattern: ^[a-z0-9_]+$
description
string
consumptionModel
enum<string>
Opciones disponibles:
metered,
credits,
balance
isPublic
boolean
isFree
boolean
blockOnExhaustion
boolean

Credits and balance plans. Omitted, credits plans and free plans stop usage when the plan and purchased amounts run out, and paid balance plans bill the missing balance as overage. A new credits plan always stops usage: it allows overage only with a price per credit, which is set after creation, and then PATCH /v1/plans/{id} turns overage on.

unusedPlanCredits
object

Credits plans only. What happens to unused plan credits at each reset; omitted means they expire.

planCreditLimit
object | null

Credits plans only. The most plan credits a subscription spends per day or per week; omitted or null means no limit.

unusedPlanBalance
object

Balance plans only. What happens to unused plan balance at each reset; omitted means it expires.

planBalanceLimit
object | null

Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; omitted or null means no limit.

planGroupId
string
isDefault
boolean

Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan with a planGroupId; replaces the group's previous default plan.

metadata
object

Respuesta

Success

success
any
requerido
data
object
requerido