Skip to content

Create plan

POST
/v1/plans/

Create a new plan.

PlanCreate
object
code
required
Code
string
>= 1 characters <= 255 characters
name
required
Name
string
>= 1 characters <= 255 characters
description
Any of:
string
interval
required
PlanInterval
string
Allowed values: weekly monthly quarterly yearly
amount_cents
Amount Cents
integer
0
currency
Currency
string
default: USD >= 3 characters <= 3 characters
trial_period_days
Trial Period Days
integer
0
charges
Charges
Array<object>
ChargeInput

Charge input when creating/updating a plan.

object
billable_metric_id
required
Billable Metric Id
string format: uuid
charge_model
required
ChargeModel
string
Allowed values: standard graduated volume package percentage graduated_percentage custom dynamic
properties
Properties
object
key
additional properties
any
filters
Filters
Array<object>
ChargeFilterInput

Filter configuration for a charge within a plan.

object
billable_metric_filter_id
required
Billable Metric Filter Id
string format: uuid
values
Values
Array<string>
properties
Properties
object
key
additional properties
any
invoice_display_name
Any of:
string
<= 255 characters

Successful Response

PlanResponse
object
id
required
Id
string format: uuid
code
required
Code
string
name
required
Name
string
description
required
Any of:
string
interval
required
PlanInterval
string
Allowed values: weekly monthly quarterly yearly
amount_cents
required
Amount Cents
integer
currency
required
Currency
string
trial_period_days
required
Trial Period Days
integer
charges
Charges
Array<object>
ChargeOutput

Charge output in plan responses.

object
id
required
Id
string format: uuid
plan_id
required
Plan Id
string format: uuid
billable_metric_id
required
Billable Metric Id
string format: uuid
charge_model
required
ChargeModel
string
Allowed values: standard graduated volume package percentage graduated_percentage custom dynamic
properties
required
Properties
object
key
additional properties
any
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time

Invalid billable metric or filter reference

Unauthorized – invalid or missing API key

Plan with this code already exists

Validation error