Saltar al contenido principal
PATCH
cURL
Update a plan’s name, description, visibility, default status, metadata, what happens to its unused plan credits, or its plan credit limit.

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
name
string
Minimum string length: 1
description
string | null
metadata
object
isPublic
boolean
unusedPlanCredits
object

Credits plans only. What happens to unused plan credits at each reset. Existing subscriptions apply it from their next reset.

planCreditLimit
object | null

Credits plans only. The most plan credits a subscription spends per day or per week; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period.

unusedPlanBalance
object

Balance plans only. What happens to unused plan balance at each reset. Existing subscriptions apply it from their next reset.

planBalanceLimit
object | null

Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period.

blockOnExhaustion
boolean

Credits and balance plans only. false lets usage continue past the plan and purchased amounts and bills the missing amount as overage at the next renewal; a credits plan bills it at the price per credit and needs one. Trials and free plans always stop, so free plans accept only true. Existing subscriptions apply it from their next reset.

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 in a plan group; replaces the group's previous default plan. false unmarks it.

Respuesta

Success

id
string
requerido
name
string
requerido
code
string
requerido
description
string | null
requerido
consumptionModel
enum<string> | null
requerido
Opciones disponibles:
metered,
credits,
balance
isPublic
boolean
requerido
isDefault
boolean
requerido
isFree
boolean
requerido
blockOnExhaustion
boolean | null
requerido

Credits and balance plans: true stops usage when the plan and purchased amounts run out; false lets usage continue and bills the missing amount as overage at the next renewal (credits at the price per credit). Trials and free plans always stop.

unusedPlanCredits
object
requerido

Credits plans only; null for other consumption models. What happens to unused plan credits at each reset. Purchased credits never expire and never count toward maxPlanCredits.

planCreditLimit
object | null
requerido

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

unusedPlanBalance
object
requerido

Balance plans only; null for other consumption models. What happens to unused plan balance at each reset. Purchased balance never expires and never counts toward maxPlanBalance.

planBalanceLimit
object | null
requerido

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

sortOrder
integer
requerido
Rango requerido: -9007199254740991 <= x <= 9007199254740991
planGroupId
string | null
requerido
metadata
object | null
requerido
createdAt
string<date-time>
requerido
updatedAt
string<date-time>
requerido
features
object[]
requerido
prices
object[]
requerido
exchangeRates
object[]
requerido
object
string
requerido
Allowed value: "plan"
livemode
boolean
requerido