Получение списка тарифных планов всех нижестоящих реселлеров

Метод Get list of plans of downstream resellers используется для получения cписка тарифных планов всех реселлеров, являющихся нижестоящими по отношению к текущему реселлеру, или по отношению к его выбранному нижестоящему реселлеру. 

Для авторизации требуется API-токен менеджера (сотрудника). API-токен можно получить через Панель управления Оператора (см. Просмотр и обновление информации о сотруднике).

По указанному в запросе API-токену определяются:

  • Роль и уровень доступа менеджера, от которых зависит доступность метода.
  • Текущий реселлер и его нижестоящие реселлеры, доступные в рамках метода.

GET {base_url}/api/v3/resellers/{reseller_id}/child_reseller_plans

Аргументы

Название

Тип параметра

Тип данных

Обязательный/ 
Опциональный

Описание

X-Api-TokenheaderstringОбязательныйAPI-токен сотрудника, выполняющего операцию (см. Просмотр и обновление информации о сотруднике)
Content-TypeheaderstringОбязательныйТип данных, передаваемых в запросе. Необходимо указать: application/vnd.api+json
AcceptheaderstringОбязательныйПоддерживаемые типы данных в ответе. Необходимо указать: application/vnd.api+json
base_urlpathstringОбязательныйURL ActivePlatform
reseller_idpathintegerОбязательный

ID реселлера. Возможно указать ID текущего реселлера или ID любого из его нижестоящих реселлеров (см. Просмотр информации о реселлере)

page[size]

query

integer

Опциональный

Параметр постраничной навигации. Количество элементов на странице ответа (50 по умолчанию)

page[number]

query

integer

Опциональный

Параметр постраничной навигации. Номер страницы ответа

Модель ответа

Модель ответа аналогична методу Get list of plans, за исключением дополнительной информации о связанных объектах (см. Получение списка тарифных планов).

Пример запроса

GET /api/v3/resellers/1/child_reseller_plans?page[size]=2&page[number]=78
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Пример ответа

