{"openapi":"3.1.0","info":{"title":"Hobbyka AI API","version":"1.2.0","description":"Публичный каталог, партнёрские функции и административное чтение Hobbyka."},"servers":[{"url":"https://hobbyka.ru"}],"tags":[{"name":"Каталог","description":"Разделы, поиск товаров и полные карточки с торговыми предложениями."},{"name":"Контент","description":"Новости, статьи, FAQ, справка, термины, услуги и разрешённые страницы."},{"name":"Коммерческие предложения","description":"Публичные КП по партнёрскому ключу и серверным ценам."},{"name":"Hobbyka CLI","description":"Регистрация контакта и выдача ограниченного токена официальному CLI."},{"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/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}$"}}],"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":{"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"}}}}}}}},"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","format":"uri"},"pdf_url":{"type":["string","null"],"format":"uri"},"pdf_expires_at":{"type":["string","null"],"format":"date-time"},"http_status":{"type":"integer"}}},"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":["product_id","quantity"],"properties":{"product_id":{"type":"integer","minimum":1},"quantity":{"type":"number","exclusiveMinimum":0}}}},"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"]}}}]},"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"}}}}},"CliOfferRequest":{"type":"object","additionalProperties":false,"required":["items"],"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}}}},"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":["product_id","quantity"],"properties":{"product_id":{"type":"integer","minimum":1},"quantity":{"type":"number","exclusiveMinimum":0}}}},"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":["product_id","quantity"],"properties":{"product_id":{"type":"integer","minimum":1},"quantity":{"type":"number","exclusiveMinimum":0}}}},"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"},"expected_version":{"type":"integer","minimum":1}}},"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","format":"uri"},"pdf_url":{"type":["string","null"],"format":"uri"},"pdf_expires_at":{"type":["string","null"],"format":"date-time"},"http_status":{"type":"integer"}}}}}},"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"}}}}}},"AdminOffer":{"type":"object","required":["id","number","active","items_count","quantity","total","currency"],"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":{"type":"object"},"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"}}}},"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","format":"date-time"},"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"]}}}}}}}}