{"openapi":"3.0.0","info":{"title":"9-18 Loyalty API","description":"API для работы с программой лояльности 9-18","version":"1.0.0"},"paths":{"/v3/partner/loyalty/shop/":{"get":{"tags":["Магазин"],"summary":"Получение информации о ПЛ магазина","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/shop_info_response"}}}}}},"post":{"tags":["Магазин"],"summary":"Сохранение информации о ПЛ магазина","requestBody":{"description":"Тестовое описание","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/shop_info_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/shop/status/":{"get":{"tags":["Магазин"],"summary":"Получение статуса ПЛ магазина","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_shop_status_response"}}}}}},"post":{"tags":["Магазин"],"summary":"Сохранение статуса ПЛ магазина","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_shop_status_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/shop/install/":{"post":{"tags":["Магазин"],"summary":"Первоначальная установка ПЛ магазина","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_shop_install_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/shop/visability/":{"post":{"tags":["Магазин"],"summary":"Установка видимости ПЛ магазина","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"VISABILITY":{"type":"string","enum":["all","auth","loyalty_members"]}},"example":{"VISABILITY":"loyalty_members"}}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/clients/list/":{"get":{"tags":["Клиенты"],"summary":"Получает список всех клиентов ПЛ с пагинацией","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_clients_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_clients_response"}}}}}}},"/v3/partner/loyalty/clients/add/":{"post":{"tags":["Клиенты"],"summary":"Массово включает клиенту/клиентам доступ к ПЛ","requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"clients":{"type":"array","items":{"type":"integer"}}},"example":{"clients":[1523,1231,272,12]}}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/clients/remove/":{"post":{"tags":["Клиенты"],"summary":"Массово отключает клиенту/клиентам доступ к ПЛ","requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"clients":{"type":"array","items":{"type":"integer"}}},"example":{"clients":[1523,1231,272,12]}}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/clients/info/{id}/":{"get":{"tags":["Клиент"],"summary":"Получает всю информацию о ПЛ клиента (баланс, статус, ближайшие сгорания, сумма выкупа, операции)","parameters":[{"name":"id","in":"path","required":true,"description":"ID клиента","schema":{"type":"integer"}}],"responses":{"200":{"description":"Успешно"}}}},"/v3/partner/loyalty/clients/{id}/set_status/":{"post":{"tags":["Клиент"],"summary":"Устанавливает новый статус клиенту","parameters":[{"name":"id","in":"path","required":true,"description":"ID клиента","schema":{"type":"integer"}}],"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/multipliers/":{"get":{"tags":["Повышающие коэффициенты"],"summary":"Получает список правил повыщающих коэффициентов","responses":{"200":{"description":"Успешно"}}},"post":{"tags":["Повышающие коэффициенты"],"summary":"Сохраняет список правил повыщающих коэффициентов","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/multipliers/delete/{id}/":{"post":{"tags":["Повышающие коэффициенты"],"summary":"Удаляет запись повышенного коэффициента с указанным ID","parameters":[{"name":"id","in":"path","required":true,"description":"ID записи","schema":{"type":"integer"}}],"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/excluded_sections/":{"get":{"tags":["Исключенные секции"],"summary":"Получает список исключенных секций","responses":{"200":{"description":"Успешно"}}},"post":{"tags":["Исключенные секции"],"summary":"сохраняет список исключенных секций","responses":{"200":{"description":"Успешно"}}}},"/v3/partner/loyalty/statuses/":{"get":{"tags":["Статусы"],"summary":"Получает список статусов магазина партнера","responses":{"200":{"description":"Успешно"}}},"post":{"tags":["Статусы"],"summary":"Сохраняет список статусов магазина партнера","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/statuses/delete/{id}/":{"post":{"tags":["Статусы"],"summary":"Удаляет статус партнера с указанным ID","parameters":[{"name":"id","in":"path","required":true,"description":"ID клиента","schema":{"type":"integer"}}],"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/statuses/{id}/":{"get":{"tags":["Статусы"],"summary":"Получает всю информацию о статусе","parameters":[{"name":"id","in":"path","required":true,"description":"ID статуса","schema":{"type":"integer"}}],"responses":{"200":{"description":"Успешно"}}}},"/v3/partner/loyalty/tm/":{"get":{"tags":["Торговые марки"],"summary":"Получает список торговых марок магазина и их множители","responses":{"200":{"description":"Успешно"}}},"post":{"tags":["Торговые марки"],"summary":"Сохраняет список торговых марок магазина и их множители","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/partner/loyalty/operations/list/":{"get":{"tags":["Операции"],"summary":"Получает список всех операций магазина","responses":{"200":{"description":"Успешно"}}}},"/v3/partner/loyalty/operations/get/{id}/":{"get":{"tags":["Операции"],"summary":"Получает всю информацию об операции","parameters":[{"name":"id","in":"path","required":true,"description":"ID операции","schema":{"type":"integer"}}],"responses":{"200":{"description":"Успешно"}}}},"/v3/partner/loyalty/operations/add/":{"post":{"tags":["Операции"],"summary":"Добавляет новую операцию","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/succes_post_response"},{"$ref":"#/components/schemas/error_post_response"}]}}}}}}},"/v3/api/client/basket/loyalty/get/":{"get":{"tags":["Корзина"],"summary":"Получает содержимое корзины за баллы,","requestBody":{"description":"Параметры для авторизации пользователя","required":true,"content":{"application/json":{"schema":{"properties":{"user_code":{"type":"string"},"shop_id":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_get_response"}}}}}}},"/v3/api/client/basket/loyalty/count/":{"get":{"tags":["Корзина"],"summary":"Получает кол-во товаров и сумму заказов за баллы","requestBody":{"description":"Параметры для авторизации пользователя","required":true,"content":{"application/json":{"schema":{"properties":{"user_code":{"type":"string"},"shop_id":{"type":"integer"}}}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_get_response"}}}}}}},"/v3/api/client/basket/loyalty/add/":{"post":{"tags":["Корзина"],"summary":"Добавляет товар в корзину за баллы","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_add_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_add_response"}}}}}}},"/v3/api/client/basket/loyalty/move/":{"post":{"tags":["Корзина"],"summary":"Перемещает товар в корзину за баллы","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_add_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_add_response"}}}}}}},"/v3/api/client/basket/loyalty/delete/":{"post":{"tags":["Корзина"],"summary":"Удаляет товар из корзины за баллы","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_add_request"}}}},"responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/loyalty_basket_add_response"}}}}}}},"/v3/api/client/order_basket/loyalty/create/":{"post":{"tags":["Корзина"],"summary":"Создает заказ за баллы","responses":{"200":{"description":"Успешно","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/create_order_success_response"},{"$ref":"#/components/schemas/create_order_error_response"}]}}}}}}}},"components":{"schemas":{"succes_post_response":{"description":"Ответ сервера при успешном выполнении POST запроса","properties":{"METHOD_SUCCESS":{"type":"object","properties":{"MESSAGE":{"type":"string"},"SUCCESS":{"type":"string"}}}},"example":{"MESSAGE":"","SUCCESS":"Y"}},"error_post_response":{"description":"Ответ сервера при неудачном выполнении POST запроса","properties":{"METHOD_SUCCESS":{"type":"object","properties":{"MESSAGE":{"type":"string"},"SUCCESS":{"type":"string"}}}},"example":{"MESSAGE":"Текст ошибки","SUCCESS":"N"}},"shop_info_response":{"description":"Информация о ПЛ магазина","properties":{"ITEM":{"type":"object","properties":{"VISABILITY":{"type":"string"},"TITLE":{"type":"string"},"LOGO":{"type":"string"},"DESCRIPTION":{"type":"string"},"ENABLE_NEW_CLIENT":{"type":"boolean"},"Multipliers":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"MARKUP_FROM":{"type":"integer"},"MARKUP_TO":{"type":"integer"},"MARKUP_PERCENT_FROM":{"type":"integer"},"MARKUP_PERCENT_TO":{"type":"integer"}}}},"Statuses":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TITLE":{"type":"string"},"MULTIPLIER":{"type":"integer"},"SUM_FOR_UP":{"type":"integer"},"SORT":{"type":"integer"},"IS_DEFAULT":{"type":"boolean"}}}},"Tm":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TM":{"type":"string"},"MULTIPLIER":{"type":"integer"}}}}}},"ENTITIES":{"type":"object","properties":{"VISABILITY":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"NAME":{"type":"string"}}},"example":{"all":{"ID":0,"NAME":"Для всех"},"auth":{"ID":1,"NAME":"Только авторизованным"},"loyalty_members":{"ID":2,"NAME":"Только участникам ПЛ"}}}}},"DEFAULT":{"type":"object","properties":{"Tm":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TM":{"type":"string"},"MULTIPLIER":{"type":"integer"}}}},"Statuses":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TITLE":{"type":"string"},"MULTIPLIER":{"type":"integer"},"SUM_FOR_UP":{"type":"integer"},"SORT":{"type":"integer"},"IS_DEFAULT":{"type":"boolean"}}}}}}}},"shop_info_request":{"description":"Описание ПЛ магазина","properties":{"TITLE":{"type":"string"},"LOGO":{"type":"string"},"DESCRIPTION":{"type":"string"},"ENABLE_NEW_CLIENTS":{"type":"boolean"}}},"loyalty_shop_status_response":{"description":"Статус ПЛ магазина","properties":{"STATUS":{"type":"string"}},"example":{"ПЛ включена":{"value":{"STATUS":"ON"}},"ПЛ выключена":{"value":{"STATUS":"OFF"}}}},"loyalty_shop_status_request":{"description":"Новый статус ПЛ магазина","properties":{"STATUS":{"type":"string"}},"example":{"Отключение ПЛ":{"value":{"STATUS":"OFF"}},"Включение ПЛ":{"value":{"STATUS":"ON"}}}},"loyalty_shop_install_request":{"description":"Подключеие ПЛ магазину","properties":{"TITLE":{"type":"string"},"LOGO":{"type":"string"},"DESCRIPTION":{"type":"string"},"Multipliers":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"MARKUP_FROM":{"type":"integer"},"MARKUP_TO":{"type":"integer"},"MARKUP_PERCENT_FROM":{"type":"integer"},"MARKUP_PERCENT_TO":{"type":"integer"}}}},"Statuses":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TITLE":{"type":"string"},"MULTIPLIER":{"type":"integer"},"SUM_FOR_UP":{"type":"integer"},"SORT":{"type":"integer"},"IS_DEFAULT":{"type":"boolean"}}}},"Tm":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TM":{"type":"string"},"MULTIPLIER":{"type":"integer"}}}}}},"loyalty_basket_add_request":{"description":"Параметры при добавлении/перемещении товаров в корзину за баллы","properties":{"products[]":{"type":"array"},"user_code":{"type":"string"},"shop_id":{"type":"integer"}},"example":{"products[5431]":1,"user_code":"8ceaa798-e96b-40c8-800d-9e365a1db166","shop_id":290}},"basket_block":{"description":"Блок ответа BASKET","properties":{"BASKET":{"type":"object","properties":{"CNT":{"type":"integer"},"SUM":{"type":"integer"}}}}},"shop_info_block":{"description":"Блок ответа SHOP_INFO","properties":{"SHOP_INFO":{"type":"object","properties":{"PAYMENT_TYPE":{"type":"array","items":{"type":"object","properties":{"CODE":{"type":"string"},"NAME":{"type":"string"},"NEED_OFFER":{"type":"boolean"}}}},"TAX_TYPE":{"type":"object","properties":{"CODE":{"type":"string"},"NAME":{"type":"string"}}},"CURRENCY":{"type":"string"},"MIN_ORDER_SUM":{"type":"integer"},"CHECK_ORDER_SUM":{"type":"integer"},"SELFDELIVERY_ONLY":{"type":"integer"},"DELIVERY_ZONE":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"NAME":{"type":"string"},"DESCRIPTION":{"type":"string"},"MIN_SUM":{"type":"integer"},"DELIVERY_PRICE":{"type":"integer"}}}}}}}},"products_block":{"description":"Блок ответа PRODUCTS","properties":{"PRODUCTS":{"type":"array","items":{"type":"object","properties":{"QUANTITY":{"type":"integer"},"CURRENCY":{"type":"string"},"PRICE":{"type":"integer"},"NAME":{"type":"string"},"PREVIEW_PICTURE_PATH":{"type":"string"},"ID":{"type":"string"},"SECTION_ID":{"type":"string"},"TOTAL_PRICE":{"type":"integer"}}}}}},"check_block":{"description":"Блок ответа CHECK","properties":{"CHECK":{"type":"object","properties":{"ID":{"type":"string"},"CODE":{"type":"string"},"TYPE":{"type":"string"},"TEXT":{"type":"string"},"CNT":{"type":"integer"},"BUTTON":{"type":"array","items":{"type":"object","properties":{"CODE":{"type":"string"},"TEXT":{"type":"string"}}}},"PRODUCTS":{"type":"array","items":{"type":"object","properties":{"QUANTITY":{"type":"integer"},"CURRENCY":{"type":"string"},"UP_MULTIPLICITY":{"type":"object","properties":{"MIN":{"type":"integer"},"STEP":{"type":"integer"},"POSITION":{"type":"integer"},"HTML":{"type":"string"},"POSITION_PRICE":{"type":"integer"}}},"SPECIAL":{"type":"boolean"},"PRICE":{"type":"integer"},"SPECIL_PRICE":{"type":"integer"},"SPECIAL_PERCENT":{"type":"integer"},"TO_ORDER":{"type":"boolean"},"UP_BARCODE":{"type":"string"},"UP_CODE_1C":{"type":"string"},"UP_COUNTRY":{"type":"object","properties":{"ID":{"type":"number"},"TITLE":{"type":"string"}}},"UP_ARTICLE":{"type":"string"},"UP_TM":{"type":"object","properties":{"ID":{"type":"number"},"TITLE":{"type":"string"}}},"NAME":{"type":"string"},"PREVIEW_PICTURE_PATH":{"type":"string"},"ID":{"type":"string"},"SECTION_ID":{"type":"string"},"FAVORITE":{"type":"boolean"},"DELIVERY_EXCLUDE":{"type":"boolean"},"REMAIN":{"type":"number"},"TOTAL_PRICE":{"type":"number"},"INFO":{"type":"object","properties":{"CODE":{"type":"string"},"TYPE":{"type":"string"},"TEXT":{"type":"string"},"SHOW_TEXT":{"type":"string"},"BLOCK":{"type":"array","items":{"type":"string","properties":{"SHOW_PRICE":{"type":"string"},"SHOW_FAVORITE":{"type":"string"},"SHOW_CNT":{"type":"string"},"SHOW_SUM":{"type":"string"},"SHOW_ANALOG_BTN":{"type":"string"}}}}}}}}}}}}},"create_order_block":{"description":"Блок ответа CREATE_ORDER","properties":{"CREATE_ORDER":{"type":"object","properties":{"MESSAGE":{"type":"object","properties":{"CODE":{"type":"string"},"TYPE":{"type":"string"},"TEXT":{"type":"string"},"SHOW_ADDRESS":{"type":"boolean"}}},"CREATE":{"type":"boolean"}}}}},"sort_block":{"description":"Блок ответа SORT","properties":{"SORT":{"type":"array","items":{"type":"object","items":{"properties":{"TITLE":{"type":"string"},"SORT":{"type":"string"},"ORDER":{"type":"string"}}}}}}},"loyalty_basket_add_response":{"description":"Ответ сервера при добавлении/перемещении товара в корзину за баллы","properties":{"BASKET":{"type":"object","properties":{"CNT":{"type":"integer"},"SUM":{"type":"integer"}}},"METHOD_SUCCESS":{"type":"object","properties":{"MESSAGE":{"type":"string"},"SUCCESS":{"type":"string"}}}}},"loyalty_basket_get_response":{"description":"Ответ сервера при запросе корзины за баллы","properties":{"BASKET":{"type":"object","properties":{"CNT":{"type":"integer"},"SUM":{"type":"integer"}}},"PRODUCTS":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"NAME":{"type":"string"},"PREVIEW_PICTURE_PATH":{"type":"string"},"PRICE":{"type":"integer"},"QUANTITY":{"type":"integer"},"SECTION_ID":{"type":"integer"},"TOTAL_PRICE":{"type":"integer"}}}}}},"create_order_success_response":{"description":"Ответ сервера при успешном создании заказа","properties":{"response":{"type":"object","properties":{"ORDER_ID":{"type":"integer"},"METHOD_SUCCESS":{"type":"object","properties":{"SUCCESS":{"type":"string"},"MESSAGE":{"type":"string"}}}}}}},"create_order_error_response":{"description":"Ответ сервера при неудачном создании заказа","properties":{"response":{"type":"object","properties":{"BASKET":{"$ref":"#/components/schemas/basket_block"},"SHOP_INFO":{"$ref":"#/components/schemas/shop_info_block"},"CHECK":{"$ref":"#/components/schemas/check_block"},"CREATE_ORDER":{"$ref":"#/components/schemas/create_order_block"},"SORT":{"$ref":"#/components/schemas/sort_block"},"METHOD_SUCCESS":{"type":"object","properties":{"SUCCESS":{"type":"string"},"MESSAGE":{"type":"string"}}}}}}},"loyalty_clients_request":{"description":"Запрос для получения членов ПЛ магазина","properties":{"query":{"type":"string"},"limit":{"type":"integer"},"offset":{"type":"integer"},"sort":{"type":"string","enum":["NAME","STATUS","BALANCE","CARD_CODE"]},"order":{"type":"string","enum":["ASC","DESC"]}}},"loyalty_clients_response":{"description":"Ответ сервера при получении членов ПЛ магазина","properties":{"NAV":{"type":"object","properties":{"CNT":{"type":"integer"},"NEW_CNT":{"type":"integer"}}},"ITEMS":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"string"},"NAME":{"type":"string"},"STATUS":{"type":"string"},"BALANCE":{"type":"integer"},"CARD_CODE":{"type":"string"}}}},"ENTITIES":{"type":"object","properties":{"STATUSES":{"type":"array","items":{"type":"object","properties":{"ID":{"type":"integer"},"TITLE":{"type":"string"},"MULTIPLIER":{"type":"integer"},"SUM_FOR_UP":{"type":"integer"},"SORT":{"type":"integer"},"IS_DEFAULT":{"type":"boolean"}}}}}}}}}}}