Get a List of Plans

The method returns a List of Plans.

The List of Plans can be shown page by page. To split by page, the following Arguments should be passed:

  • the page number (page);
  • the amount of items per page (per_page).

The List of Plans can be sorted by any field. To sort the List of Plans, the following Arguments should be passed:

  • the field name that is used for sorting (sorting[field]);
  • the sort direction (sorting[reversed]):
    • true - the list will be sorted in descending direction;
    • false - the list will be sorted in ascending direction (by default).

The List of Plans can be filtered by:

  • creation date (filters[created_at]);
  • update date (filters[updated_at]);
  • status (filters[status]);
  • public flag (filters[public]).

 GET /api/vendor/v1/plans.json?api_token={api_token}

Arguments

Name

Parameter Type

Data type

Required/ 
Optional

Description

api_tokenquerystringRequiredAPI token of the manager who perform the operation (see API Token Authentication).

page

query

integer

Optional

Returning a list of payment by current page number.

per_page

query

integer

Optional

Setting a number of items in the page.

sorting[field]

query

string

Optional

Sorting the list by a specified field.

sorting[reversed]

query

string

Optional

Setting the sorting mode:

  • true - a descending sorting;
  • false - an ascending sorting (by default).

filters[created_at]

query

date

Optional

Filtering the list by a creation date.

filters[updated_at]

query

date

Optional

Filtering the list by an update date.

filters[status]

query

string

Optional

Filtering the list by a status.

filters[public]

query

string

Optional

Filtering the list by the "public" flag.

Response model

Name

Data type

Description

id

integer

A plan ID.

status

string

One of the following plan statuses:

  • active - a plan is available for customers;
  • inactive - a plan is not available for customers;
  • deactivated by provider - a plan is not available for customers because the plan was deactivated by the upline reseller (operator).

name

string

A plan name.

description

string

Additional information about the plan. This information displays to customers in the online store and the Customer Control Panel.

created_at

data

A date and time of the plan's creation.

updated_at

data

A date and time of the last plan update.

public

bool

Plan availability for ordering:

  • true -  a plan is available for ordering;
  • false -  a plan is not available for ordering.

plan_class_id

integer

A plan class ID (see Managing service terms in the ActivePlatform. Operator Control Panel).

plan_class

string

A plan class name.

plan_resources

array

The following information about plan resources:

  • id - a resource ID;
  • name - a resource name;
  • application_template_name - a name of the application template, which is included in the plan;
  • measurable - a model of calculating usage of the resources (is not available if this function is not supported by third-party service):
    • true - the calculation of the actual resource usage is used;
    • false - the calculation of the actual resource usage is not used.
      A type of the unit is displayed on the "unit_of_measure" parameter. 
  • unit_of_measure - a unit of measure of a resource:
    • unit - measurable resource, for which is a certain amount is specified;
    • boolean - unmeasurable resource, for which is a certain amount is not specified:
      • true - a resource was added;
      • false - a resource was not added.
  • included - a value of the resource which will be included in the plan by default (the included resources are available for free.);
  • minimum - a minimum amount of resources (including the value that was set in the "included" parameter) that can be available for an additional order.
  • limit - a maximum value of the resource which is available for ordering.
  • setup_fee -  a price of the resource installation;
  • recurring_fee - a value of monthly fee for the resource; this type of fee is used if the customer has to pay for the resource each month to renew the subscription;
  • overuse_fee - a price of the resource if a customer overused the included value of the resource.
  • renewal_fee a value of fee, which the subscriber has to pay to renew the resource.
  • unlimited_units - if customers can buy unlimited value of the resource:
    • true - limits is off;
    • false - limits is on.
  • public - the parameter makes the plan's resource available for sale:
    • true - a resource is available for ordering;
    • false - a resource is not available for ordering.
  • status - one of the following statuses of a resource: active; inactive; deleted.
  • resource_id - a plan resource ID;
  • created_at - a date and time of the plan resource creation.
  • updated_at - a date and time of the plan resource change last time.

Request example

 GET http://billing.activeplatform.com:80/api/vendor/v1/plans.json?api_token=654321

Response example

