JSON API » plans » plans/list

Gets the fields of rate plans in the given customer.

Input parameters

No authentication is required if signup=1. Otherwise, requires authentication and the system role privilege if system=1, the user role privilege if parent=1, else the commerce or settings role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes, unless signup=1.
auth_passwordStringAuthentication password.Yes, unless signup=1.
countInteger1 to return a count, 0 to return full data.No0
customerIntegerID of customer to get rate plans for.NoCustomer of authentication user.
descendingInteger1 to sort descending, 0 not to.No0
forceIntegerIf signup=1, the ID of the rate plan to force, else has no effect.No0
inheritableInteger1 to return rate plans that can be inherited from, 0 for normal.No0
limitIntegerThe maximum results to return. 0 for all.No0
nameStringOnly return rate plans with name containing this string. Empty string for all.NoEmpty string.
offsetIntegerThe result to start at. 0 for the first.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
parentInteger1 to return rate plans that can be used for customer, 0 for normal.No0
resellerInteger1 to return rate plans that can be used by a reseller, 0 for normal.No0
signupInteger1 to return rate plans that can be used in signup, 0 for normal. Requires customer to be set to the ID of the parent reseller.No0
sortStringField to sort by. "description" or "name".No"name"
systemInteger1 to return all rate plans on system, 0 for normal.No0
usIntegerIf reseller=1, 1 to include rate plans for us or 0 not to, else has no effect.No0

At most one of count, inheritable, pages, parent, reseller, signup, and system may be specified. Typically, none of these will be.

Responses

CodeDescription
200Success.
400Invalid customer specified.
401The authentication details provided are invalid.
402Your role does not allow this.

Data returned

An array of fields, corresponding to the rows of the plans table in the database.

Example: With normal parameters

http://enswitch.example.com/api/json/plans/list/?auth_username=user;auth_password=password

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "name":"example1", ... }, { "id":2, "name":"example2", ... } ] }

Change history

VersionChanges
3.14inconnect, incost, inmessage, outconnect, outcost, and outmessage return fields renamed to inconnect_markup, incost_markup, inmessage_markup, outconnect_markup, outcost_markup, and outmessage_markup.
3.13Function added.