Получение списка дополнительных атрибутов заказа

Метод используется для получения списка атрибутов, которые требуются на дополнительном шаге для создания заказа через Панель управления Клиента. Набор атрибутов зависит от услуги, модуля, на основе которого она создана, и номера шага.

GET {reseller_domain}/internal_api/plans/{plan_id}/order_attributes

В этой статье:

Авторизация

Требуется авторизация с помощью access token пользователя.

Аргументы

Название

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

Тип данных

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

Описание

Content-Type

header

string

Обязательный

Тип данных, передаваемых в запросе. Укажите application/vnd.api+json

Accept

header

string

Обязательный

Поддерживаемые типы данных в ответе. Укажите application/vnd.api+json

X-Api-Locale

header

string

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

Двухбуквенный код языка данных в ответе

Authorization 

header

string

Обязательный

Действующий access token пользователя. Формат: Bearer <access token>

reseller_domain

path

string

Обязательный

Доменное имя реселлера

plan_id

path

integer

Обязательный

ID тарифного плана, на который заказывается подписка

account_id

query

integer

Обязательный

ID аккаунта, для которого заказывается подписка

order_type

query

string

Обязательный

Тип заказа. Доступные значения:

  • SalesOrder — заказ на покупку.

  • SwitchPlanOrder — заказ на переключение тарифного плана.

  • RenewalOrder — заказ на продление.

  • ProlongOrder — заказ на пролонгацию.

  • ChangeOrder — заказ на изменение количества ресурсов.

plan_resource_ids[]

query

integer

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

ID заказанного ресурса. Если в заказе несколько ресурсов, укажите каждый из их в отдельном plan_resource_ids[]

plan_period_id

query

integer

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

ID заказанного периода тарифного плана

provisioning_date

query

string

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

Дата предоставления заказа в формате ДД.ММ.ГГГГ

async_task_id

query

string

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

ID асинхронной задачи, созданной ранее для валидации дополнительных параметров (см.

Валидация дополнительных атрибутов заказа

), указанных на первом шаге. Указывается на втором шаге, если заказ включает два дополнительных шага

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

Название

Тип данных

Описание

data

array of objects

Данные ответа


type

string

Тип данных


attributes

object

Информация об атрибутах для создания заказа указанного типа



order_attributes

array of objects

Список атрибутов




key

string

Ключ атрибута




label

string

Название атрибута. Может содержать ссылки




type

string

Тип данных атрибута:

  • string — cтрока. Позволяет вводить любой набор символов в виде однострочного текста.

  • text — текст. Позволяет вводить любой набор символов в виде многострочного текста.

  • date — дата. Позволяет выбирать дату из календаря.

  • password — пароль. Вводимые данные скрываются маской. 

  • list — список. Позволяет выбрать одно из предустановленных значений.

  • checkbox — логический тип. Отображается в виде флажка.

  • boolean — логический тип. Отображается в виде переключателя.

  • toggle — логический тип. Отображается в виде переключателя с выбором одного из предустановленных значений при включении.

  • radio — набор радиокнопок. Позволяет выбрать одно из значений.




default_value

зависит от атрибута

Значение атрибута по умолчанию




values

array of objects

  • Для атрибутов типа list и toggle — список доступных значений списка.

  • Для атрибутов других типов — пустой массив. См. также options.





id

string

ID доступного значения списка





date

string

Отображаемое значение списка в формате даты в соответствии с настройками реселлера (см.

Получение настроек реселлера

)





name

string

Название доступного значения списка. Может содержать HTML-теги





hint

array

Информационное сообщение для отображения в подсказке





additional_message

string

Информационное сообщение для отображения при выборе этого варианта. Может содержать HTML-теги




required

bool

Признак обязательности атрибута:

  • true — атрибут обязательный.

  • false — атрибут необязательный.




priority

integer

Приоритет атрибута — число, определяющее порядок отображения атрибутов на странице




plugin_slug

string

Ключ модуля, на основе которого создана услуга:

  • manual_provisioning

  • vendor_service

  • office365

  • microsoft_csp_products




level_applied_to

string

Уровень, на котором применяется атрибут:

  • application — услуга.

  • resource — ресурс.




level_information

array 

Информация об уровне, на котором применяется атрибут (только для level_applied_to = resource). Подробнее см. 






resource_id

integer

ID ресурса





resource_name

string

Название ресурса




hint

string

Подсказка для отображения на странице рядом с атрибутом




description

string

Дополнительная информация об атрибуте




options

array 

  • Для атрибутов типа radio — список вариантов выбора.

  • Для атрибутов других типов — пустой массив. См. также values.





value

string

Значение варианта выбора





label

string

Название варианта выбора



order_attributes_info

array of objects

Информация об атрибутах, которые уже заполнены




value

string

Значение атрибута




label

string

Название атрибута



