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.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes, unless signup=1. | |
| auth_password | String | Authentication password. | Yes, unless signup=1. | |
| count | Integer | 1 to return a count, 0 to return full data. | No | 0 |
| customer | Integer | ID of customer to get rate plans for. | No | Customer of authentication user. |
| descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
| force | Integer | If signup=1, the ID of the rate plan to force, else has no effect. | No | 0 |
| inheritable | Integer | 1 to return rate plans that can be inherited from, 0 for normal. | No | 0 |
| limit | Integer | The maximum results to return. 0 for all. | No | 0 |
| name | String | Only return rate plans with name containing this string. Empty string for all. | No | Empty string. |
| offset | Integer | The result to start at. 0 for the first. | No | 0 |
| pages | Integer | 1 to return a reduced set of data for generating the pages select box, 0 to return full data. | No | 0 |
| parent | Integer | 1 to return rate plans that can be used for customer, 0 for normal. | No | 0 |
| reseller | Integer | 1 to return rate plans that can be used by a reseller, 0 for normal. | No | 0 |
| signup | Integer | 1 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. | No | 0 |
| sort | String | Field to sort by. "description" or "name". | No | "name" |
| system | Integer | 1 to return all rate plans on system, 0 for normal. | No | 0 |
| us | Integer | If reseller=1, 1 to include rate plans for us or 0 not to, else has no effect. | No | 0 |
At most one of count, inheritable, pages, parent, reseller, signup, and system may be specified. Typically, none of these will be.
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid customer specified. |
| 401 | The authentication details provided are invalid. |
| 402 | Your 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
| Version | Changes |
|---|---|
| 3.14 | inconnect, incost, inmessage, outconnect, outcost, and outmessage return fields renamed to inconnect_markup, incost_markup, inmessage_markup, outconnect_markup, outcost_markup, and outmessage_markup. |
| 3.13 | Function added. |
