{"openapi":"3.1.0","info":{"title":"Документация по SelSup API","description":"API SelSup — программный интерфейс для работы с сервисом SelSup. Даёт возможность работать со всеми функциями SelSup из вашей системы. Для использования API добавьте новый токен на странице:https://selsup.ru/application/integration/api. Добавленный токен необходимо передавать во всех запросах к API SelSup, в заголовке Authorization.","contact":{"name":"Support Team","email":"admin@selsup.ru"},"license":{"name":"Apache 2.0","url":"https://selsup.ru/dogovor-offerta/"},"version":"1.0"},"servers":[{"url":"http://localhost:9050/"}],"tags":[{"name":"Конкуренты","description":"Работа с карточками конкурентов для моделей товаров"}],"paths":{"/api/competitor/{competitorId}":{"put":{"tags":["Конкуренты"],"summary":"Редактировать карточку конкурента","description":"Редактировать карточку конкурента по его id","operationId":"update","parameters":[{"name":"competitorId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Competitor"}}},"required":true},"responses":{"200":{"description":"OK"}}},"delete":{"tags":["Конкуренты"],"summary":"Удалить карточку конкурента","description":"Удалить карточку конкурента по его id","operationId":"delete","parameters":[{"name":"competitorId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"}}}},"/api/competitor/{modelId}":{"get":{"tags":["Конкуренты"],"summary":"Получить список всех конкурентов для модели","description":"Получить список всех конкурентов для модели по ее id","operationId":"getAll","parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}}}}}}},"post":{"tags":["Конкуренты"],"summary":"Создать связь с карточкой конкурента","description":"Создать модель конкурента, связывая его с карточкой конкурента","operationId":"create","parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Competitor"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"$ref":"#/components/schemas/Competitor"}}}}}}},"/api/competitor/product/{productId}":{"get":{"tags":["Конкуренты"],"summary":"Получить конкурентов конкретного товара","operationId":"getByProduct","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}}}}}}},"post":{"tags":["Конкуренты"],"summary":"Создать связь конкурента с конкретным товаром","description":"Создает карточку конкурента для конкретного размера/варианта товара","operationId":"createForProduct","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Competitor"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"$ref":"#/components/schemas/Competitor"}}}}}}},"/api/competitor/price/batch":{"post":{"tags":["Конкуренты"],"summary":"Сохранить собранные цены конкурентов","description":"Пакетно сохраняет цены, переданные плагином","operationId":"createPrices","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompetitorPrice"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"type":"integer","format":"int32"}}}}}}},"/api/competitor/import":{"post":{"tags":["Конкуренты"],"summary":"Массово импортировать конкурентов из Excel","operationId":"importCompetitors","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"$ref":"#/components/schemas/CompetitorImportResult"}}}}}}},"/api/competitor/{competitorId}/price":{"get":{"tags":["Конкуренты"],"summary":"Получить историю цен конкурента","operationId":"getPrices","parameters":[{"name":"competitorId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"dateFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompetitorPrice"}}}}}}}},"/api/competitor/template":{"get":{"tags":["Конкуренты"],"summary":"Скачать Excel-шаблон конкурентов","description":"Без параметров выгружает все товары клиента. organizationId ограничивает выгрузку организацией, service — товарами, заведенными на указанном маркетплейсе","operationId":"getTemplate","parameters":[{"name":"organizationId","in":"query","description":"ID организации, по которой выгружать шаблон","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"service","in":"query","description":"Маркетплейс, по которому выгружать шаблон","required":false,"schema":{"type":"string","description":"Сервис","enum":["NONE","WILDBERRIES","OZON","YANDEX_MARKET","FAMILIYA","NATIONAL_CATALOG","ALIEXPRESS","OTHER","MOY_SKLAD","SBER_MEGA_MARKET","CISLINK","ONE_C","AVITO","LEROY_MERLIN","DETMIR","KAZAN_EXPRESS","EVOTOR","WEBASYST","AMAZON","EBAY","SIMALAND","INSALES","LAMODA","OZON_PERFORMANCE","WALMART","GOOGLE","YANDEX_DISC","EMAIL","WOOCOMMERCE","MAGNIT","OPENCART","M_VIDEO","TAKEALOT","UZUM","SHOPIFY","MAKRO","YANDEX_KIT","BOB_SHOP","KASPI","DIADOC","TEKSHER","KONTUR_LOGISTICS","KONTUR_EDI","VSE_INSTRUMENTI","ELECTRONIC_SIGN"]}}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"byte"}}}}}}},"/api/competitor/collection":{"get":{"tags":["Конкуренты"],"summary":"Получить задания на сбор цен","description":"Возвращает карточки конкурентов для сбора цен плагином","operationId":"getForCollection","responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}}}}}}}},"/api/competitor/":{"get":{"tags":["Конкуренты"],"summary":"Получить всех конкурентов клиента с последними ценами","operationId":"getAll_1","responses":{"200":{"description":"OK","content":{"application/hal+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}}}}}}}}},"components":{"schemas":{"Competitor":{"type":"object","description":"Карточка конкурента для модели или конкретного товара","properties":{"id":{"type":"integer","format":"int64","description":"ID конкурента","readOnly":true},"modelId":{"type":"integer","format":"int64","description":"ID модели, для которой указывается конкурент"},"productId":{"type":"integer","format":"int64","description":"ID конкретного товара, для которого указывается конкурент"},"service":{"type":"string","description":"Маркетплейс конкурента","enum":["NONE","WILDBERRIES","OZON","YANDEX_MARKET","FAMILIYA","NATIONAL_CATALOG","ALIEXPRESS","OTHER","MOY_SKLAD","SBER_MEGA_MARKET","CISLINK","ONE_C","AVITO","LEROY_MERLIN","DETMIR","KAZAN_EXPRESS","EVOTOR","WEBASYST","AMAZON","EBAY","SIMALAND","INSALES","LAMODA","OZON_PERFORMANCE","WALMART","GOOGLE","YANDEX_DISC","EMAIL","WOOCOMMERCE","MAGNIT","OPENCART","M_VIDEO","TAKEALOT","UZUM","SHOPIFY","MAKRO","YANDEX_KIT","BOB_SHOP","KASPI","DIADOC","TEKSHER","KONTUR_LOGISTICS","KONTUR_EDI","VSE_INSTRUMENTI","ELECTRONIC_SIGN"]},"url":{"type":"string","description":"URL карточки конкурента на маркетплейсе"},"serviceId":{"type":"string","description":"ID карточки конкурента на сайте маркетплейса"},"clientId":{"type":"integer","format":"int64","description":"ID клиента","readOnly":true},"latestPrice":{"type":"number","format":"double","description":"Последняя собранная цена","readOnly":true},"currency":{"type":"string","description":"Валюта последней цены","enum":["RUB","USD","EUR","AUD","AZN","GBP","AMD","BYN","BGN","BRL","HUF","VND","HKD","GEL","DKK","AED","EGP","INR","IDR","KZT","CAD","QAR","KGS","CNY","MDL","NZD","NOK","PLN","RON","XDR","SGD","TJS","THB","TRY","TMT","UZS","UAH","CZK","SEK","CHF","RSD","ZAR","KRW","JPY"],"readOnly":true},"latestPriceDate":{"type":"string","format":"date-time","description":"Дата сбора последней цены","readOnly":true}},"required":["service","url"]},"CompetitorPrice":{"type":"object","description":"Цена карточки конкурента","properties":{"id":{"type":"integer","format":"int64","description":"ID записи","readOnly":true},"competitorId":{"type":"integer","format":"int64","description":"ID карточки конкурента"},"clientId":{"type":"integer","format":"int64","description":"ID клиента","readOnly":true},"price":{"type":"number","format":"double","description":"Цена"},"currency":{"type":"string","description":"Валюта цены","enum":["RUB","USD","EUR","AUD","AZN","GBP","AMD","BYN","BGN","BRL","HUF","VND","HKD","GEL","DKK","AED","EGP","INR","IDR","KZT","CAD","QAR","KGS","CNY","MDL","NZD","NOK","PLN","RON","XDR","SGD","TJS","THB","TRY","TMT","UZS","UAH","CZK","SEK","CHF","RSD","ZAR","KRW","JPY"]},"date":{"type":"string","format":"date-time","description":"Дата и время сбора цены"}},"required":["competitorId","price"]},"CompetitorImportResult":{"type":"object","description":"Результат массового импорта конкурентов","properties":{"imported":{"type":"integer","format":"int32","description":"Количество импортированных строк"},"skipped":{"type":"integer","format":"int32","description":"Количество пропущенных строк"}}}},"securitySchemes":{"ApiKey":{"type":"apiKey","name":"Authorization","in":"header"}}}}