common_message

object

Информационные сообщения для отображения на странице с атрибутами




key

string

Ключ сообщения




value

string

Текст сообщения. Может содержать HTML-теги



order_attributes_meta

object

Информация о шагах заполнения атрибутов




current_step

integer

Номер текущего шага




total_steps

integer

Общее количество шагов

meta

object

Дополнительная информация


server_current_time

string

Текущие дата и время сервера

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

Bash
curl --location --request GET 'https://test.activeplatform.com/internal_api/plans/6603/order_attributes?account_id=1185&order_type=SalesOrder&plan_resource_ids[]=3291&plan_resource_ids[]=5618&plan_period_id=11943&provisioning_date=31.12.2023' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Accept: application/vnd.api+json' \
--header 'X-Api-Locale: en' \
--header 'Authorization: Bearer AccessTokenExample'

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

Подписка на основе модуля Ручной провиженинг с атрибутами на уровне услуги и ресурса

JSON
{
    "data": [
        {
            "type": "order_attributes",
            "attributes": {
                "order_attributes": [
                    {
                        "key": "add_param_app",
                        "label": "Param for app",
                        "type": "string",
                        "default_value": "",
                        "values": [],
                        "required": true,
                        "priority": 1,
                        "plugin_slug": "manual_provisioning",
                        "level_applied_to": "application",
                        "level_information": {},
                        "hint": "",
                        "description": "",
                        "options": []
                    },
                    {
                        "key": "add_param_res_1",
                        "label": "Param for resource 1",
                        "type": "string",
                        "default_value": "",
                        "values": [],
                        "required": true,
                        "priority": 1,
                        "plugin_slug": "manual_provisioning",
                        "level_applied_to": "resource",
                        "level_information": {
                            "resource_id": 45461,
                            "resource_name": "res1"
                        },
                        "hint": "",
                        "description": "",
                        "options": []
                    },
                    {
                        "key": "add_param_res_2",
                        "label": "Param for resource 2",
                        "type": "string",
                        "default_value": "",
                        "values": [],
                        "required": true,
                        "priority": 1,
                        "plugin_slug": "manual_provisioning",
                        "level_applied_to": "resource",
                        "level_information": {
                            "resource_id": 45462,
                            "resource_name": "res2"
                        },
                        "hint": "",
                        "description": "",
                        "options": []
                    }
                ],
                "order_attributes_info": [],
                "common_message": null,
                "order_attributes_meta": {
                    "current_step": 1,
                    "total_steps": 1
                }
            }
        }
    ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка Google Workspace на основе модуля VSP (Vendor service plugin)

См. также .

JSON
{
    "data": [
        {
            "type": "order_attributes",
            "attributes": {
                "order_attributes": [
                    {
                        "label": "Domain name",
                        "type": "string",
                        "key": "domain_name",
                        "description": "Create a new domain in the Google Workspace service",
                        "priority": 1,
                        "required": false,
                        "default_value": "",
                        "hint": "Enter the domain name of your organization to which the Google Account will be registered, for example, example.com. You will need to confirm the ownership of the domain after the registration.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "options": []
                    },
                    {
                        "label": "Alternate customer email",
                        "type": "string",
                        "key": "customer_alternate_email",
                        "description": "",
                        "priority": 2,
                        "required": false,
                        "default_value": "",
                        "hint": "Specify alternate email as secondary contact used if something happens such as service outage or a security issue. Email should not contain the same domain as Domain name field.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "options": []
                    },
                    {
                        "label": "Administrator's account username",
                        "type": "string",
                        "key": "admin_login",
                        "description": "",
                        "priority": 3,
                        "required": false,
                        "default_value": "",
                        "hint": "Enter the name of the Account owner, for instance, admin. The name will be used as a login. The Account owner can add other Subscription users.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "options": []
                    },
                    {
                        "label": "Domain name",
                        "type": "string",
                        "key": "transfer_domain_name",
                        "description": "Use an existing domain in the Google Workspace service",
                        "priority": 4,
                        "required": false,
                        "default_value": "",
                        "hint": "Enter your main domain on Google, for instance, example.com.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "options": []
                    },
                    {
                        "label": "Transfer Token. Use the reseller code \"\" for generating Transfer Token. The Transfer Token is valid for 14 days from the date of creation. The order must be paid before the expiration of the Token's lifetime.",
                        "type": "string",
                        "key": "transfer_token",
                        "description": "",
                        "priority": 5,
                        "required": false,
                        "default_value": "",
                        "hint": "A Transfer Token is a 16-digit alphanumeric code that can be generated from the Google admin console by the <a class=\"link\" href=\"http://admin.google.com/TransferToken\" target=\"blank\">link</a>.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "options": []
                    }
                ],
                "order_attributes_info": [],
                "common_message": null,
                "order_attributes_meta": {
                    "current_step": 1,
                    "total_steps": 1
                }
            }
        }
    ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка Google Cloud Platform на основе модуля VSP (Vendor service plugin)

См. также .

JSON
{
    "data": [
        {
            "type": "order_attributes",
            "attributes": {
                "order_attributes": [
                    {
                        "label": "Billing subaccount name",
                        "type": "string",
                        "key": "billing_account_name",
                        "description": "",
                        "priority": 1,
                        "default_value": "",
                        "hint": "Fill in the name or domain of your organization, which will be used as a name of your subaccount on Google's side, for ex. 'Company.com'. The value will be displayed as part of subscription's name in ActivePlatform as well.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "required": true,
                        "options": []
                    },
                    {
                        "label": "Admin email",
                        "type": "string",
                        "key": "account_email",
                        "description": "",
                        "priority": 2,
                        "default_value": "",
                        "hint": "Fill in the email of a user, which will be set as an admin for your subaccount on Google's side. Please use your actual Google account.",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "required": true,
                        "options": []
                    },
                    {
                        "key": "customer_domain",
                        "type": "string",
                        "label": "Domain",
                        "description": "",
                        "priority": 3,
                        "hint": "Fill in the domain name of your organization, for ex. example.com.",
                        "default_value": "",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "required": true,
                        "options": []
                    }
                ],
                "order_attributes_info": [],
                "common_message": null,
                "order_attributes_meta": {
                    "current_step": 1,
                    "total_steps": 1
                }
            }
        }
    ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка AWS на основе модуля VSP (Vendor service plugin)

См. также .

JSON
{
    "data": [
        {
            "type": "order_attributes",
            "attributes": {
                "order_attributes": [
                    {
                        "label": "Choose an AWS account",
                        "type": "radio",
                        "key": "account_type",
                        "description": "",
                        "priority": 1,
                        "default_value": "NEW",
                        "hint": "",
                        "values": [],
                        "options": [
                            {
                                "value": "NEW",
                                "name": "Create a new AWS account"
                            },
                            {
                                "value": "EXIST",
                                "name": "Use an existing AWS account"
                            }
                        ],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "required": true
                    },
                    {
                        "label": "AWS account email",
                        "type": "string",
                        "key": "account_email",
                        "description": "",
                        "priority": 2,
                        "default_value": "",
                        "hint": "Specify your AWS account email address",
                        "values": [],
                        "plugin_slug": "vendor_service",
                        "level_applied_to": "application",
                        "level_information": {},
                        "required": true,
                        "options": []
                    }
                ],
                "order_attributes_info": [],
                "common_message": null,
                "order_attributes_meta": {
                    "current_step": 1,
                    "total_steps": 1
                }
            }
        }
    ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка Microsoft NCE на основе модуля MicrosoftCspProducts (аккаунт без Tenant ID, шаг 1)

См. также .

JSON
{
    "data": [
        {
            "type": "order_attributes",
            "attributes": {
                "order_attributes": [
                    {
                        "label": "New Microsoft Tenant Name",
                        "type": "boolean",
                        "key": "is_new_domain",
                        "values": [],
                        "priority": 1,
                        "plugin_slug": "microsoft_csp_products",
                        "level_applied_to": "application",
                        "required": true,
                        "default_value": "",
                        "hint": "",
                        "level_information": {},
                        "description": "",
                        "options": []
                    },
                    {
                        "label": "With Subdomain .onmicrosoft.com",
                        "type": "boolean",
                        "key": "with_subdomain",
                        "values": [],
                        "priority": 1,
                        "plugin_slug": "microsoft_csp_products",
                        "level_applied_to": "application",
                        "required": true,
                        "default_value": "",
                        "hint": "",
                        "level_information": {},
                        "description": "",
                        "options": []
                    },
                    {
                        "label": "Domain name Office 365",
                        "type": "string",
                        "key": "customer_domain",
                        "values": [],
                        "priority": 1,
                        "plugin_slug": "microsoft_csp_products",
                        "level_applied_to": "application",
                        "required": true,
                        "default_value": "",
                        "hint": "",
                        "level_information": {},
                        "description": "",
                        "options": []
                    },
                    {
                        "label": "I accept the agreement \u003ca class=\"link\" target=\"_blank\" href=\"https://www.microsoft.com/en-us/licensing/how-to-buy/microsoft-customer-agreement\"\u003e Microsoft Customer Agreement\u003c/a\u003e",
                        "type": "checkbox",
                        "key": "microsoft_customer_agreement",
                        "values": [],
                        "priority": 1,
                        "plugin_slug": "microsoft_csp_products",
                        "level_applied_to": "application",
                        "required": true,
                        "default_value": "",
                        "hint": "",
                        "level_information": {},
                        "description": "",
                        "options": []
                    }
                ],
                "order_attributes_info": [],
                "common_message": {
                    "key": "microsoft_csp_products",
                    "value": "Before addition of existing tenant, please, confirm invitation from \u003ca class=\"link\" target=\"_blank\" href=\"https://admin.microsoft.com/Adminportal/Home?invType=ResellerRelationship\u0026partnerId=XXXX\u0026msppId=0\u0026DAP=true#/BillingAccounts/partner-invitation\"\u003e Microsoft Cloud Solution Provider\u003c/a\u003e"
                },
                "order_attributes_meta": {
                    "current_step": 1,
                    "total_steps": 2
                }
            }
        }
    ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка Microsoft NCE на основе модуля MicrosoftCspProducts (аккаунт c Tenant ID, шаг 1)

См. также .

JSON
{
  "data": [
    {
      "type": "order_attributes",
      "attributes": {
        "order_attributes": [],
        "order_attributes_info": [
          {
            "value": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            "label": "Tenant ID"
          },
          {
            "value": "example.onmicrosoft.com",
            "label": "Tenant Name"
          }
        ],
        "common_message": null,
        "order_attributes_meta": {
          "current_step": 1,
          "total_steps": 2
        }
      }
    }
  ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка Microsoft NCE на основе модуля MicrosoftCspProducts (аккаунт c Tenant ID, шаг 2)

См. также .

JSON
{
  "data": [
    {
      "type": "order_attributes",
      "attributes": {
        "order_attributes": [
          {
            "label": "End date alignment",
            "type": "toggle",
            "key": "end_date_alignment",
            "values": [
              {
                "date": "2024-04-10",
                "name": "<b>10.04.2024</b> (1 subscription)",
                "hint": [
                  "Dynamics 365 Guides P1Y Annual (quantity 3) - 10.04.2024"
                ],
                "additional_message": null
              },
              {
                "date": "2024-04-11",
                "name": "<b>11.04.2024</b> (2 subscriptions)",
                "hint": [
                  "Dynamics 365 Business Central Premium P1Y Annual (quantity 1) - 11.04.2024",
                  "Dynamics 365 Business Central Essentials P1Y Annual (quantity 3) - 11.04.2024"
                ],
                "additional_message": null
              },
              {
                "date": "2024-05-01",
                "name": "<b>01.05.2024</b> (with calendar month)",
                "hint": [],
                "additional_message": null
              }
            ],
            "priority": 1,
            "plugin_slug": "microsoft_csp_products",
            "level_applied_to": "application",
            "hint": "Subscriptions are grouped by expiration date. By default, the \"Expiration date alignment\" switch is set to \"Off\" - this is a full period subscription order.",
            "required": true,
            "default_value": "",
            "level_information": {},
            "description": "",
            "options": []
          }
        ],
        "order_attributes_info": [
          {
            "value": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            "label": "Tenant ID"
          },
          {
            "value": "example.onmicrosoft.com",
            "label": "Tenant Name"
          }
        ],
        "common_message": {
          "key": "microsoft_csp_products",
          "value": "You can align the expiration date of new subscription:<br> <b>- with expiration date of one of the existing non-trial subscriptions for this account;</b><br> <b>- with 1-st day of calendar month;</b><br> The total subscription cost for the reduced period will be recalculated and displayed at the \"Confirmation\" step."
        },
        "order_attributes_meta": {
          "current_step": 2,
          "total_steps": 2
        }
      }
    }
  ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}

Подписка Microsoft Azure Plan на основе модуля MicrosoftCspProducts (аккаунт c Tenant ID, шаг 2)

См. также .

JSON
{
    "data": [
        {
            "type": "order_attributes",
            "attributes": {
                "order_attributes": [
                    {
                        "label": "Users email",
                        "type": "list",
                        "key": "user_emails",
                        "values": [
                            {
                                "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                                "name": "admin@example.onmicrosoft.com"
                            }
                        ],
                        "priority": 1,
                        "plugin_slug": "microsoft_csp_products",
                        "level_applied_to": "application",
                        "required": true,
                        "default_value": "",
                        "hint": "",
                        "level_information": {},
                        "description": "",
                        "options": []
                    }
                ],
                "order_attributes_info": [
                    {
                        "value": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                        "label": "Tenant ID"
                    },
                    {
                        "value": "example.onmicrosoft.com",
                        "label": "Tenant Name"
                    }
                ],
                "common_message": {
                    "key": "microsoft_csp_products",
                    "value": "You must assign administrator rights to a user to activate Azure Plan subscription. The drop-down list contains all users of the tenant for which the subscription is being ordered. Select a user from the list and click Next.\n"
                },
                "order_attributes_meta": {
                    "current_step": 2,
                    "total_steps": 2
                }
            }
        }
    ],
    "meta": {
        "server_current_time": "2023-06-30 T12:34:56.199973+0300"
    }
}