Create a new plan
Plans
Create a new plan
Create a new plan with the provided details. Note: This endpoint is restricted for internal use only.
POST
Create a new plan
Headers
The API key to access the admin API
Body
application/json
Example:
"Premium Plan"
Unique code for the plan
Example:
"iqraa_starter_monthly"
Billing interval
Available options:
yearly, monthly Example:
"monthly"
Currency code
Example:
"USD"
Plan amount
Required range:
x >= 0Example:
99.99
Trial period in days
Required range:
x >= 0Example:
14
Grace period in days after subscription expiry
Required range:
x >= 0Example:
7
Add multiple billable metrics in plan
Example:
[
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"charge_model": "volume",
"invoiceable": true,
"pay_in_advance": false,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 100,
"flat_amount": "0",
"per_unit_amount": "0"
},
{
"from_value": 101,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.5"
}
]
}
}
]Response
The plan has been successfully created
Example:
"Premium Plan"
Unique code for the plan
Example:
"iqraa_starter_monthly"
Billing interval
Available options:
yearly, monthly Example:
"monthly"
Currency code
Example:
"USD"
Plan amount
Required range:
x >= 0Example:
99.99
Trial period in days
Required range:
x >= 0Example:
14
Grace period in days after subscription expiry
Required range:
x >= 0Example:
7
Add multiple billable metrics in plan
Example:
[
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"charge_model": "volume",
"invoiceable": true,
"pay_in_advance": false,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 100,
"flat_amount": "0",
"per_unit_amount": "0"
},
{
"from_value": 101,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.5"
}
]
}
}
]