[
  {
    "id": 2000027,
    "status": "inactive",
    "name": "iMind",
    "description": "",
    "created_at": "2014-12-01T17:26:30.056+03:00",
    "updated_at": "2016-07-13T14:31:15.265+03:00",
    "public": false,
    "plan_class_id": 1,
    "plan_class": "Default",
    "plan_resources": [
      {
        "id": 2000595,
        "name": "1",
        "application_template_name": "Dummy",
        "measurable": false,
        "unit_of_measure": "unit",
        "included": 1,
        "minimum": 1,
        "limit": 0,
        "setup_fee": "0.0",
        "recurring_fee": "0.0",
        "overuse_fee": "0.0",
        "renewal_fee": "0.0",
        "unlimited_units": true,
        "public": true,
        "status": "deleted",
        "resource_id": 2002229,
        "created_at": "2014-12-03T12:21:37.713+03:00",
        "updated_at": "2016-06-16T18:20:19.448+03:00"
      },
      {
        "id": 2000583,
        "name": "Customers",
        "application_template_name": "iMind",
        "measurable": false,
        "unit_of_measure": "unit",
        "included": 1,
        "minimum": 1,
        "limit": 0,
        "setup_fee": "0.0",
        "recurring_fee": "0.0",
        "overuse_fee": "0.0",
        "renewal_fee": "0.0",
        "unlimited_units": true,
        "public": true,
        "status": "active",
        "resource_id": 2002213,
        "created_at": "2014-12-01T17:26:46.005+03:00",
        "updated_at": "2016-06-16T18:20:19.406+03:00"
      },
      {
        "id": 2000581,
        "name": "Maximum users online",
        "application_template_name": "iMind",
        "measurable": false,
        "unit_of_measure": "unit",
        "included": 1,
        "minimum": 1,
        "limit": 0,
        "setup_fee": "0.0",
        "recurring_fee": "0.0",
        "overuse_fee": "0.0",
        "renewal_fee": "0.0",
        "unlimited_units": true,
        "public": true,
        "status": "active",
        "resource_id": 2002210,
        "created_at": "2014-12-01T17:26:45.921+03:00",
        "updated_at": "2016-06-16T18:20:19.402+03:00"
      },
      {
        "id": 2000582,
        "name": "Users",
        "application_template_name": "iMind",
        "measurable": false,
        "unit_of_measure": "unit",
        "included": 1,
        "minimum": 1,
        "limit": 0,
        "setup_fee": "0.0",
        "recurring_fee": "0.0",
        "overuse_fee": "0.0",
        "renewal_fee": "0.0",
        "unlimited_units": true,
        "public": true,
        "status": "active",
        "resource_id": 2002211,
        "created_at": "2014-12-01T17:26:46.002+03:00",
        "updated_at": "2016-06-16T18:20:19.404+03:00"
      }
    ],
    "plan_periods": [
      {
        "id": 2000067,
        "duration_value": 1,
        "duration_type": "month",
        "setup_fee": "0.0",
        "recurring_fee": "0.0",
        "renewal_fee": "0.0",
        "trial": false,
        "public": true,
        "status": "active",
        "description": null,
        "created_at": "2014-12-01T17:27:36.588+03:00",
        "updated_at": "2014-12-01T17:27:36.588+03:00"
      },
      {
        "id": 2000068,
        "duration_value": 3,
        "duration_type": "month",
        "setup_fee": "0.1",
        "recurring_fee": "0.0",
        "renewal_fee": "0.0",
        "trial": false,
        "public": true,
        "status": "active",
        "description": null,
        "created_at": "2014-12-01T17:27:36.591+03:00",
        "updated_at": "2015-02-24T14:24:04.330+03:00"
      },
      {
        "id": 2000066,
        "duration_value": 3,
        "duration_type": "day",
        "setup_fee": "0.0",
        "recurring_fee": "0.0",
        "renewal_fee": "0.0",
        "trial": true,
        "public": true,
        "status": "active",
        "description": null,
        "created_at": "2014-12-01T17:27:36.557+03:00",
        "updated_at": "2016-10-04T06:31:45.211+03:00"
      }
    ]
  }
]