{"openapi":"3.1.0","info":{"title":"ПФ API","description":"Методы для партнёров. Авторизация: заголовок X-API-Key. Подробная документация: /api-docs","version":"1.0.0"},"paths":{"/api/health":{"get":{"summary":"Проверка доступности (без ключа)","operationId":"health_api_health_get","responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"security":[]}},"/api/reseller/v1/create_order":{"post":{"summary":"Создать заказ","operationId":"reseller_create_order_api_reseller_v1_create_order_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerCreateOrderRequest"}}}},"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/link_preview":{"post":{"summary":"Проверка ссылок","operationId":"reseller_link_preview_api_reseller_v1_link_preview_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPreviewRequest"}}}},"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPreviewResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/order_status":{"post":{"summary":"Статус заказа","operationId":"reseller_order_status_api_reseller_v1_order_status_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerOrderStatusRequest"}}}},"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"summary":"Статус заказа","operationId":"reseller_order_status_get_api_reseller_v1_order_status_get","parameters":[{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"}},{"name":"external_order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Order Id"}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/cancel_order":{"post":{"summary":"Отменить заказ","operationId":"reseller_cancel_order_api_reseller_v1_cancel_order_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerCancelOrderRequest"}}}},"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/cancel_link":{"post":{"summary":"Отменить одну ссылку","operationId":"reseller_cancel_link_api_reseller_v1_cancel_link_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerCancelLinkRequest"}}}},"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelLinkResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/user_orders":{"post":{"summary":"Заказы пользователя","operationId":"reseller_user_orders_api_reseller_v1_user_orders_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerUserOrdersRequest"}}}},"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOrdersResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"summary":"Заказы пользователя","operationId":"reseller_user_orders_get_api_reseller_v1_user_orders_get","parameters":[{"name":"user_id","in":"query","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOrdersResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/balance":{"get":{"summary":"Баланс и цена","operationId":"reseller_balance_api_reseller_v1_balance_get","responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/tariff":{"get":{"summary":"Тариф","operationId":"reseller_tariff_api_reseller_v1_tariff_get","parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Month"}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/reseller/v1/links":{"get":{"summary":"Список ссылок","operationId":"reseller_links_list_api_reseller_v1_links_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"description":"Сколько ссылок вернуть (значение больше 500 уменьшается до 500)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Сколько ссылок пропустить (для постраничной выгрузки)"},{"name":"work_status","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","in_progress","done","link_error","cancelled"]},"description":"Фильтр по рабочему статусу ссылки"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","in_progress","done","link_error","cancelled"]},"description":"Фильтр по рабочему статусу ссылки (прежнее имя параметра work_status)","deprecated":true},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Дата ГГГГ-ММ-ДД (по дате размещения заказа, МСК)"},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Дата ГГГГ-ММ-ДД (по дате размещения заказа, МСК)"}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinksResponse"}}}},"400":{"description":"Некорректный запрос: VALIDATION_ERROR, PF_BELOW_MINIMUM, NO_VALID_LINKS, INVALID_START_DATE, TOO_MANY_LINKS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: ключ не передан или неверный","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"INSUFFICIENT_BALANCE: недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"RESELLER_DISABLED: аккаунт отключён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ORDER_NOT_FOUND или ORDER_ITEM_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ORDER_NOT_CANCELLABLE или EXTERNAL_ORDER_ID_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: слишком много запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"LinkPreviewRequest":{"properties":{"links":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"title":"Links"}},"type":"object","required":["links"],"title":"LinkPreviewRequest"},"LinkWithKeyword":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":1,"title":"Url"},"keyword":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Keyword"}},"type":"object","required":["url"],"title":"LinkWithKeyword"},"ResellerCancelLinkRequest":{"properties":{"order_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Order Id"},"external_order_id":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"External Order Id"},"link":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1},{"type":"null"}],"title":"Link"},"item_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Item Id"},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","title":"ResellerCancelLinkRequest"},"ResellerCancelOrderRequest":{"properties":{"order_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Order Id"},"external_order_id":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"External Order Id"},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","title":"ResellerCancelOrderRequest"},"ResellerCreateOrderRequest":{"properties":{"external_order_id":{"type":"string","maxLength":128,"minLength":1,"title":"External Order Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"User Id"},"username":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Username"},"links":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/LinkWithKeyword"}]},"type":"array"},{"type":"string"}],"title":"Links","description":"Ссылки на объявления (до 500): массив строк и/или объектов {url, keyword} либо строка через пробел, запятую, перенос строки"},"pf_count":{"type":"integer","maximum":10000,"minimum":5,"title":"Pf Count","description":"ПФ в день на каждое объявление, минимум 5"},"days_count":{"type":"integer","maximum":365,"minimum":1,"title":"Days Count","description":"Количество дней, от 1 до 365"},"contacts":{"type":"boolean","title":"Contacts","default":false},"favorites":{"type":"boolean","title":"Favorites","default":false},"start_date":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Start Date"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["external_order_id","user_id","links","pf_count","days_count"],"title":"ResellerCreateOrderRequest"},"ResellerOrderStatusRequest":{"properties":{"order_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Order Id"},"external_order_id":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"External Order Id"}},"type":"object","title":"ResellerOrderStatusRequest"},"ResellerUserOrdersRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"User Id"},"limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Limit","default":20},"offset":{"type":"integer","minimum":0.0,"title":"Offset","default":0}},"type":"object","required":["user_id"],"title":"ResellerUserOrdersRequest"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string","description":"Код ошибки"},"message":{"type":"string","description":"Описание для человека"}},"required":["success","error","message"]},"OrderItem":{"type":"object","properties":{"item_id":{"type":"string","description":"Идентификатор ссылки в заказе (нужен для cancel_link)","format":"uuid"},"link":{"type":"string","description":"Ссылка в приведённом виде"},"keyword":{"type":"string","description":"Ключевое слово ссылки","nullable":true},"pf_count":{"type":"integer","description":"ПФ в день на ссылку"},"days_count":{"type":"integer","description":"Срок, дней"},"row_amount":{"type":"integer","description":"Стоимость ссылки, ₽"},"status":{"type":"string","description":"Состояние ссылки в заказе","enum":["active","link_error","cancelled"]},"work_status":{"type":"string","description":"Рабочий статус ссылки","enum":["scheduled","in_progress","done","link_error","cancelled"]},"days_worked":{"type":"integer","description":"Сколько дней ссылка отработала"},"days_remaining":{"type":"integer","description":"Сколько дней осталось"},"refunded_days":{"type":"integer","description":"За сколько дней возвращены деньги"},"refund_amount":{"type":"integer","description":"Сумма возврата по ссылке, ₽"},"link_error_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time","nullable":true},"cancelled_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time","nullable":true},"error_note":{"type":"string","description":"Комментарий к ошибке ссылки","nullable":true}}},"OrderResponse":{"type":"object","properties":{"success":{"type":"boolean"},"idempotent":{"type":"boolean","description":"true, если вернулся уже существующий заказ"},"order_id":{"type":"string","description":"Наш номер заказа"},"external_order_id":{"type":"string","description":"Ваш номер заказа"},"user_id":{"type":"string"},"created_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"},"start_date":{"type":"string","description":"Дата старта, переданная при создании","format":"date","nullable":true},"status":{"type":"string","description":"Статус заказа","enum":["scheduled","in_progress","done","link_error","cancelled"]},"status_text":{"type":"string","description":"Статус для человека; текст может меняться"},"start_at":{"type":"string","description":"Фактический запуск (04:00 МСК)","format":"date-time"},"end_date":{"type":"string","description":"Последний день работы заказа (включительно)","format":"date"},"completed_at":{"type":"string","description":"Завершение заказа: 00:00 МСК следующих суток после последнего дня","format":"date-time"},"days_count":{"type":"integer"},"days_completed":{"type":"integer","description":"Сколько дней прошло с запуска"},"days_remaining":{"type":"integer"},"valid_links_count":{"type":"integer"},"invalid_links_count":{"type":"integer"},"duplicate_links":{"type":"array","description":"Только в ответе на создание: полностью одинаковые повторы (ссылка и слово), оплаченные один раз","items":{"type":"object","properties":{"link":{"type":"string"},"skipped":{"type":"integer","description":"Сколько повторов отброшено"},"keyword":{"type":"string","description":"Оставленное ключевое слово","nullable":true}}}},"duplicate_links_count":{"type":"integer","description":"Сколько повторов отброшено"},"invalid_links":{"type":"array","items":{"type":"string"}},"pf_count":{"type":"integer","description":"ПФ в день на ссылку"},"total_pf":{"type":"integer"},"price_per_pf":{"type":"integer","description":"Цена за ПФ, по которой создан заказ"},"total_amount":{"type":"integer","description":"Сумма заказа, ₽"},"refunded_amount":{"type":"integer","description":"Возвращено на баланс по заказу, ₽"},"balance_after":{"type":"integer","description":"Баланс после списания за этот заказ, ₽"},"contacts":{"type":"boolean"},"favorites":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true},"archived":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}}},"required":["success","order_id","external_order_id","status","items"]},"UserOrder":{"type":"object","properties":{"order_id":{"type":"string"},"external_order_id":{"type":"string","nullable":true},"user_id":{"type":"string"},"status":{"type":"string","enum":["scheduled","in_progress","done","link_error","cancelled"]},"start_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"},"end_date":{"type":"string","format":"date"},"days_completed":{"type":"integer"},"days_remaining":{"type":"integer"},"days_count":{"type":"integer"},"total_amount":{"type":"integer"},"refunded_amount":{"type":"integer"},"created_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"},"line":{"type":"string","description":"Готовая строка для сообщения клиенту"}}},"UserOrdersResponse":{"type":"object","properties":{"success":{"type":"boolean"},"user_id":{"type":"string"},"total":{"type":"integer","description":"Всего заказов у пользователя"},"limit":{"type":"integer"},"offset":{"type":"integer"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/UserOrder"}}}},"LinkRow":{"type":"object","properties":{"item_id":{"type":"string","format":"uuid"},"order_id":{"type":"string"},"external_order_id":{"type":"string","nullable":true},"user_id":{"type":"string"},"link":{"type":"string"},"keyword":{"type":"string","nullable":true},"pf_count":{"type":"integer"},"days_count":{"type":"integer"},"row_amount":{"type":"integer"},"status":{"type":"string","description":"Состояние ссылки в заказе","enum":["active","link_error","cancelled"]},"work_status":{"type":"string","description":"Рабочий статус ссылки","enum":["scheduled","in_progress","done","link_error","cancelled"]},"days_worked":{"type":"integer"},"refunded_days":{"type":"integer"},"refund_amount":{"type":"integer"},"created_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"},"start_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"}}},"LinksResponse":{"type":"object","properties":{"success":{"type":"boolean"},"total":{"type":"integer","description":"Всего ссылок по фильтру"},"limit":{"type":"integer"},"offset":{"type":"integer"},"links":{"type":"array","items":{"$ref":"#/components/schemas/LinkRow"}},"status_counts":{"type":"object","properties":{"scheduled":{"type":"integer"},"in_progress":{"type":"integer"},"done":{"type":"integer"},"link_error":{"type":"integer"},"cancelled":{"type":"integer"},"all":{"type":"integer"}},"description":"Число ссылок по рабочим статусам (по всем ссылкам с вашими фильтрами)"}}},"CancelOrderResponse":{"type":"object","properties":{"success":{"type":"boolean"},"order_id":{"type":"string"},"status":{"type":"string","description":"Новый статус (для dry_run — текущий)"},"refunded_days":{"type":"integer"},"refund_amount":{"type":"integer","description":"Возврат по этой операции, ₽"},"balance_after":{"type":"integer","description":"Баланс после операции, ₽; при dry_run — расчётный"},"dry_run":{"type":"boolean"},"would_be_status":{"type":"string"},"already_cancelled":{"type":"boolean"},"items_refunded":{"type":"integer"},"item_refunds":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","format":"uuid"},"link":{"type":"string"},"days_worked":{"type":"integer"},"refunded_days":{"type":"integer"},"refund_amount":{"type":"integer"}}}}}},"CancelLinkResponse":{"type":"object","properties":{"success":{"type":"boolean"},"order_id":{"type":"string"},"status":{"type":"string","description":"Новый статус (для dry_run — текущий)"},"refunded_days":{"type":"integer"},"refund_amount":{"type":"integer","description":"Возврат по этой операции, ₽"},"balance_after":{"type":"integer","description":"Баланс после операции, ₽; при dry_run — расчётный"},"dry_run":{"type":"boolean"},"would_be_status":{"type":"string"},"item_id":{"type":"string","description":"Первая из отменённых позиций","format":"uuid"},"item_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Все остановленные позиции ссылки"},"items_cancelled":{"type":"integer","description":"Сколько позиций остановлено (ссылка с несколькими ключевыми словами останавливается целиком)"},"link":{"type":"string"},"order_status":{"type":"string","description":"Статус заказа после операции"},"already_marked":{"type":"boolean"},"days_worked":{"type":"integer"},"cancelled_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"},"would_be_order_status":{"type":"string"}}},"BalanceResponse":{"type":"object","properties":{"success":{"type":"boolean"},"reseller_id":{"type":"string","format":"uuid"},"reseller_name":{"type":"string"},"balance":{"type":"integer","description":"Баланс, ₽"},"price_per_pf":{"type":"integer","description":"Актуальная цена за ПФ, ₽"},"currency":{"type":"string","enum":["RUB"]},"active":{"type":"boolean"},"updated_at":{"type":"string","description":"Время в формате ISO 8601 с московским поясом (+03:00)","format":"date-time"}}},"TariffResponse":{"type":"object","properties":{"success":{"type":"boolean"},"tariffs_start":{"type":"string","format":"date"},"tariffs_active":{"type":"boolean"},"fixed_price":{"type":"boolean"},"price_now":{"type":"integer"},"tiers":{"type":"array","items":{"type":"object","properties":{"from":{"type":"integer"},"to":{"type":"integer","nullable":true},"price":{"type":"integer"},"current":{"type":"boolean"}}}}},"description":"Тариф и пополнения за месяц; полный перечень полей — в документации"},"LinkPreviewResponse":{"type":"object","properties":{"success":{"type":"boolean"},"previews":{"type":"array","items":{"type":"object","properties":{"input":{"type":"string"},"valid":{"type":"boolean"},"url":{"type":"string"},"duplicate":{"type":"boolean"},"title":{"type":"string"},"city":{"type":"string"},"category":{"type":"string"},"error":{"type":"string"}}}}}},"HealthResponse":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"string","enum":["ok"]}}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"security":[{"ApiKeyAuth":[]}]}