{"openapi":"3.0.3","info":{"version":"2.3.3","title":"1C to Euroimpulse API"},"servers":[{"url":"http://ei.local/api/v2","description":"Локальный тестовый сервер","variables":{"auth_test_token":{"default":"GYWxbjpVzYW1"}}},{"url":"https://ei.spb.ru/api/v2","description":"Петербургский (РФ) боевой сервер"},{"url":"https://sttech.lt/api/v2","description":"Литовский боевой сервер"},{"url":"https://baumuller.kz/api/v2","description":"Казахский боевой сервер"}],"security":[{"BearerToken":[]}],"tags":[{"name":"Orders","description":"Заказы"},{"name":"Products","description":"Продукция"},{"name":"Categories","description":"Категории продукции"}],"paths":{"/order":{"post":{"summary":"Обновление данных о заказе","description":"Обновляет все доступные параметры заказа и инициирует отправку соответствующих писем.","operationId":"updateStatus","tags":["Orders"],"requestBody":{"description":"Данные статуса","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"examples":{"Принят в обработку":{"description":"Новый заказ в очереди на обработку","value":{"orderNumber":"000000123","status":1}},"Взят в работу менеджером":{"description":"Ваш заказ взят в работу менеджером","value":{"orderUID":"LT1234","orderNumber":"000000123","status":2,"managerName":"Иванов Иван Иванович","managerMail":"mail@ei.spb.ru","managerPhone":"+79213215487"}},"Цена и сроки поставки подтверждены":{"description":"Цена и сроки поставки подтверждены производителем, счёт и договор во вложении.","value":{"orderNumber":"000000123","status":4,"planDeliverDate":"2021-12-20","products":[{"ID_1C":"000054849","quantity":38,"cur":"EUR","price":847.37},{"ID_1C":"000042321","quantity":12,"cur":"RUB","price":12400}]}},"Планируемая дата поставки":{"description":"Ваш заказ размещён, планируемая дата поставки","value":{"orderNumber":"000000123","status":6,"planDeliverDate":"2021-12-31"}},"Трек номер":{"description":"Заказ передан в службу доставки","value":{"orderNumber":"000000123","status":7,"track":"ABC2387623497863498","track_service":"СДЭК https://www.cdek.ru/"}},"Полный набор возможных данных":{"description":"Пример содержит все возможные данные","value":{"orderUID":"LT1234","orderNumber":"000000123","status":3,"managerName":"Иванов Иван Иванович","managerMail":"mail@ei.spb.ru","managerPhone":"+79213215487","planDeliverDate":"2021-12-31","track":"ABC2387623497863498","track_service":"СДЭК https://www.cdek.ru/","products":[{"ID_1C":"000054849","quantity":38,"cur":"EUR","price":847.37},{"ID_1C":"000042321","quantity":12,"cur":"RUB","price":12400}]}}}}}},"responses":{"200":{"$ref":"#/components/responses/Success"},"400":{"$ref":"#/components/responses/IncorrectStatusRequest"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"default":{"$ref":"#/components/responses/Error"}}}},"/category":{"post":{"summary":"Добавление или обновление категории товара","description":"Добавление или обновление товарной категории в каталоге.\n","tags":["Categories"],"requestBody":{"description":"Данные о категории","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"responses":{"200":{"description":"Успех - Найденная категория обновлена","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Категория обновлена"}}}}}},"201":{"description":"Успех - Категория добавлена","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Категория добавлена"}}}}}},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"default":{"$ref":"#/components/responses/Error"}}},"put":{"summary":"Добавление категории товара","description":"Добавление товарной категории в каталоге.\n","tags":["Categories"],"requestBody":{"description":"Данные о категории","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"responses":{"200":{"description":"Успех - Найденная категория обновлена","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Категория обновлена"}}}}}},"201":{"description":"Успех - Категория добавлена","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Категория добавлена"}}}}}},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"default":{"$ref":"#/components/responses/Error"}}}},"/product":{"post":{"summary":"Добавление или обновление товара","description":"Обновление сведений о товаре или его добавление в товарном каталоге. Может применяться в любой момент. Идемпотентен. Присутствует наравне с PUT для совместимости.\n","tags":["Products"],"requestBody":{"description":"Данные о товаре","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"200":{"description":"Успех - Найденный товар обновлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Товар добавлен"}}}}}},"201":{"description":"Успех - Новый товар добавлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Товар добавлен"}}}}}},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"409":{"description":"Товар с таким ID_STC уже существует, но с другим ID_1C"},"default":{"$ref":"#/components/responses/Error"}}},"put":{"summary":"Добавление или обновление товара","description":"Обновление сведений о товаре или его добавление в товарном каталоге. Может применяться в любой момент. Идемпотентен.\n","tags":["Products"],"requestBody":{"description":"Данные о товаре","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"200":{"description":"Успех - Найденный товар обновлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Товар добавлен"}}}}}},"201":{"description":"Успех - Новый товар добавлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Товар добавлен"}}}}}},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"409":{"description":"Товар с таким ID_STC или partnumber уже существует, но с другим ID_1C"},"default":{"$ref":"#/components/responses/Error"}}}},"/product/{id}":{"delete":{"summary":"Удаление товара","description":"Удаление товара из товарного каталога на сайте. Фактически он будет просто скрыт и не доступен для новых заказов, но останется в старых заказах.","tags":["Products"],"parameters":[{"in":"path","name":"id","required":true,"description":"Артикул товара из номенклатуры 1С","example":"000001234","schema":{"type":"string"}}],"responses":{"200":{"description":"Успех - товар не удален, но скрыт из каталога, потому что использован в одном или нескольких заказах.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Товар скрыт"}}}}}},"204":{"description":"Успех - товар успешно удален"},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"404":{"description":"Товар не существует"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"default":{"$ref":"#/components/responses/Error"}}}},"/brand":{"post":{"summary":"Добавление или обновление бренда","description":"Обновление сведений о бренде. Может применяться в любой момент. Идемпотентен. Присутствует наравне с PUT для совместимости.\n","tags":["Brands"],"requestBody":{"description":"Данные о бренде","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"},"examples":{"Обращение по коду":{"description":"Обращение по коду","value":{"name":"Samsung","code":"0000123","managerId":2}},"Обращение по номеру":{"description":"Обращение по номеру","value":{"name":"Samsung","number":123,"managerId":2}},"Смена менеджера":{"description":"Обновление менеджера бренда по коду","value":{"code":"0000123","managerId":2}}}}}},"responses":{"200":{"description":"Успех - Найденный бренд обновлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Бренд обновлен"}}}}}},"201":{"description":"Успех - Новый бренд добавлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Бренд добавлен"}}}}}},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"default":{"$ref":"#/components/responses/Error"}}},"put":{"summary":"Добавление или обновление бренда","description":"Обновление сведений о товаре или его добавление в товарном каталоге. Может применяться в любой момент. Идемпотентен.\n","tags":["Brands"],"requestBody":{"description":"Данные о товаре","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"},"examples":{"Обращение по коду":{"description":"Обращение по коду","value":{"name":"Samsung","code":"0000123","managerId":2}},"Обращение по номеру":{"description":"Обращение по номеру","value":{"name":"Samsung","number":123,"managerId":2}},"Смена менеджера":{"description":"Обновление менеджера бренда по коду","value":{"code":"0000123","managerId":2}}}}}},"responses":{"200":{"description":"Успех - Найденный бренд обновлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Бренд обновлен"}}}}}},"201":{"description":"Успех - Новый бренд добавлен","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","default":"error"},"message":{"type":"string","example":"Бренд добавлен"}}}}}},"400":{"description":"Некорректный запрос. Смотри детали в параметре message"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ActionDenied"},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer"}},"responses":{"ActionDenied":{"description":"Действие запрещено или некорректный токен"},"UnauthorizedError":{"description":"Токен авторизации отсутствует"},"IncorrectStatusRequest":{"description":"Некорректный формат запроса или некорректные данные","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string","example":"Error in request: Выбранное значение для order id некорректно."}}}}}},"Error":{"description":"Ошибка","content":{"application/json":{"schema":{"type":"object","required":["status","message"],"properties":{"status":{"type":"string","default":"error","example":"error"},"message":{"type":"string","example":"Описание ошибки"}}}}}},"Success":{"description":"Успех","content":{"application/json":{"schema":{"type":"object","required":["status","message"],"properties":{"status":{"type":"string","default":"ok","example":"ok"},"message":{"type":"string","example":"Статус обновлен"}}}}}}},"schemas":{"Status":{"type":"object","required":["orderUID","status"],"properties":{"orderUID":{"type":"string","description":"Номер, присвоенный заказу на сайте. Префикс идентифицирует привязку к домену.","anyOf":[{"example":"LT1234"},{"example":"RU534643"},{"example":"KK43"}]},"orderNumber":{"type":"string","description":"Номер, присвоенный заказу в 1С","example":"000000123"},"status":{"type":"integer","format":"int32","minimum":0,"maximum":9,"description":"Новый статус заказа","example":3},"managerName":{"type":"string","maxLength":200,"description":"Новое ФИО менеджера заказа","example":"Иванов Иван Иванович"},"managerMail":{"type":"string","description":"Новый Email менеджера заказа","example":"mail@ei.spb.ru"},"managerPhone":{"type":"string","description":"Новый Телефон менеджера заказа","example":"+79213215487"},"managerId":{"type":"integer","format":"int32","minimum":1,"maximum":99,"description":"Порядковый номер менеджера. Например: 3 соответствует sale3 (или как задано в базе сайта)","example":3},"planDeliverDate":{"type":"string","description":"Планируемая дата поставки (в формате Y-m-d)","example":"2021-12-31"},"track":{"type":"string","description":"Трек-номер для отслеживания поставки","example":"ABC2387623497863498"},"track_service":{"type":"string","description":"Наименование службы доставки, чей трек-номер предоставлен","example":"СДЭК https://www.cdek.ru/"},"products":{"type":"array","items":{"$ref":"#/components/schemas/OrderProduct"}}}},"OrderProduct":{"type":"object","properties":{"ID_1C":{"type":"string","description":"Артикул товара из номенклатуры 1С","example":"000054849"},"quantity":{"type":"integer","format":"int32","minimum":1,"description":"Кол-во товара. Если передан 0, то товар будет удален из заказа.","example":38},"cur":{"type":"string","minLength":3,"maxLength":3,"description":"Валюта (код АЛЬФА-3)","example":"EUR"},"price":{"type":"integer","format":"float","minimum":0,"description":"Установленная цена товара для текущего заказа (в указанной валюте)","example":847.37}}},"Category":{"type":"object","required":["code","number","name"],"properties":{"code":{"type":"string","description":"Артикул товарной категории из номенклатуры 1С (код)","example":"000054849"},"number":{"type":"number","description":"Номер товарной категории в 1С","example":"00085542"},"name":{"type":"string","description":"Наименование категории","example":"Напольные акустические системы"}}},"Product":{"type":"object","required":["ID_1C"],"properties":{"ID_1C":{"type":"string","description":"Артикул товара из номенклатуры 1С","example":"000054849"},"ID_STC":{"type":"string","description":"STCnnnxxxxxx (где nnn - номер раздела, а xxxxxx - номер товара в разделе)","example":"STC015054849"},"name":{"type":"string","description":"Наименование товара","example":"3D-Blu-Ray-театр с напольной акустикой, HT-E6750W"},"specifications":{"type":"string","description":"Описание","example":"3D Blu-Ray система 7.1 Звук Hi-Fi качества отличается богатством тончайших оттенков Профессиональный звук: теперь и в вашей гостиной! Технология вакуумных радиолам, используемая в домашней системе развлечений Samsung, обеспечивает полное погружение в события, происходящие на экране. Усилитель, в котором используются традиционные радиолампы, придает звуку теплоту, поскольку звук отличается практически полным отсутствием шумов и искажений. Гармония необыкновенной чистоты звука и элегантного дизайна\n"},"partnumber":{"type":"string","description":"Артикул производителя (партийный номер модели)","example":"HT-E6750W"},"brand":{"type":"object","required":["name"],"properties":{"number":{"type":"number","format":"int32","description":"Номер бренда в 1С","example":1855},"code":{"type":"string","description":"Код бренда в 1С","example":"0000001855"},"name":{"type":"string","description":"Наименование бренда производителя","example":"Samsung"}},"description":"Бренд производителя товара. Указывается код бренда как в 1С и наименование. Если бренд не будет найден, то он добавится в виде нового. Если будет найден по коду, то его наименование будет обновлено.\n"},"category":{"type":"object","properties":{"number":{"type":"number","format":"int32","description":"Номер категории (раздела) в 1С","example":15},"code":{"type":"string","description":"Код категории (раздела) в 1С","example":13},"name":{"type":"string","description":"Наименование категории (раздела)","example":"Напольные акустические системы"}},"description":"Категория товара (раздела). Указывается код раздела как в 1С и наименование. Если категория не будет найдена, то она добавится в виде новой корневой категории. Если будет найдена по коду, то её наименование будет обновлено.\n"},"price":{"type":"number","format":"float","minimum":0,"description":"Закупочная цена (ЦенаПродажиБезНДС). Для \"Позвоните менеджеру\" передавать пустую строку","example":838.98},"price_custom":{"type":"number","format":"float","minimum":0,"description":"Цена для отображения на сайте. Генерируется путем добавления к price 1%, 2% или 3%-надбавки, случайным образом.\n","example":847.37},"cur":{"type":"string","minLength":3,"maxLength":3,"description":"Валюта (код АЛЬФА-3)","example":"USD"},"min_delivery_time":{"type":"integer","format":"int32","minimum":0,"maximum":365,"description":"Минимальный срок поставки (в днях)","example":14},"max_delivery_time":{"type":"integer","format":"int32","minimum":0,"maximum":365,"description":"Максимальный срок поставки (в днях)","example":90}}},"Brand":{"type":"object","required":["name"],"description":"Бренд производителя товара","properties":{"name":{"type":"string","description":"Наименование бренда производителя","example":"Samsung"},"code":{"type":"string","description":"Код бренда в 1С","example":"0000001855"},"number":{"type":"number","description":"Номер бренда в 1С","example":1855},"managerId":{"type":"integer","format":"int32","description":"Id менеджера из базы данных сайта","minimum":1,"maximum":99,"example":3}}}}}}