Create a plan
POST
/api/v1/profiles
prm_profiles_create
name and type are always required; everything else has a schema default. A prepaid or postpaid plan that limits expiration (enforce_expiration, which defaults to true when omitted) must also carry its period: expiration_value above 0 and expiration_unit. Send enforce_expiration false for a plan with no time limit.
A quota limit does nothing until its enforce toggle is on. Setting combined_bytes_limit while enforce_combined_bytes is false leaves the plan unlimited on data, and the number sits there looking like a cap. The two always travel together.
At a glance
- Authentication
- Staff token or session
- Requires permission
-
prm_profiles_createCreate profiles - Rate limit
t_mutate
Parameters
| Parameter | Description |
|---|---|
namerequired
body · string
|
Display name. |
typerequired
body · enum
|
prepaid, postpaid, fup, extension or addon. |
base_fee
body · number
|
Wholesale price to the reseller, major units. |
end_user_price
body · number
|
Retail price, major units. |
enforce_expiration
body · boolean
|
Whether the plan has a time limit. Defaults to true. False means its subscribers never expire (their expiration is always null). |
expiration_value
body · integer
|
Period length, paired with expiration_unit. Required (above 0) on a prepaid or postpaid plan whose enforce_expiration is true. |
expiration_unit
body · enum
|
hours, days or months. Required on a prepaid or postpaid plan whose enforce_expiration is true. |
Errors
| Code | When it is returned |
|---|---|
ERR_VALIDATION400
|
name or type missing, an out-of-range value, or a prepaid/postpaid plan that limits expiration without a period (reason profile_expiration_period_required) |