{
    "data": [
        {
            "id": "367",
            "type": "plans",
            "attributes": {
                "created_at": "2017-07-07T10:06:26.669+03:00",
                "updated_at": "2019-11-22T14:13:51.378+03:00",
                "status": "active",
                "name": "test plan",
                "description": "",
                "public": true,
                "plan_class_id": 1300,
                "product_id": 403,
                "billing_type": "reservation",
                "ancestry": null,
                "reseller_id": 1,
                "fixed_price": true,
                "sku": "91fd106f-4b2c",
                "singleton": false,
                "auto_renewal": false,
                "auto_renewal_disabled": false,
                "plan_class": "test",
                "product_category_id": 190,
                "product_category": "default",
                "product_category_public": false,
                "product": "Default",
                "plan_resources": {
                    "data": [
                        {
                            "id": "2003",
                            "type": "plan_resources",
                            "attributes": {
                                "created_at": "2017-07-07T10:06:38.197+03:00",
                                "updated_at": "2017-07-07T10:06:38.197+03:00",
                                "name": "res2",
                                "measurable": false,
                                "unit_of_measure": "unit",
                                "application_template_name": "Auto provisioning",
                                "included": 0,
                                "minimum": 0,
                                "limit": 0,
                                "setup_fee": "0.0",
                                "recurring_fee": "0.0",
                                "overuse_fee": "0.0",
                                "renewal_fee": "0.0",
                                "unlimited_units": false,
                                "public": true,
                                "status": "active",
                                "resource_id": 9,
                                "priority": 0,
                                "net_costs": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                },
                                "erp": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                }, 
                                "custom_attributes": {}
                            }
                        },
                        {
                            "id": "2004",
                            "type": "plan_resources",
                            "attributes": {
                                "created_at": "2017-07-07T10:06:38.226+03:00",
                                "updated_at": "2017-07-07T10:06:38.226+03:00",
                                "name": "res3",
                                "measurable": false,
                                "unit_of_measure": "unit",
                                "application_template_name": "Auto provisioning",
                                "included": 0,
                                "minimum": 0,
                                "limit": 0,
                                "setup_fee": "0.0",
                                "recurring_fee": "0.0",
                                "overuse_fee": "0.0",
                                "renewal_fee": "0.0",
                                "unlimited_units": false,
                                "public": true,
                                "status": "active",
                                "resource_id": 10,
                                "priority": 1,
                                "net_costs": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                },
                                "erp": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                }, 
                                "custom_attributes": {}
                            }
                        }
                    ]
                },
                "plan_periods": {
                    "data": [
                        {
                            "id": "818",
                            "type": "plan_periods",
                            "attributes": {
                                "created_at": "2017-07-07T10:06:41.766+03:00",
                                "updated_at": "2017-07-07T10:06:41.766+03:00",
                                "duration_value": null,
                                "duration_type": null,
                                "setup_fee": "0.0",
                                "recurring_fee": "0.0",
                                "transfer_fee": "0.0",
                                "renewal_fee": "0.0",
                                "trial": false,
                                "public": true,
                                "status": "active",
                                "description": null,
                                "endless": true,
                                "net_costs": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "transfer_fee": "0.0",
                                    "renewal_fee": "0.0"
                                },
                                "erp": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "transfer_fee": "0.0",
                                    "renewal_fee": "0.0"
                                } 
                            }
                        }
                    ]
                },
                "available_account_types": {
                    "data": [
                        {
                            "id": "12",
                            "type": "account_types",
                            "attributes": {
                                "created_at": "2016-10-25T05:16:28.789779+0000",
                                "updated_at": "2017-02-01T12:04:39.227805+0000",
                                "reseller_id": 1,
                                "name": "Business",
                                "ancestry": null,
                                "default_payment_method_id": 197,
                                "key": "business",
                                "name_pattern": "%primary_name",
                                "use_by_default": false,
                                "primary_name": "Company name"
                            }
                        },
                        {
                            "id": "1564",
                            "type": "account_types",
                            "attributes": {
                                "created_at": "2017-03-20T13:34:28.163302+0000",
                                "updated_at": "2022-09-15T08:33:31.943006+0000",
                                "reseller_id": 1,
                                "name": "Personal",
                                "ancestry": "1562",
                                "default_payment_method_id": 2,
                                "key": "personal",
                                "name_pattern": "%first_name %middle_name %last_name",
                                "use_by_default": false,
                                "primary_name": ""
                            }
                        }
                    ]
                },
                "plan_currency": "RUB",
                "custom_attributes": {
                    "vat25": "0"
                }
            },
            "relationships": {
                "plan_category": {
                    "data": {
                        "id": "190",
                        "type": "plan_categories"
                    }
                }
            }
        },
        {
            "id": "368",
            "type": "plans",
            "attributes": {
                "created_at": "2017-07-07T11:28:07.244+03:00",
                "updated_at": "2017-07-07T11:28:07.404+03:00",
                "status": "active",
                "name": "Plan VSP billing info 7/1",
                "description": "The best Plan",
                "public": true,
                "plan_class_id": 1366,
                "product_id": 403,
                "billing_type": "reservation",
                "ancestry": null,
                "reseller_id": 1,
                "fixed_price": true,
                "sku": "f54f74e9a239",
                "singleton": false,
                "auto_renewal": true,
                "auto_renewal_disabled": false,
                "plan_class": "Plan VSP billing info 7-Reservation",
                "product_category_id": 190,
                "product_category": "default",
                "product_category_public": false,
                "product": "Default",
                "plan_resources": {
                    "data": [
                        {
                            "id": "2005",
                            "type": "plan_resources",
                            "attributes": {
                                "created_at": "2017-07-07T11:28:07.320+03:00",
                                "updated_at": "2017-07-07T11:28:07.320+03:00",
                                "name": "Users",
                                "measurable": null,
                                "unit_of_measure": "unit",
                                "application_template_name": "Plan VSP billing info 7",
                                "included": 1,
                                "minimum": 1,
                                "limit": 300,
                                "setup_fee": "0.0",
                                "recurring_fee": "249.93",
                                "overuse_fee": "0.0",
                                "renewal_fee": "0.0",
                                "unlimited_units": false,
                                "public": true,
                                "status": "active",
                                "resource_id": 997,
                                "priority": 0,
                                "net_costs": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                },
                                "erp": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                }, 
                                "custom_attributes": {}
                            }
                        },
                        {
                            "id": "2006",
                            "type": "plan_resources",
                            "attributes": {
                                "created_at": "2017-07-07T11:28:07.349+03:00",
                                "updated_at": "2017-07-07T11:28:07.349+03:00",
                                "name": "Licenses",
                                "measurable": null,
                                "unit_of_measure": "unit",
                                "application_template_name": "Plan VSP billing info 7",
                                "included": 0,
                                "minimum": 0,
                                "limit": 300,
                                "setup_fee": "0.0",
                                "recurring_fee": "249.93",
                                "overuse_fee": "0.0",
                                "renewal_fee": "0.0",
                                "unlimited_units": false,
                                "public": true,
                                "status": "active",
                                "resource_id": 998,
                                "priority": 1,
                                "net_costs": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                },
                                "erp": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "overuse_fee": "0.0",
                                    "renewal_fee": "0.0"
                                }, 
                                "custom_attributes": {}
                            }
                        }
                    ]
                },
                "plan_periods": {
                    "data": [
                        {
                            "id": "819",
                            "type": "plan_periods",
                            "attributes": {
                                "created_at": "2017-07-07T11:28:07.366+03:00",
                                "updated_at": "2017-07-07T11:28:07.366+03:00",
                                "duration_value": 1,
                                "duration_type": "year",
                                "setup_fee": "4.0",
                                "recurring_fee": "4.0",
                                "transfer_fee": "0.4",
                                "renewal_fee": "5.54",
                                "trial": false,
                                "public": true,
                                "status": "active",
                                "description": null,
                                "endless": false,
                                "net_costs": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "transfer_fee": "0.0",
                                    "renewal_fee": "0.0"
                                },
                                "erp": {
                                    "setup_fee": "0.0",
                                    "recurring_fee": "0.0",
                                    "transfer_fee": "0.0",
                                    "renewal_fee": "0.0"
                                }
                            }
                        }
                    ]
                },
                "available_account_types": {
                    "data": [
                        {
                            "id": "12",
                            "type": "account_types",
                            "attributes": {
                                "created_at": "2016-10-25T05:16:28.789779+0000",
                                "updated_at": "2017-02-01T12:04:39.227805+0000",
                                "reseller_id": 1,
                                "name": "Business",
                                "ancestry": null,
                                "default_payment_method_id": 197,
                                "key": "business",
                                "name_pattern": "%primary_name",
                                "use_by_default": false,
                                "primary_name": "Company name"
                            }
                        },
                        {
                            "id": "1564",
                            "type": "account_types",
                            "attributes": {
                                "created_at": "2017-03-20T13:34:28.163302+0000",
                                "updated_at": "2022-09-15T08:33:31.943006+0000",
                                "reseller_id": 1,
                                "name": "Personal",
                                "ancestry": "1562",
                                "default_payment_method_id": 2,
                                "key": "personal",
                                "name_pattern": "%first_name %middle_name %last_name",
                                "use_by_default": false,
                                "primary_name": ""
                            }
                        }
                    ]
                },
                "plan_currency": "RUB",
                "custom_attributes": {}
            },
            "relationships": {
                "plan_category": {
                    "data": {
                        "id": "190",
                        "type": "plan_categories"
                    }
                }
            }
        }
    ],
    "links": {
        "self": "http://test.activeplatform.com/api/v3/resellers/1/child_reseller_plans/?page%5Bnumber%5D=78&page%5Bsize%5D=2",
        "first": "http://test.activeplatform.com/api/v3/resellers/1/child_reseller_plans/?page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "http://test.activeplatform.com/api/v3/resellers/1/child_reseller_plans/?page%5Bnumber%5D=77&page%5Bsize%5D=2",
        "next": "http://test.activeplatform.com/api/v3/resellers/1/child_reseller_plans/?page%5Bnumber%5D=79&page%5Bsize%5D=2",
        "last": "http://test.activeplatform.com/api/v3/resellers/1/child_reseller_plans/?page%5Bnumber%5D=242&page%5Bsize%5D=2"
    }
}