{"openapi":"3.1.0","info":{"title":"Hobbyka AI API","version":"1.5.0","description":"Публичный каталог, запросы материалов, партнёрские функции и административное чтение Hobbyka."},"servers":[{"url":"https://hobbyka.ru"}],"tags":[{"name":"Каталог","description":"Разделы, поиск товаров и полные карточки с торговыми предложениями."},{"name":"Контент","description":"Новости, статьи, FAQ, справка, термины, услуги и разрешённые страницы."},{"name":"Коммерческие предложения","description":"Публичные КП по партнёрскому ключу и серверным ценам."},{"name":"Hobbyka CLI","description":"Регистрация контакта и выдача ограниченного токена официальному CLI."},{"name":"Материалы для проектирования","description":"Заявка менеджеру на чертежи, 2D-, 3D-, BIM- и другие материалы по товару."},{"name":"Партнёрский кабинет","description":"Изолированный профиль и коммерческие предложения партнёра."},{"name":"Заказы партнёра","description":"Заказы, связанные с пользователем сайта партнёра."},{"name":"Авторизация партнёра","description":"Единый вход CLI через штатную авторизацию на сайте Hobbyka."},{"name":"Административный режим","description":"КП, заказы и статистика активности из рабочих источников Bitrix для менеджеров и администраторов."}],"paths":{"/api/ai/v1/catalog/sections":{"get":{"tags":["Каталог"],"operationId":"listCatalogSections","summary":"Дерево разделов каталога","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"agent","in":"query","required":false,"description":"Идентификатор агента только для аналитики.","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/SectionList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"Не изменилось"},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/catalog/products":{"get":{"tags":["Каталог"],"operationId":"searchCatalog","summary":"Поиск и подбор товаров","description":"Возвращает краткие карточки. Полный товар вместе с торговыми предложениями доступен по идентификатору.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","example":"скамейка"}},{"name":"section_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"section_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"agent","in":"query","required":false,"description":"Идентификатор агента только для аналитики.","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/ProductList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"Не изменилось"},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/catalog/products/{id}":{"get":{"tags":["Каталог"],"operationId":"getProduct","summary":"Карточка товара","description":"Для обычного товара variants будет пустым массивом; для товара с торговыми предложениями — списком доступных вариантов.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"agent","in":"query","required":false,"description":"Идентификатор агента только для аналитики.","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Product"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"Не изменилось"},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/content":{"get":{"tags":["Контент"],"operationId":"searchContent","summary":"Поиск публичного контента","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ContentType"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"agent","in":"query","required":false,"description":"Идентификатор агента только для аналитики.","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/ContentList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"Не изменилось"},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/content/{type}/{code}":{"get":{"tags":["Контент"],"operationId":"getContent","summary":"Материал целиком","parameters":[{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ContentType"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]+$"}},{"name":"agent","in":"query","required":false,"description":"Идентификатор агента только для аналитики.","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Content"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"Не изменилось"},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/cli/contacts":{"post":{"tags":["Hobbyka CLI"],"operationId":"registerCliContact","summary":"Зарегистрировать контакт после первого результата CLI","description":"Возвращает ограниченный Bearer-токен один раз. Контакт не попадает в журнал запросов.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliContactRequest"}}}},"responses":{"201":{"description":"Контакт зарегистрирован; токен показывается один раз","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/CliContactToken"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/material-requests":{"post":{"tags":["Материалы для проектирования"],"operationId":"requestDesignMaterials","summary":"Запросить материалы по товару у менеджера","description":"Передаёт стандартную форму Hobbyka менеджеру. Требует ФИО, телефон, email и явное согласие на обработку персональных данных. Контактные данные не попадают в журнал API.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Уникальный ключ запроса, 8–128 печатных ASCII-символов.","schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaterialRequestInput"}}}},"responses":{"200":{"description":"Повтор ранее принятой заявки","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/MaterialRequest"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"201":{"description":"Заявка передана менеджеру","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/MaterialRequest"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"202":{"description":"Идентичная заявка обрабатывается","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/MaterialRequest"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/commercial-offers":{"post":{"tags":["Коммерческие предложения"],"operationId":"createCommercialOffer","summary":"Создать публичное КП по серверным ценам","description":"Партнёр передаёт контакт в теле. Hobbyka CLI передаёт только items и использует токен регистрации контакта.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Уникальный ключ запроса, 8–128 печатных ASCII-символов.","schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PublicOfferRequest"},{"$ref":"#/components/schemas/CliOfferRequest"}]}}}},"responses":{"201":{"description":"КП и PDF готовы","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"202":{"description":"Идентичный запрос уже обрабатывается","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ai/v1/commercial-offers/{public_id}":{"get":{"tags":["Коммерческие предложения"],"operationId":"getCommercialOffer","summary":"Получить статус публичного КП","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}},{"name":"agent","in":"query","required":false,"description":"Идентификатор агента только для аналитики.","schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"Не изменилось"},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/auth/device":{"post":{"tags":["Авторизация партнёра"],"operationId":"startPartnerDeviceAuthorization","summary":"Начать вход через сайт Hobbyka","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthorizationRequest"}}}},"responses":{"201":{"description":"Код и ссылка для входа на сайте","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/DeviceAuthorization"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/auth/token":{"post":{"tags":["Авторизация партнёра"],"operationId":"completePartnerDeviceAuthorization","summary":"Завершить вход после подтверждения на сайте","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"}}}},"responses":{"200":{"description":"Статус входа или токен","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/DeviceTokenResponse"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/auth/logout":{"post":{"tags":["Авторизация партнёра"],"operationId":"logoutPartner","summary":"Отозвать текущий токен CLI","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Токен отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/profile":{"get":{"tags":["Партнёрский кабинет"],"operationId":"getPartnerProfile","summary":"Проверить связанный партнёрский профиль","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Партнёрский профиль","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/PartnerProfile"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/commercial-offers":{"get":{"tags":["Партнёрский кабинет"],"operationId":"listPartnerOffers","summary":"Список КП текущего партнёра","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Список КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/OfferList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Партнёрский кабинет"],"operationId":"createPartnerOffer","summary":"Создать КП по профилю и серверным ценам","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Уникальный ключ запроса, 8–128 печатных ASCII-символов.","schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOfferRequest"}}}},"responses":{"201":{"description":"КП и PDF готовы","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"202":{"description":"Идентичный запрос уже обрабатывается","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/commercial-offers/{public_id}":{"get":{"tags":["Партнёрский кабинет"],"operationId":"getPartnerOffer","summary":"Получить КП текущего партнёра","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}},{"name":"include","in":"query","required":false,"description":"Дополнительные исходные условия и четыре варианта PDF.","schema":{"type":"string","pattern":"^(conditions|pdfs)(,(conditions|pdfs))?$"}}],"responses":{"200":{"description":"КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["Партнёрский кабинет"],"operationId":"revisePartnerOffer","summary":"Создать новую версию КП","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Уникальный ключ запроса, 8–128 печатных ASCII-символов.","schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOfferRevision"}}}},"responses":{"200":{"description":"Новая версия КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/commercial-offers/{public_id}/archive":{"post":{"tags":["Партнёрский кабинет"],"operationId":"archivePartnerOffer","summary":"Архивировать КП","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionRequest"}}}},"responses":{"200":{"description":"Архивированное КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/orders":{"get":{"tags":["Заказы партнёра"],"operationId":"listPartnerOrders","summary":"Список заказов текущего партнёра","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Список заказов","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/OrderList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Заказы партнёра"],"operationId":"createPartnerOrder","summary":"Создать заказ по товарам или КП","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Уникальный ключ запроса, 8–128 печатных ASCII-символов.","schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOrderRequest"}}}},"responses":{"201":{"description":"Заказ создан","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Order"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/orders/{public_id}":{"get":{"tags":["Заказы партнёра"],"operationId":"getPartnerOrder","summary":"Получить заказ","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}}],"responses":{"200":{"description":"Заказ","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Order"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["Заказы партнёра"],"operationId":"updatePartnerOrder","summary":"Изменить комментарий заказа","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderUpdateRequest"}}}},"responses":{"200":{"description":"Заказ изменён","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Order"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/partner/v1/orders/{public_id}/cancel":{"post":{"tags":["Заказы партнёра"],"operationId":"cancelPartnerOrder","summary":"Отменить заказ","security":[{"bearerAuth":[]}],"parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{40}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCancelRequest"}}}},"responses":{"200":{"description":"Заказ отменён","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Order"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/internal/v1/commercial-offers":{"post":{"tags":["Административный режим"],"operationId":"createInternalCommercialOffer","summary":"Создать КП менеджера с ручными условиями","description":"Требует offers.internal.create и включённый внутренний контур. Изменение цен и стоимости услуг требует offers.pricing.write. Клиент передаётся явно; канал, валюта и итог определяются сервером. Используется штатная политика CRM.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Уникальный ключ запроса, 8–128 печатных ASCII-символов.","schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalOfferRequest"}}}},"responses":{"201":{"description":"КП и PDF готовы","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"202":{"description":"Идентичный запрос уже обрабатывается","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Offer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["Административный режим"],"operationId":"listAdminOffers","summary":"Все КП Hobbyka","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"number","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"manager_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"active","in":"query","required":false,"schema":{"type":"string","enum":["Y","N"]}}],"responses":{"200":{"description":"Список КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/AdminOfferList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/internal/v1/commercial-offers/{id}":{"get":{"tags":["Административный режим"],"operationId":"getAdminOffer","summary":"Карточка любого КП","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Карточка КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/AdminOffer"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/internal/v1/orders":{"get":{"tags":["Административный режим"],"operationId":"listAdminOrders","summary":"Все заказы Hobbyka","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"user_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":32}}],"responses":{"200":{"description":"Список заказов","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/AdminOrderList"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/internal/v1/orders/{id}":{"get":{"tags":["Административный режим"],"operationId":"getAdminOrder","summary":"Карточка любого заказа","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Карточка заказа","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/AdminOrder"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/internal/v1/kp-activity":{"get":{"tags":["Административный режим"],"operationId":"getAdminActivityReport","summary":"Статистика действий с публичными КП","description":"Сводка только для чтения из журнала /kp/activity.php: посещения, события, уведомления и выдачи PDF. Время возвращается в UTC.","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"number","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"code","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-zA-Z0-9]{1,80}$"}},{"name":"actor","in":"query","required":false,"schema":{"type":"string","enum":["client","staff","test","bot"]}},{"name":"manager_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Сводка активности КП","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/AdminActivityReport"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"405":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Ошибка API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"ContentType":{"type":"string","enum":["news","article","faq","help","term","service","page"]},"Section":{"type":"object","additionalProperties":false,"required":["id","parent_id","code","name","description","canonical_url","updated_at"],"properties":{"id":{"type":"integer"},"parent_id":{"type":["integer","null"]},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"canonical_url":{"type":["string","null"],"format":"uri"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Product":{"type":"object","required":["id","article","name","section","description","features","images","canonical_url","updated_at","price","price_status"],"properties":{"id":{"type":"integer"},"parent_product_id":{"type":"integer"},"article":{"type":"string"},"name":{"type":"string"},"section":{"type":"object","properties":{"id":{"type":["integer","null"]}}},"description":{"type":"string"},"variants":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","article","options","price","price_status"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"article":{"type":"string"},"options":{"type":"object","additionalProperties":true},"price":{"type":["object","null"],"properties":{"value":{"type":"number"},"currency":{"type":["string","null"]}},"required":["value","currency"]},"price_status":{"type":"string","enum":["available","on_request"]}}}},"features":{"type":"array","items":{"type":"object","required":["code","name","value"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"value":{"type":["string","number","boolean","array","null"]}}}},"images":{"type":"array","items":{"type":"string","format":"uri"}},"canonical_url":{"type":["string","null"],"format":"uri"},"updated_at":{"type":["string","null"],"format":"date-time"},"price":{"type":["object","null"],"properties":{"value":{"type":"number"},"currency":{"type":["string","null"]}},"required":["value","currency"]},"price_status":{"type":"string","enum":["available","on_request"]}}},"Content":{"type":"object","required":["id","type","code","title","excerpt","published_at","updated_at","media","canonical_url"],"properties":{"id":{"type":["integer","string"]},"type":{"type":"string","enum":["news","article","faq","help","term","service","page"]},"code":{"type":"string"},"title":{"type":"string"},"excerpt":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"published_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"type":"string","format":"uri"}},"canonical_url":{"type":["string","null"],"format":"uri"}}},"Offer":{"type":"object","additionalProperties":false,"required":["public_id","number","total","status","version","root_public_id","replaces_public_id","status_url","view_url","pdf_url","pdf_expires_at"],"properties":{"public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"number":{"type":"string"},"total":{"type":"number"},"status":{"type":"string","enum":["processing","ready","revising","superseded","archived","failed"]},"version":{"type":"integer","minimum":1},"root_public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"replaces_public_id":{"type":["string","null"],"pattern":"^[a-f0-9]{40}$"},"status_url":{"type":"string","format":"uri"},"view_url":{"type":["string","null"],"format":"uri","description":"Штатная клиентская страница КП /kp/?CODE=…"},"pdf_url":{"type":["string","null"],"format":"uri"},"pdf_expires_at":{"type":["string","null"],"format":"date-time"},"http_status":{"type":"integer"},"items":{"type":"array","items":{"type":"object"}},"conditions":{"type":"object"},"pdfs":{"type":"array","items":{"type":"object","required":["variant","name","url"],"properties":{"variant":{"type":"string","enum":["vertical_full","vertical_short","horizontal_full","horizontal_short"]},"name":{"type":"string"},"url":{"type":"string","format":"uri"}}}}}},"SectionList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","parent_id","code","name","description","canonical_url","updated_at"],"properties":{"id":{"type":"integer"},"parent_id":{"type":["integer","null"]},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"canonical_url":{"type":["string","null"],"format":"uri"},"updated_at":{"type":["string","null"],"format":"date-time"}}}}}},"ProductList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","article","name","section","description","features","images","canonical_url","updated_at","price","price_status"],"properties":{"id":{"type":"integer"},"parent_product_id":{"type":"integer"},"article":{"type":"string"},"name":{"type":"string"},"section":{"type":"object","properties":{"id":{"type":["integer","null"]}}},"description":{"type":"string"},"variants":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","article","options","price","price_status"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"article":{"type":"string"},"options":{"type":"object","additionalProperties":true},"price":{"type":["object","null"],"properties":{"value":{"type":"number"},"currency":{"type":["string","null"]}},"required":["value","currency"]},"price_status":{"type":"string","enum":["available","on_request"]}}}},"features":{"type":"array","items":{"type":"object","required":["code","name","value"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"value":{"type":["string","number","boolean","array","null"]}}}},"images":{"type":"array","items":{"type":"string","format":"uri"}},"canonical_url":{"type":["string","null"],"format":"uri"},"updated_at":{"type":["string","null"],"format":"date-time"},"price":{"type":["object","null"],"properties":{"value":{"type":"number"},"currency":{"type":["string","null"]}},"required":["value","currency"]},"price_status":{"type":"string","enum":["available","on_request"]}}}}}},"ContentList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","code","title","excerpt","published_at","updated_at","media","canonical_url"],"properties":{"id":{"type":["integer","string"]},"type":{"type":"string","enum":["news","article","faq","help","term","service","page"]},"code":{"type":"string"},"title":{"type":"string"},"excerpt":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"published_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"type":"string","format":"uri"}},"canonical_url":{"type":["string","null"],"format":"uri"}}}}}},"PublicOfferRequest":{"type":"object","additionalProperties":false,"required":["company","items"],"properties":{"company":{"type":"string","minLength":1,"maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"contact":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254}}},"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["quantity"],"properties":{"product_id":{"type":"integer","minimum":1,"description":"Товар без выбранного варианта."},"variant_id":{"type":"integer","minimum":1,"description":"Выбранный вариант; родительский товар сервер определит автоматически."},"quantity":{"type":"number","exclusiveMinimum":0}},"oneOf":[{"required":["product_id"],"not":{"required":["variant_id"]}},{"required":["variant_id"],"not":{"required":["product_id"]}}]}},"object":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":500},"address":{"type":"string","maxLength":500},"city":{"type":"string","maxLength":255},"comments":{"type":"string","maxLength":1000}}},"delivery":{"type":"object","additionalProperties":false,"required":["method"],"properties":{"method":{"type":"string","minLength":1,"maxLength":128},"city":{"type":"string","maxLength":255},"address":{"type":"string","maxLength":500},"comments":{"type":"string","maxLength":1000}}},"agent":{"type":"string","maxLength":128,"example":"codex"}},"anyOf":[{"required":["phone"]},{"required":["email"]},{"required":["contact"],"properties":{"contact":{"required":["phone"]}}},{"required":["contact"],"properties":{"contact":{"required":["email"]}}}]},"InternalOfferRequest":{"type":"object","additionalProperties":false,"required":["company","items"],"properties":{"company":{"type":"string","minLength":1,"maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"contact":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"surname":{"type":"string","maxLength":255}}},"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["quantity"],"properties":{"product_id":{"type":"integer","minimum":1,"description":"Товар без выбранного варианта."},"variant_id":{"type":"integer","minimum":1,"description":"Выбранный вариант; родительский товар сервер определит автоматически."},"quantity":{"type":"number","exclusiveMinimum":0},"custom":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":5000},"version":{"type":"string","maxLength":255},"article":{"type":"string","maxLength":255},"image":{"type":"object","additionalProperties":false,"required":["filename","mime_type","content_base64"],"properties":{"filename":{"type":"string","maxLength":255},"mime_type":{"type":"string","enum":["image/jpeg","image/png","image/gif","image/webp"]},"content_base64":{"type":"string","maxLength":6990508}}}}},"price":{"type":"number","exclusiveMinimum":0},"discount":{"type":"number","minimum":0,"maximum":100},"markup":{"type":"number","minimum":0,"maximum":1000},"mounting_price":{"type":"number","minimum":0},"additional_markups":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["type","value"],"properties":{"type":{"type":"string","enum":["CURRENCY","PERCENT"]},"value":{"type":"number","minimum":0},"name":{"type":"string","maxLength":255}},"oneOf":[{"properties":{"type":{"const":"CURRENCY"}}},{"properties":{"type":{"const":"PERCENT"},"value":{"maximum":1000}}}]}}},"oneOf":[{"required":["product_id"],"not":{"anyOf":[{"required":["variant_id"]},{"required":["custom"]}]}},{"required":["variant_id"],"not":{"anyOf":[{"required":["product_id"]},{"required":["custom"]}]}},{"required":["custom","price"],"not":{"anyOf":[{"required":["product_id"]},{"required":["variant_id"]}]}}]}},"object":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":500},"address":{"type":"string","maxLength":500},"city":{"type":"string","maxLength":255},"comments":{"type":"string","maxLength":1000}}},"delivery":{"type":"object","additionalProperties":false,"required":["method"],"properties":{"method":{"type":"string","minLength":1,"maxLength":128,"enum":["pickup_mo","pickup_msk","pickup","delivery_object","delivery_tk"]},"city":{"type":"string","maxLength":255},"address":{"type":"string","maxLength":500},"comments":{"type":"string","maxLength":1000},"price":{"type":"number","minimum":0,"description":"Согласованная менеджером стоимость доставки. Ноль означает бесплатную доставку."}}},"agent":{"type":"string","maxLength":128,"example":"codex"},"inn":{"type":"string","maxLength":32},"ogrn":{"type":"string","maxLength":32},"implementation_period":{"type":"string","maxLength":500},"terms":{"type":"object","additionalProperties":false,"properties":{"production_time_from":{"type":"integer","minimum":0},"production_time_to":{"type":"integer","minimum":0},"validity_days":{"type":"integer","minimum":1},"prepayment_percent":{"type":"number","minimum":0,"maximum":100},"warranty_months":{"type":"integer","minimum":0}}},"services":{"type":"object","additionalProperties":false,"properties":{"assembly_price":{"type":"number","minimum":0},"installation_price":{"type":"number","minimum":0}}},"presentation":{"type":"object","additionalProperties":false,"properties":{"header_type":{"type":"string","enum":["hobbyka","dealer","hobbyka_with_contacts"]}}},"proposals":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","additionalProperties":false,"required":["type","days","discount"],"properties":{"type":{"type":"string","enum":["base","medium","maximum"]},"days":{"type":"integer"},"discount":{"type":"number"}}}}},"anyOf":[{"required":["phone"]},{"required":["email"]},{"required":["contact"],"properties":{"contact":{"anyOf":[{"required":["phone"]},{"required":["email"]}]}}}]},"CliContactRequest":{"type":"object","additionalProperties":false,"required":["company"],"properties":{"company":{"type":"string","minLength":1,"maxLength":255},"name":{"type":"string","maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"agent":{"type":"string","maxLength":128}},"anyOf":[{"required":["phone"]},{"required":["email"]}]},"CliContactToken":{"type":"object","additionalProperties":false,"required":["access_token","token_type","expires_at","contact"],"properties":{"access_token":{"type":"string","description":"Показывается только в ответе регистрации."},"token_type":{"type":"string","enum":["Bearer"]},"expires_at":{"type":"string","format":"date-time"},"contact":{"type":"object","properties":{"registered":{"type":"boolean"},"company_present":{"type":"boolean"},"phone_present":{"type":"boolean"},"email_present":{"type":"boolean"}}}}},"MaterialRequestInput":{"type":"object","additionalProperties":false,"required":["product_id","full_name","phone","email","personal_data_consent"],"properties":{"product_id":{"type":"integer","minimum":1},"full_name":{"type":"string","minLength":1,"maxLength":255},"company":{"type":"string","maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"comment":{"type":"string","maxLength":2000},"personal_data_consent":{"type":"boolean","const":true},"agent":{"type":"string","maxLength":128,"example":"hobbyka-cli"}}},"MaterialRequest":{"type":"object","additionalProperties":false,"required":["request_id","status","request_type","product","message"],"properties":{"request_id":{"type":"string"},"status":{"type":"string","enum":["processing","submitted"]},"request_type":{"type":"string","enum":["design_materials"]},"product":{"type":"object","required":["id","name","canonical_url"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"canonical_url":{"type":["string","null"],"format":"uri"}}},"message":{"type":"string"}}},"CliOfferRequest":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["quantity"],"properties":{"product_id":{"type":"integer","minimum":1,"description":"Товар без выбранного варианта."},"variant_id":{"type":"integer","minimum":1,"description":"Выбранный вариант; родительский товар сервер определит автоматически."},"quantity":{"type":"number","exclusiveMinimum":0}},"oneOf":[{"required":["product_id"],"not":{"required":["variant_id"]}},{"required":["variant_id"],"not":{"required":["product_id"]}}]}},"object":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":500},"address":{"type":"string","maxLength":500},"city":{"type":"string","maxLength":255},"comments":{"type":"string","maxLength":1000}}},"delivery":{"type":"object","additionalProperties":false,"required":["method"],"properties":{"method":{"type":"string","minLength":1,"maxLength":128},"city":{"type":"string","maxLength":255},"address":{"type":"string","maxLength":500},"comments":{"type":"string","maxLength":1000}}},"agent":{"type":"string","maxLength":128,"example":"hobbyka-cli"}}},"PartnerOfferRequest":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["quantity"],"properties":{"product_id":{"type":"integer","minimum":1,"description":"Товар без выбранного варианта."},"variant_id":{"type":"integer","minimum":1,"description":"Выбранный вариант; родительский товар сервер определит автоматически."},"quantity":{"type":"number","exclusiveMinimum":0}},"oneOf":[{"required":["product_id"],"not":{"required":["variant_id"]}},{"required":["variant_id"],"not":{"required":["product_id"]}}]}},"object":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":500},"address":{"type":"string","maxLength":500},"city":{"type":"string","maxLength":255},"comments":{"type":"string","maxLength":1000}}},"delivery":{"type":"object","additionalProperties":false,"required":["method"],"properties":{"method":{"type":"string","minLength":1,"maxLength":128},"city":{"type":"string","maxLength":255},"address":{"type":"string","maxLength":500},"comments":{"type":"string","maxLength":1000}}},"agent":{"type":"string","maxLength":128,"example":"hobbyka-cli"}}},"PartnerOfferRevision":{"type":"object","additionalProperties":false,"required":["items","expected_version"],"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["quantity"],"properties":{"product_id":{"type":"integer","minimum":1,"description":"Товар без выбранного варианта."},"variant_id":{"type":"integer","minimum":1,"description":"Выбранный вариант; родительский товар сервер определит автоматически."},"quantity":{"type":"number","exclusiveMinimum":0},"custom":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":5000},"version":{"type":"string","maxLength":255},"article":{"type":"string","maxLength":255},"image":{"type":"object","additionalProperties":false,"required":["filename","mime_type","content_base64"],"properties":{"filename":{"type":"string","maxLength":255},"mime_type":{"type":"string","enum":["image/jpeg","image/png","image/gif","image/webp"]},"content_base64":{"type":"string","maxLength":6990508}}}}},"price":{"type":"number","exclusiveMinimum":0},"discount":{"type":"number","minimum":0,"maximum":100},"markup":{"type":"number","minimum":0,"maximum":1000},"mounting_price":{"type":"number","minimum":0},"additional_markups":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["type","value"],"properties":{"type":{"type":"string","enum":["CURRENCY","PERCENT"]},"value":{"type":"number","minimum":0},"name":{"type":"string","maxLength":255}},"oneOf":[{"properties":{"type":{"const":"CURRENCY"}}},{"properties":{"type":{"const":"PERCENT"},"value":{"maximum":1000}}}]}}},"oneOf":[{"required":["product_id"],"not":{"anyOf":[{"required":["variant_id"]},{"required":["custom"]}]}},{"required":["variant_id"],"not":{"anyOf":[{"required":["product_id"]},{"required":["custom"]}]}},{"required":["custom","price"],"not":{"anyOf":[{"required":["product_id"]},{"required":["variant_id"]}]}}]}},"object":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":500},"address":{"type":"string","maxLength":500},"city":{"type":"string","maxLength":255},"comments":{"type":"string","maxLength":1000}}},"delivery":{"type":"object","additionalProperties":false,"required":["method"],"properties":{"method":{"type":"string","minLength":1,"maxLength":128,"enum":["pickup_mo","pickup_msk","pickup","delivery_object","delivery_tk"]},"city":{"type":"string","maxLength":255},"address":{"type":"string","maxLength":500},"comments":{"type":"string","maxLength":1000},"price":{"type":"number","minimum":0,"description":"Согласованная менеджером стоимость доставки. Ноль означает бесплатную доставку."}}},"agent":{"type":"string","maxLength":128,"example":"codex"},"expected_version":{"type":"integer","minimum":1},"company":{"type":"string","minLength":1,"maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"contact":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":255},"phone":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","format":"email","minLength":1,"maxLength":254},"surname":{"type":"string","maxLength":255}}},"inn":{"type":"string","maxLength":32},"ogrn":{"type":"string","maxLength":32},"implementation_period":{"type":"string","maxLength":500},"terms":{"type":"object","additionalProperties":false,"properties":{"production_time_from":{"type":"integer","minimum":0},"production_time_to":{"type":"integer","minimum":0},"validity_days":{"type":"integer","minimum":1},"prepayment_percent":{"type":"number","minimum":0,"maximum":100},"warranty_months":{"type":"integer","minimum":0}}},"services":{"type":"object","additionalProperties":false,"properties":{"assembly_price":{"type":"number","minimum":0},"installation_price":{"type":"number","minimum":0}}},"presentation":{"type":"object","additionalProperties":false,"properties":{"header_type":{"type":"string","enum":["hobbyka","dealer","hobbyka_with_contacts"]}}},"proposals":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","additionalProperties":false,"required":["type","days","discount"],"properties":{"type":{"type":"string","enum":["base","medium","maximum"]},"days":{"type":"integer"},"discount":{"type":"number"}}}}}},"VersionRequest":{"type":"object","additionalProperties":false,"required":["expected_version"],"properties":{"expected_version":{"type":"integer","minimum":1}}},"PartnerProfile":{"type":"object","required":["partner_id","name","mode","roles","scopes","capabilities","organization","site_user_id","contact"],"properties":{"partner_id":{"type":"integer"},"name":{"type":"string"},"mode":{"type":"string","enum":["partner","admin"]},"roles":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":{"type":"boolean"}},"organization":{"type":["string","null"]},"site_user_id":{"type":"integer"},"contact":{"type":"object","properties":{"name":{"type":"string"},"phone_present":{"type":"boolean"},"email_present":{"type":"boolean"}}}}},"OfferList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["public_id","number","total","status","version","root_public_id","replaces_public_id","status_url","view_url","pdf_url","pdf_expires_at"],"properties":{"public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"number":{"type":"string"},"total":{"type":"number"},"status":{"type":"string","enum":["processing","ready","revising","superseded","archived","failed"]},"version":{"type":"integer","minimum":1},"root_public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"replaces_public_id":{"type":["string","null"],"pattern":"^[a-f0-9]{40}$"},"status_url":{"type":"string","format":"uri"},"view_url":{"type":["string","null"],"format":"uri","description":"Штатная клиентская страница КП /kp/?CODE=…"},"pdf_url":{"type":["string","null"],"format":"uri"},"pdf_expires_at":{"type":["string","null"],"format":"date-time"},"http_status":{"type":"integer"},"items":{"type":"array","items":{"type":"object"}},"conditions":{"type":"object"},"pdfs":{"type":"array","items":{"type":"object","required":["variant","name","url"],"properties":{"variant":{"type":"string","enum":["vertical_full","vertical_short","horizontal_full","horizontal_short"]},"name":{"type":"string"},"url":{"type":"string","format":"uri"}}}}}}}}},"Order":{"type":"object","additionalProperties":false,"required":["public_id","order_id","status","site_status_id","canceled","version","total","updated_at"],"properties":{"public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"order_id":{"type":["integer","null"]},"status":{"type":"string","enum":["processing","updating","new","updated","canceled","failed"]},"site_status_id":{"type":["string","null"]},"canceled":{"type":["boolean","null"]},"version":{"type":"integer","minimum":1},"total":{"type":"number"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"OrderList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["public_id","order_id","status","site_status_id","canceled","version","total","updated_at"],"properties":{"public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"order_id":{"type":["integer","null"]},"status":{"type":"string","enum":["processing","updating","new","updated","canceled","failed"]},"site_status_id":{"type":["string","null"]},"canceled":{"type":["boolean","null"]},"version":{"type":"integer","minimum":1},"total":{"type":"number"},"updated_at":{"type":["string","null"],"format":"date-time"}}}}}},"AdminOfferClient":{"type":"object","description":"Разрешённые настройкой admin_offer_option_fields реквизиты из OPTIONS. В списке возвращаются только company и inn; дополнительные реквизиты доступны в карточке. Запрещённые поля отсутствуют.","properties":{"company":{"type":["string","number","boolean","null"],"description":"Сохранённое название компании."},"inn":{"type":["string","null"],"description":"Сохранённый ИНН клиента без проверки корректности. Ведущие нули сохраняются; отсутствующее, пустое или нескалярное значение — null."}}},"AdminOffer":{"type":"object","required":["id","number","active","items_count","quantity","total","currency","client"],"properties":{"id":{"type":"integer"},"number":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"manager":{"type":["object","null"]},"status":{"type":"object"},"items_count":{"type":"integer"},"quantity":{"type":"number"},"total":{"type":"number"},"currency":{"type":"string"},"client":{"$ref":"#/components/schemas/AdminOfferClient"},"items":{"type":"array","items":{"type":"object"}},"additional_total":{"type":"number"},"pdfs":{"type":"array","items":{"type":"object"}}}},"AdminOfferList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminOffer"}}}},"AdminOrder":{"type":"object","required":["id","number","status","price","currency","paid","canceled"],"properties":{"id":{"type":"integer"},"number":{"type":"string"},"user":{"type":["object","null"]},"status":{"type":"string"},"price":{"type":"number"},"currency":{"type":"string"},"paid":{"type":"boolean"},"canceled":{"type":"boolean"},"comments":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"items":{"type":"array","items":{"type":"object"}},"properties":{"type":"array","items":{"type":"object"}},"payments":{"type":"array","items":{"type":"object"}},"shipments":{"type":"array","items":{"type":"object"}}}},"AdminOrderList":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrder"}}}},"AdminActivityReport":{"type":"object","additionalProperties":false,"required":["timezone","filters","summary","visits","events","notifications","page","limit"],"properties":{"timezone":{"type":"string","const":"UTC"},"filters":{"type":"object","additionalProperties":false,"properties":{"number":{"type":"string"},"code":{"type":"string"},"actor":{"type":"string","enum":["client","staff","test","bot"]},"manager_id":{"type":"integer"}}},"summary":{"type":"object","required":["visits","visitors","active_seconds","downloads","last_activity_at"],"properties":{"visits":{"type":"integer"},"visitors":{"type":"integer"},"active_seconds":{"type":"integer"},"downloads":{"type":"integer"},"last_activity_at":{"type":["string","null"],"format":"date-time"}}},"visits":{"type":"array","items":{"type":"object"}},"events":{"type":"array","items":{"type":"object"}},"notifications":{"type":"array","items":{"type":"object"}},"page":{"type":"integer"},"limit":{"type":"integer"}}},"PartnerOrderRequest":{"type":"object","additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["product_id","quantity"],"properties":{"product_id":{"type":"integer","minimum":1},"quantity":{"type":"number","exclusiveMinimum":0}}}},"offer_public_id":{"type":"string","pattern":"^[a-f0-9]{40}$"},"comments":{"type":"string","maxLength":1000}},"oneOf":[{"required":["items"]},{"required":["offer_public_id"]}]},"OrderUpdateRequest":{"type":"object","additionalProperties":false,"required":["expected_version"],"properties":{"expected_version":{"type":"integer","minimum":1},"comments":{"type":"string","maxLength":1000}}},"OrderCancelRequest":{"type":"object","additionalProperties":false,"required":["expected_version"],"properties":{"expected_version":{"type":"integer","minimum":1},"reason":{"type":"string","maxLength":500}}},"DeviceAuthorizationRequest":{"type":"object","additionalProperties":false,"properties":{"client_name":{"type":"string","maxLength":128}}},"DeviceAuthorization":{"type":"object","additionalProperties":false,"required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"],"properties":{"device_code":{"type":"string"},"user_code":{"type":"string","pattern":"^[A-Z2-9]{4}-[A-Z2-9]{4}$"},"verification_uri":{"type":"string","format":"uri"},"verification_uri_complete":{"type":"string","format":"uri"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}}},"DeviceTokenRequest":{"type":"object","additionalProperties":false,"required":["device_code"],"properties":{"device_code":{"type":"string"}}},"DeviceTokenResponse":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["authorization_pending","authorized"]},"interval":{"type":"integer"},"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_at":{"type":["string","null"],"format":"date-time","description":"Срок действия токена. null означает отсутствие фиксированного срока; отзыв ключа и контроль активности пользователя сохраняются."},"mode":{"type":"string","enum":["partner","admin"]}}},"Meta":{"type":"object","required":["request_id","api_version"],"properties":{"request_id":{"type":"string"},"api_version":{"type":"string"},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"},"count":{"type":"integer"}}},"Envelope":{"type":"object","required":["data","meta"],"properties":{"data":{"type":["object","array","null"]},"meta":{"$ref":"#/components/schemas/Meta"}}},"ErrorEnvelope":{"type":"object","required":["data","meta","error"],"properties":{"data":{"type":"null"},"meta":{"$ref":"#/components/schemas/Meta"},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":["object","array"]}}}}}}}}