{"openapi":"3.1.0","info":{"title":"Зелёный Лось — каталог","version":"1.0.0","description":"Открытый каталог магазина брендовых игрушек: товары, цены, наличие, бренды и разделы. Только чтение, ключ не нужен. Корзина и заказ от имени покупателя — через MCP-сервер /mcp со входом по OAuth 2.1 (см. /.well-known/mcp/server-card.json).","contact":{"url":"https://greenelk.ru/contacts"}},"servers":[{"url":"https://greenelk.ru"}],"externalDocs":{"description":"Как подключить ИИ-ассистента","url":"https://greenelk.ru/mcp"},"security":[],"paths":{"/v1/products":{"get":{"operationId":"searchProducts","summary":"Найти товары","description":"Поиск и отбор товаров каталога. Все параметры необязательны; без них — популярные товары.","parameters":[{"name":"search","in":"query","description":"Слова поиска: название, бренд, артикул","schema":{"type":"string"}},{"name":"brand","in":"query","description":"Бренд по slug из /v1/brands, например lego","schema":{"type":"string"}},{"name":"rubric","in":"query","description":"Раздел по id из /v1/rubrics/tree","schema":{"type":"integer"}},{"name":"price_from","in":"query","description":"Цена от, ₽","schema":{"type":"integer","minimum":0}},{"name":"price_to","in":"query","description":"Цена до, ₽","schema":{"type":"integer","minimum":0}},{"name":"discount","in":"query","description":"1 — только со скидкой","schema":{"type":"string","enum":["1"]}},{"name":"order","in":"query","schema":{"type":"string","enum":["popular","newest","price_asc","price_desc","name_asc","name_desc"],"default":"popular"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":60,"default":24}}],"responses":{"200":{"description":"Страница товаров","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}},"404":{"description":"Не найдено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/{id}":{"get":{"operationId":"getProduct","summary":"Карточка товара","description":"Фото, описание, характеристики, варианты с ценой и остатком, путь по разделам.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Товар","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"404":{"description":"Не найдено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/{id}/similar":{"get":{"operationId":"similarProducts","summary":"Похожие товары","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Похожие товары","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/ProductCard"}}}}}}}}}},"/v1/brands":{"get":{"operationId":"listBrands","summary":"Все бренды","responses":{"200":{"description":"Бренды с числом товаров","content":{"application/json":{"schema":{"type":"object","properties":{"brands":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Brand"},{"type":"object","properties":{"count":{"type":"integer"}}}]}}}}}}}}}},"/v1/brands/{slug}":{"get":{"operationId":"getBrand","summary":"Страница бренда","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Бренд с описанием","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"}}}},"404":{"description":"Не найдено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/rubrics/tree":{"get":{"operationId":"listCategories","summary":"Дерево разделов","responses":{"200":{"description":"Корневые разделы с подразделами","content":{"application/json":{"schema":{"type":"object","properties":{"rubrics":{"type":"array","items":{"$ref":"#/components/schemas/RubricNode"}}}}}}}}}},"/v1/rubrics/by-slug/{slug}":{"get":{"operationId":"getCategory","summary":"Раздел по slug","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Раздел, путь и подразделы","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Не найдено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","description":"Нужен только для MCP (корзина, заказ, профиль). Каталог открыт без входа.","flows":{"authorizationCode":{"authorizationUrl":"https://app.greenelk.ru/oauth/authorize","tokenUrl":"https://app.greenelk.ru/oauth/token","refreshUrl":"https://app.greenelk.ru/oauth/token","scopes":{"catalog":"Искать товары и смотреть карточки","cart":"Смотреть и менять корзину","orders":"Считать доставку, оформлять заказы и следить за ними","profile":"Почта и «Мои данные»: имя, телефон, город и адрес"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}},"Brand":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"],"format":"uri"}}},"ProductCard":{"type":"object","required":["id","name","price","inStock","url"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"brand":{"oneOf":[{"$ref":"#/components/schemas/Brand"},{"type":"null"}]},"image":{"type":["string","null"],"format":"uri"},"price":{"type":["integer","null"],"description":"Цена, ₽"},"oldPrice":{"type":["integer","null"],"description":"Цена до скидки, ₽"},"inStock":{"type":"boolean"},"variationId":{"type":["integer","null"],"description":"Вариант для корзины (MCP set_cart_item, WebMCP add_to_cart)"},"url":{"type":"string","format":"uri","description":"Страница товара на сайте"}}},"ProductList":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/ProductCard"}},"page":{"type":"integer"},"hasMore":{"type":"boolean"},"total":{"type":"integer"}}},"Product":{"allOf":[{"$ref":"#/components/schemas/ProductCard"},{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"uri"}},"descriptionHtml":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"price":{"type":"integer"},"oldPrice":{"type":["integer","null"]},"quantity":{"type":"integer"}}}},"specs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}}}},"rubricPath":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"}}}}}}]},"RubricNode":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"count":{"type":"integer"},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"count":{"type":"integer"}}}}}}}}}