Skip to main content
PATCH
PATCH /subscription/plan/{id} actualiza los campos mutables de un plan existente. Puedes renombrarlo, actualizar su descripción, alternar su estado activo para dejar de aceptar nuevos suscriptores, o ajustar los países donde está disponible — todo sin afectar a los suscriptores existentes.
amount, interval, intervalCount y currency son inmutables y no se pueden cambiar vía este endpoint. Para cambiar el precio o la cadencia de facturación, crea un plan nuevo usando POST /subscription/plan y migra a los suscriptores usando change-plan.
Incluye solo los campos que quieres cambiar — los omitidos se dejan sin cambios (ver el panel de parámetros de arriba para la lista completa; availableCountries es un reemplazo completo, no una fusión). Devuelve 200 OK con el objeto de plan actualizado completo.

Errores

Autorizaciones

Authorization
string
header
requerido

Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).

Parámetros de ruta

id
string
requerido

Cuerpo

application/json
merchantCode
string
requerido

Your merchant account identifier.

name
string

New plan name.

description
string

New description.

isActive
boolean

Set false to stop the plan accepting new subscribers. amount and interval cannot be changed - create a new plan and use change-plan instead.

availableCountries
string[]

Replacement list of ISO 3166-1 alpha-2 codes. Send [] to make the plan global.

Respuesta

200 - application/json

Updated plan

A reusable billing plan. amount is a flat integer in the currency minor units (with separate currency + exponent) - not an Amount object.

id
integer

The plan unique integer ID.

merchantId
integer

The merchant account that owns the plan.

name
string
description
string
interval
enum<string>

Billing interval unit. Immutable after creation.

Opciones disponibles:
day,
week,
month,
year
intervalCount
integer

Number of interval units between charges - month + 3 bills quarterly.

amount
integer

Recurring charge in the currency minor units (e.g. 2999 = $29.99 at exponent 2). Immutable after creation.

currency
string

ISO 4217 currency code. Immutable after creation.

exponent
integer

Decimal places for amount / introAmount - 2 for USD, 0 for JPY.

trialPeriodDays
integer

Free-trial length in days before the first charge. 0 for no trial.

introAmount
integer

Introductory charge in minor units for the first introBillingCycles cycles, if set.

introBillingCycles
integer

How many initial cycles are billed at introAmount before the rate reverts to amount.

maxBillingCycles
integer

Total cycles after which the subscription auto-completes. 0 = open-ended.

availableCountries
string[]

ISO 3166-1 alpha-2 codes the plan is offered in. Empty = available everywhere.

isActive
boolean

Whether the plan accepts new subscribers. Existing subscriptions are unaffected when this is false.

createdAt
string<date-time>
updatedAt
string<date-time>