Функция Function productSet/import (http://<DOMAIN>/api/productSet/import/)
ПараметрыParameters:
- token - ключ авторизации полученный через функцию authauthorization key obtained through the auth function
- items[] - список комплектовlist of sets
- items[i].article - артикул комплекта (обязательный параметр). Должен быть уникальным в пределах комплектов и товаровarticle of the set (mandatory parameter). It must be unique within sets and items
- items[i].title - название комплекта. По умолчанию - "Вместе дешевлеname of the set. The default is "Cheaper Together"
- items[i].discountPercent - относительная скидка на комплект относительно исходной стоимостиrelative discount on the kit relative to the original price.
- items[i].initialPrice - исходная стоимость комплекта. Если не задана, то суммируется стоимость всех товаров комплектаinitial price of the set. If not specified, the cost of all items in the set is summarized
- items[i].discountedPrice - стоимость комплекта с учётом скидки. Если не задана, то будет рассчитана автоматически относительно параметров "initialPrice" и "discountPercent"the cost of the set with the discount taken into account. If not specified, it will be calculated automatically relative to the parameters "initialPrice" and "discountPercent".
- items[i].currency - ISO код валюты комплектаcurrency code of the set
- items[i].enabled - включение комплекта enable kit (boolean)
- items[i].sortOrder - порядок отображения комплекта. Чем ниже значение, тем выше приоритетorder of displaying the kit. The lower the value, the higher the priority
- items[i].products[] - список артикулов товаров которые формируют комплект. Не меньше двух и, по умолчанию, не больше пяти товаров (настройку можно изменить)list of items that form the kit. Not less than two and, by default, not more than five items (the setting can be changed).
- items[i].products[n] - артикул товара в комлекте
...
- article of the item in the set
Response:
- status - статус выполнения функцииstatus of the function execution
- OK - все комплекты товаров успешно добавлены/обновленыWARNING - один или несколько комплектов товаров не были добавлены/обновленыall sets of goods were successfully added/updated
- WARNING - one or more sets of goods were not added/updated
- response.log - журнал выполнения функции по каждой записиlog of function execution for each record
- response.log[i].article - артикул комплектаset article
- response.log[i][‘info’'info'][n].code - статус обновления записи (см. таблицу кодов нижеrecord update status (see the code table below)
- response.log[i][‘info’'info'][n].message - пояснение к коду
Коды журнала импорта комплекта
...
- code explanation
Set import log codes
Codes | Description |
---|---|
0 |
Set imported |
1 |
The "discountPercent" |
parameter must be an integer between 0 and 100 |
2 |
The parameter "initialPrice" |
must be a fractional number higher than 0 |
3 |
The "discountedPrice" |
Количество товаров в комплекте должно быть в пределе от 2 до "максимально допустимого количества настроенного на сайте"
parameter must be a fractional number higher than O | |
4 | The number of items in the set must be between 2 and the "maximum allowed number of items configured on the site". |
5 | The items in the set must not be repeated |
101 | The parameter "article" is mandatory |
102 | The set article cannot match the article of an existing product. |
103 | The "products" parameter is mandatory |
104 | Product with a certain article is not found |
105 | No article is specified for one of the items in the set |
106 | Currency not found |
400 | "The payload is not JSON". The request is made incorrectly. |
1000 | One of the products has an incorrect object type |
2000 | Unknown error |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "token": "24a75d0678c49a34030e35baeb376ff3", "items":[ { "article":"PRODUCT_SET_ARTICLE", "title":"PRODUCT_SET_TITLE", "discountPercent":5, "initialPrice":150, "discountedPrice":100, "currency":"UAH", "enabled":true, "sortOrder":1, "products":[ "2317217", "MB829", "MD810" ] }, { "article":"2317217", "title":"PRODUCT_SET_TITLE", "discountPercent":5, "initialPrice":150, "discountedPrice":100, "currency":"USD", "enabled":false, "sortOrder":2, "products":[ "2317217", "MB829", "MD810", "MGR32", "MGTR2", "MD565" ] } ] } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "status":"WARNING", "response":{ "log":[ { "article":"PRODUCT_SET_ARTICLE", "info":[ { "code":0, "message":"КомплектSet обновлёнimported" } ] }, { "article":"2317217", "info":[ { "code":102, "message":"АртикулThe set комплектаarticle \"2317217\" неcannot match можетthe совпадатьarticle сof артикуломan существующегоexisting товараproduct" } ] } ] } } |