{"openapi": "3.1.0", "info": {"title": "API для реселлеров", "version": "1.0.0", "description": "API для реселлеров облачных серверов: каталог и цены, заказ сервера с передачей на аккаунт вашего клиента в Timeweb Cloud, баланс и его пополнение в USDT.\n\nТе же данные доступны в кабинете на этом сайте и в Telegram-боте: баланс, заказы и ключ общие.\n\n## Аутентификация\nКаждый запрос к `/v1/*` несёт заголовок `Authorization: Bearer <ключ>`. Ключ вида `rs_…` выпускается в кабинете или в боте (раздел «Реселлерам») и показывается один раз. Новый выпуск сразу отключает старый ключ.\n\n## Базовый поток\n1. `GET /v1/catalog`: локации, тарифы, допустимые значения своей конфигурации, операционные системы и ваши цены.\n2. `POST /v1/topups`: счёт на пополнение. Переведите ровно указанную сумму USDT на адрес из ответа, баланс пополнится сам за 1–3 минуты.\n3. `POST /v1/orders`: заказ. Сумма сразу списывается с баланса, сервер создаётся и передаётся на аккаунт Timeweb Cloud, логин которого вы указали.\n4. `GET /v1/orders/{id}`: опрашивайте статус раз в 10–15 секунд, пока он `processing`.\n\n## Статусы заказа\n- `processing`: сервер создаётся и передаётся, обычно несколько минут.\n- `done`: сервер передан. Клиенту нужно подтвердить приём в панели Timeweb Cloud: «Облачные серверы» → «Подробнее» → «Подтвердить».\n- `delayed`: выдача задерживается, заказ остаётся в работе, деньги не возвращены. Повторять заказ не нужно.\n- `refunded`: заказ не выполнен, списанная сумма возвращена на баланс.\n\n## Повтор запросов\nПередавайте в `POST /v1/orders` свой `ref`. Повторный запрос с тем же `ref` вернёт уже созданный заказ и ничего не спишет.\n\n## Пополнение\nСумма в счёте может отличаться от запрошенной на несколько центов: по ней система узнаёт ваш перевод. На баланс зачисляется запрошенная сумма. Если перевод не нашёлся автоматически, отправьте его хэш в `POST /v1/topups/{id}/check`.\n\n## Ошибки\nЛюбой ответ не 2xx имеет вид `{\"error\": {\"code\": \"...\", \"message\": \"...\"}}`. Коды: `unauthorized`, `blocked`, `bad_request`, `not_found`, `insufficient_funds`, `too_many_active`, `unavailable`, `rate_limited`, `tx_notfound`, `tx_pending`, `tx_foreign`, `tx_used`, `tx_mismatch`.\n\n## Ограничения\nДо 180 запросов в минуту на ключ. Одновременно в работе не больше пяти заказов и трёх неоплаченных счётов на пополнение."}, "servers": [{"url": "https://api.pioner-orlyonok.com"}], "tags": [{"name": "Профиль", "description": "Баланс, скидка и ключ"}, {"name": "Каталог", "description": "Локации, тарифы и цены"}, {"name": "Заказы", "description": "Создание серверов и их статус"}, {"name": "Баланс", "description": "История и пополнение в USDT"}], "security": [{"bearerAuth": []}], "paths": {"/v1/me": {"get": {"tags": ["Профиль"], "operationId": "getMe", "summary": "Профиль реселлера", "description": "Баланс, действующая скидка, сведения о ключе и сети, в которых сейчас принимается USDT. Пустой список `networks` означает, что пополнение криптовалютой выключено.", "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Me"}, "example": {"id": 123456789, "username": "reseller", "name": "Иван", "balance": 120.5, "discount_pct": 10, "has_key": true, "key_hint": "…a1b2", "networks": [{"id": "trc", "name": "TRC-20 (Tron)"}, {"id": "ton", "name": "TON"}], "contact": "@AIvaimi", "min_topup": 5, "admin": false}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/key": {"post": {"tags": ["Профиль"], "operationId": "issueKey", "summary": "Выпустить новый ключ", "description": "Возвращает новый ключ и сразу отключает прежний. Ключ показывается один раз.", "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Key"}, "example": {"api_key": "rs_3fJ…"}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/catalog": {"get": {"tags": ["Каталог"], "operationId": "getCatalog", "summary": "Каталог и цены", "description": "Локации в продаже, тарифы с ценой витрины (`price`) и вашей ценой (`your_price`), допустимые значения своей конфигурации и список операционных систем. Основная локация идёт первой.", "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Catalog"}, "example": {"discount_pct": 10, "locations": [{"id": "ru-1", "name": "Санкт-Петербург", "zone": "spb-3", "tariffs": [{"id": "1-1-15", "cpu": 1, "ram_gb": 1, "disk_gb": 15, "bandwidth_mbit": 1000, "price": 30, "your_price": 27}], "custom": {"cpu": [1, 2, 3, 4, 6, 8], "ram_gb": [1, 2, 3, 4, 6, 8, 12, 16], "disk_gb": [15, 20, 30, 40, 50, 60, 80, 100], "bandwidth_mbit": 1000}}], "os": [{"id": 65, "name": "ubuntu 24.04"}]}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}, "503": {"description": "Каталог временно недоступен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unavailable", "message": "Каталог временно недоступен"}}}}}}}}, "/v1/price": {"post": {"tags": ["Каталог"], "operationId": "getPrice", "summary": "Цена конфигурации", "description": "Считает цену тарифа или своей конфигурации. Передайте `tariff` либо тройку `cpu`, `ram_gb`, `disk_gb` из допустимых значений каталога.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Config"}, "example": {"location": "ru-1", "cpu": 4, "ram_gb": 4, "disk_gb": 30}}}}, "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Price"}, "example": {"price": 54, "your_price": 48.6}}}}, "400": {"description": "Такую конфигурацию собрать нельзя", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "bad_request", "message": "Такую конфигурацию собрать нельзя"}}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/orders": {"post": {"tags": ["Заказы"], "operationId": "createOrder", "summary": "Создать заказ", "description": "Списывает вашу цену с баланса и запускает создание сервера. Сервер передаётся на аккаунт Timeweb Cloud с логином `login`: это аккаунт вашего клиента, он должен существовать. Публичный IP при передаче меняется.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrderCreate"}, "example": {"location": "ru-1", "tariff": "1-1-15", "os_id": 65, "login": "ab123456", "ref": "client-42"}}}}, "responses": {"201": {"description": "Заказ принят", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Order"}, "example": {"id": "17", "status": "processing", "location": "ru-1", "location_name": "Санкт-Петербург · зона spb-3", "config": "1 vCPU · 1 ГБ RAM · 15 ГБ NVMe · канал 1 Гбит/с", "os_name": "ubuntu 24.04", "login": "ab123456", "price": 30, "charged": 27, "ref": "client-42", "created_at": 1795440000, "server_id": null, "transfer_id": null}}}}, "400": {"description": "Неверные параметры заказа", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "bad_request", "message": "Неверные параметры заказа"}}}}}, "402": {"description": "Не хватает средств на балансе", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "insufficient_funds", "message": "Не хватает средств на балансе"}}}}}, "409": {"description": "Пять заказов уже выдаются", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "too_many_active", "message": "Пять заказов уже выдаются"}}}}}, "503": {"description": "Сервис временно недоступен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unavailable", "message": "Сервис временно недоступен"}}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}, "get": {"tags": ["Заказы"], "operationId": "listOrders", "summary": "Список заказов", "description": "Оплаченные заказы, новые первыми. Сюда попадают и заказы, оформленные в боте.", "parameters": [{"name": "limit", "in": "query", "required": false, "description": "Сколько заказов вернуть, от 1 до 200", "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 50}}], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrderList"}, "example": {"orders": [{"id": "17", "status": "done", "location": "ru-1", "location_name": "Санкт-Петербург · зона spb-3", "config": "1 vCPU · 1 ГБ RAM · 15 ГБ NVMe · канал 1 Гбит/с", "os_name": "ubuntu 24.04", "login": "ab123456", "price": 30, "charged": 27, "ref": "client-42", "created_at": 1795440000, "server_id": 9671301, "transfer_id": 43183}]}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/orders/{id}": {"get": {"tags": ["Заказы"], "operationId": "getOrder", "summary": "Заказ по номеру", "parameters": [{"name": "id", "in": "path", "required": true, "description": "Номер заказа", "schema": {"type": "string"}}], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Order"}, "example": {"id": "17", "status": "done", "location": "ru-1", "location_name": "Санкт-Петербург · зона spb-3", "config": "1 vCPU · 1 ГБ RAM · 15 ГБ NVMe · канал 1 Гбит/с", "os_name": "ubuntu 24.04", "login": "ab123456", "price": 30, "charged": 27, "ref": "client-42", "created_at": 1795440000, "server_id": 9671301, "transfer_id": 43183}}}}, "404": {"description": "Заказ не найден", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "not_found", "message": "Заказ не найден"}}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/balance": {"get": {"tags": ["Баланс"], "operationId": "getBalance", "summary": "Баланс и история", "description": "Текущий баланс и последние 100 операций, новые первыми.", "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Balance"}, "example": {"balance": 93, "history": [{"ts": 1795440300, "amount": -27, "type": "order", "order_id": "17", "note": "1 vCPU · 1 ГБ RAM · 15 ГБ NVMe · канал 1 Гбит/с"}, {"ts": 1795440000, "amount": 120, "type": "topup", "order_id": "16", "note": "120.00 USDT TRC-20"}]}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/topups": {"post": {"tags": ["Баланс"], "operationId": "createTopup", "summary": "Счёт на пополнение", "description": "Возвращает адрес и точную сумму USDT. Переведите ровно `amount` в сети `network`, иначе перевод не зачтётся автоматически. Счёт действует до `expires_at`.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TopupCreate"}, "example": {"amount": 50, "network": "trc"}}}}, "responses": {"201": {"description": "Счёт создан", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Topup"}, "example": {"id": "18", "status": "pending", "network": "trc", "network_name": "TRC-20 (Tron)", "address": "TXYZ…", "amount": "49.98", "credit": 50, "expires_at": 1795443600, "created_at": 1795440000, "tx": null}}}}, "400": {"description": "Неверная сумма или сеть", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "bad_request", "message": "Неверная сумма или сеть"}}}}}, "409": {"description": "Уже есть три неоплаченных счёта", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "too_many_active", "message": "Уже есть три неоплаченных счёта"}}}}}, "503": {"description": "Счёт в этой сети сейчас выставить нельзя", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unavailable", "message": "Счёт в этой сети сейчас выставить нельзя"}}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}, "get": {"tags": ["Баланс"], "operationId": "listTopups", "summary": "Последние пополнения", "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TopupList"}, "example": {"topups": [{"id": "18", "status": "paid", "network": "trc", "network_name": "TRC-20 (Tron)", "address": "TXYZ…", "amount": "49.98", "credit": 50, "expires_at": 1795443600, "created_at": 1795440000, "tx": "5c7aa39f…"}]}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/topups/{id}": {"get": {"tags": ["Баланс"], "operationId": "getTopup", "summary": "Статус пополнения", "parameters": [{"name": "id", "in": "path", "required": true, "description": "Номер счёта", "schema": {"type": "string"}}], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Topup"}, "example": {"id": "18", "status": "paid", "network": "trc", "network_name": "TRC-20 (Tron)", "address": "TXYZ…", "amount": "49.98", "credit": 50, "expires_at": 1795443600, "created_at": 1795440000, "tx": "5c7aa39f…"}}}}, "404": {"description": "Счёт не найден", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "not_found", "message": "Счёт не найден"}}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}, "/v1/topups/{id}/check": {"post": {"tags": ["Баланс"], "operationId": "checkTopup", "summary": "Проверить перевод по хэшу", "description": "Если перевод не нашёлся сам, пришлите его хэш или ссылку из обозревателя. Точная сумма зачисляется сразу. Если сумма отличается, перевод уходит продавцу на ручную проверку (`tx_mismatch`).", "parameters": [{"name": "id", "in": "path", "required": true, "description": "Номер счёта", "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TxCheck"}, "example": {"tx": "5c7aa39fbc92cc1993015c3fb22c9508ef03724f91a9037abea0c2576d95f9c6"}}}}, "responses": {"200": {"description": "Перевод зачтён", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Topup"}, "example": {"id": "18", "status": "paid", "network": "trc", "network_name": "TRC-20 (Tron)", "address": "TXYZ…", "amount": "49.98", "credit": 50, "expires_at": 1795443600, "created_at": 1795440000, "tx": "5c7aa39f…"}}}}, "404": {"description": "Счёт не найден", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "not_found", "message": "Счёт не найден"}}}}}, "422": {"description": "Перевод не подошёл: tx_notfound, tx_pending, tx_foreign, tx_used или tx_mismatch", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "tx_notfound", "message": "Перевод не подошёл: tx_notfound, tx_pending, tx_foreign, tx_used или tx_mismatch"}}}}}, "503": {"description": "Сеть сейчас не отвечает", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unavailable", "message": "Сеть сейчас не отвечает"}}}}}, "401": {"description": "Ключ не передан или неверный", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "unauthorized", "message": "Ключ не передан или неверный"}}}}}, "403": {"description": "Доступ реселлера приостановлен", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "blocked", "message": "Доступ реселлера приостановлен"}}}}}, "429": {"description": "Слишком много запросов, подождите минуту", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": {"error": {"code": "rate_limited", "message": "Слишком много запросов, подождите минуту"}}}}}}}}}, "components": {"securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer", "description": "Ключ реселлера вида `rs_…`"}}, "schemas": {"Error": {"type": "object", "required": ["error"], "properties": {"error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "string", "enum": ["unauthorized", "blocked", "bad_request", "not_found", "insufficient_funds", "too_many_active", "unavailable", "rate_limited", "tx_notfound", "tx_pending", "tx_foreign", "tx_used", "tx_mismatch"]}, "message": {"type": "string", "description": "Пояснение на русском"}}}}}, "Network": {"type": "object", "properties": {"id": {"type": "string", "enum": ["trc", "bep", "ton"]}, "name": {"type": "string"}}}, "Me": {"type": "object", "properties": {"id": {"type": "integer", "description": "Telegram ID"}, "username": {"type": "string"}, "name": {"type": "string"}, "balance": {"type": "number", "description": "Баланс в долларах США"}, "discount_pct": {"type": "number", "description": "Ваша скидка от цены витрины, %"}, "has_key": {"type": "boolean"}, "key_hint": {"type": "string", "description": "Последние символы действующего ключа"}, "networks": {"type": "array", "items": {"$ref": "#/components/schemas/Network"}}, "contact": {"type": "string", "description": "Контакт продавца в Telegram"}, "min_topup": {"type": "number", "description": "Минимальная сумма пополнения"}, "admin": {"type": "boolean"}}}, "Key": {"type": "object", "properties": {"api_key": {"type": "string"}}}, "Tariff": {"type": "object", "properties": {"id": {"type": "string", "description": "Идентификатор тарифа для заказа, вида cpu-ram-disk"}, "cpu": {"type": "integer"}, "ram_gb": {"type": "integer"}, "disk_gb": {"type": "integer"}, "bandwidth_mbit": {"type": "integer", "description": "Канал, Мбит/с"}, "price": {"type": "number", "description": "Цена витрины"}, "your_price": {"type": "number", "description": "Ваша цена со скидкой"}}}, "Custom": {"type": ["object", "null"], "description": "Допустимые значения своей конфигурации; null, если она недоступна", "properties": {"cpu": {"type": "array", "items": {"type": "integer"}}, "ram_gb": {"type": "array", "items": {"type": "integer"}}, "disk_gb": {"type": "array", "items": {"type": "integer"}}, "bandwidth_mbit": {"type": "integer"}}}, "Location": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "zone": {"type": ["string", "null"], "description": "Зона доступности, если задана"}, "tariffs": {"type": "array", "items": {"$ref": "#/components/schemas/Tariff"}}, "custom": {"$ref": "#/components/schemas/Custom"}}}, "Os": {"type": "object", "properties": {"id": {"type": "integer"}, "name": {"type": "string"}}}, "Catalog": {"type": "object", "properties": {"discount_pct": {"type": "number"}, "locations": {"type": "array", "items": {"$ref": "#/components/schemas/Location"}}, "os": {"type": "array", "items": {"$ref": "#/components/schemas/Os"}}}}, "Config": {"type": "object", "required": ["location"], "properties": {"location": {"type": "string", "description": "id локации из каталога"}, "tariff": {"type": "string", "description": "id тарифа; либо он, либо cpu, ram_gb и disk_gb"}, "cpu": {"type": "integer"}, "ram_gb": {"type": "integer"}, "disk_gb": {"type": "integer"}}}, "Price": {"type": "object", "properties": {"price": {"type": "number"}, "your_price": {"type": "number"}}}, "OrderCreate": {"type": "object", "required": ["location", "os_id", "login"], "properties": {"location": {"type": "string"}, "tariff": {"type": "string", "description": "id тарифа; либо он, либо cpu, ram_gb и disk_gb"}, "cpu": {"type": "integer"}, "ram_gb": {"type": "integer"}, "disk_gb": {"type": "integer"}, "os_id": {"type": "integer", "description": "id операционной системы из каталога"}, "login": {"type": "string", "pattern": "^[A-Za-z0-9_.@+-]{3,64}$", "description": "Логин аккаунта Timeweb Cloud вашего клиента"}, "ref": {"type": "string", "maxLength": 64, "description": "Ваша метка заказа; повтор с той же меткой не создаёт второй заказ"}}}, "Order": {"type": "object", "properties": {"id": {"type": "string"}, "status": {"type": "string", "enum": ["processing", "done", "delayed", "refunded"]}, "location": {"type": "string"}, "location_name": {"type": "string"}, "config": {"type": "string"}, "os_name": {"type": "string"}, "login": {"type": "string"}, "price": {"type": "number", "description": "Цена витрины"}, "charged": {"type": ["number", "null"], "description": "Списано с баланса"}, "ref": {"type": "string"}, "created_at": {"type": "integer", "description": "Unix-секунды"}, "server_id": {"type": ["integer", "null"], "description": "ID сервера в Timeweb Cloud, когда заказ выдан"}, "transfer_id": {"type": ["integer", "string", "null"], "description": "Номер передачи в Timeweb Cloud"}}}, "OrderList": {"type": "object", "properties": {"orders": {"type": "array", "items": {"$ref": "#/components/schemas/Order"}}}}, "BalanceEntry": {"type": "object", "properties": {"ts": {"type": "integer"}, "amount": {"type": "number", "description": "Со знаком: списание отрицательное"}, "type": {"type": "string", "enum": ["order", "topup", "refund", "admin"]}, "order_id": {"type": ["string", "null"]}, "note": {"type": "string"}}}, "Balance": {"type": "object", "properties": {"balance": {"type": "number"}, "history": {"type": "array", "items": {"$ref": "#/components/schemas/BalanceEntry"}}}}, "TopupCreate": {"type": "object", "required": ["amount", "network"], "properties": {"amount": {"type": "number", "description": "Сумма в долларах США, не меньше min_topup"}, "network": {"type": "string", "enum": ["trc", "bep", "ton"]}}}, "Topup": {"type": "object", "properties": {"id": {"type": "string"}, "status": {"type": "string", "enum": ["pending", "paid", "expired", "cancelled"]}, "network": {"type": "string"}, "network_name": {"type": "string"}, "address": {"type": "string", "description": "Адрес для перевода USDT"}, "amount": {"type": "string", "description": "Точная сумма USDT к переводу"}, "credit": {"type": "number", "description": "Сколько зачислится на баланс"}, "expires_at": {"type": "integer"}, "created_at": {"type": "integer"}, "tx": {"type": ["string", "null"], "description": "Хэш зачтённого перевода"}}}, "TopupList": {"type": "object", "properties": {"topups": {"type": "array", "items": {"$ref": "#/components/schemas/Topup"}}}}, "TxCheck": {"type": "object", "required": ["tx"], "properties": {"tx": {"type": "string", "description": "Хэш перевода или ссылка на него в обозревателе"}}}}}}