Skip to main content
PUT
/
v1
/
ui
/
products
/
{id}
/
plans
/
{planId}
Update a plan within a product
curl --request PUT \
  --url https://api.example.com/v1/ui/products/{id}/plans/{planId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "limits": {},
  "features": {},
  "metadata": {},
  "name": "<string>",
  "description": "<string>",
  "billingCycle": "weekly",
  "price": 123,
  "creditsPerUnit": 123,
  "currency": "<string>",
  "billingModel": "pre-paid",
  "freeUnits": 123,
  "limit": 123,
  "status": "active",
  "maxActiveUsers": 123,
  "accessExpiryDays": 123,
  "default": true
}
'
{
  "type": "recurring",
  "reference": "pln_1A2B3C4D",
  "price": 2999,
  "currency": "USD",
  "requiresPayment": true,
  "isActive": true,
  "status": "active",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "meterRef": "mtr_1A2B3C4D",
  "name": "Starter",
  "description": "Best for teams getting started",
  "currencySymbol": "$",
  "freeUnits": 100,
  "setupFee": 500,
  "trialDays": 14,
  "billingCycle": "monthly",
  "billingModel": "pre-paid",
  "creditsPerUnit": 1,
  "measures": "requests",
  "limit": 10000,
  "rolloverUnusedUnits": false,
  "limits": {},
  "features": {},
  "maxActiveUsers": 123,
  "accessExpiryDays": 123
}

Path Parameters

id
string
required

Product ID or reference

planId
string
required

Plan ID

Body

application/json
limits
object
required
features
object
required
metadata
object
required
name
string
Minimum string length: 1
description
string
billingCycle
enum<string>
Available options:
weekly,
monthly,
quarterly,
yearly,
custom
price
number
creditsPerUnit
number
currency
string
billingModel
enum<string>
Available options:
pre-paid,
post-paid
freeUnits
number
limit
number
status
enum<string>
Available options:
active,
inactive,
archived
maxActiveUsers
number
accessExpiryDays
number
default
boolean

Response

Plan updated successfully

type
enum<string>
required

Plan type exposed in SDK

Available options:
recurring,
one-time,
usage-based,
hybrid
Example:

"recurring"

reference
string
required

Plan reference

Example:

"pln_1A2B3C4D"

price
number
required

Plan price in cents

Example:

2999

currency
string
required

Currency code (ISO 4217)

Example:

"USD"

requiresPayment
boolean
required

Whether payment is required

Example:

true

isActive
boolean
required

Whether the plan is active (derived from status)

Example:

true

status
string
required

Plan status

Example:

"active"

createdAt
string
required

Creation timestamp

updatedAt
string
required

Last update timestamp

meterRef
string

Meter reference for usage-based plans

Example:

"mtr_1A2B3C4D"

name
string

Plan name

Example:

"Starter"

description
string

Plan description

Example:

"Best for teams getting started"

currencySymbol
string

Currency symbol (derived from currency)

Example:

"$"

freeUnits
number

Number of free units included

Example:

100

setupFee
number

One-time setup fee

Example:

500

trialDays
number

Free trial period in days

Example:

14

billingCycle
string

Billing cycle

Example:

"monthly"

billingModel
enum<string>

Billing model

Available options:
pre-paid,
post-paid
Example:

"pre-paid"

creditsPerUnit
number

Credits per usage unit (integer, >= 1)

Example:

1

measures
string

What the plan measures for usage tracking

Example:

"requests"

limit
number

Usage limit for the meter

Example:

10000

rolloverUnusedUnits
boolean

Whether unused units roll over to next period

Example:

false

limits
object

Usage limits

features
object

Plan features

maxActiveUsers
number

Maximum number of active users

accessExpiryDays
number

Access expiry in days