JSON API » plans » plans/classes/create

Creates a new rate plan number class.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
classIntegerID of number class.Yes
planIntegerID of rate plan.Yes
descriptionStringDescription.NoEmpty string.
feeDecimalAmount to charge each billing period.No0.00
signupDecimalAmount to charge on purchase.No0.00
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.
404The rate plan does not exist, or you do not have permission to view it.

Data returned

The ID of the created rate plan number class.

Example: With required parameters

http://enswitch.example.com/api/json/plans/classes/create/?auth_username=user;auth_password=password;class=1;plan=2

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
3.13Function added.