{"openapi":"3.1.0","info":{"title":"RetroBoost API","version":"3.2.0","description":"Клиентский API для баланса, актуальных остатков и заказов Discord Boost. Все денежные значения возвращаются в RUB.\n\nАвторизация через X-API-Key или Authorization: Bearer. Ключ создаётся в Telegram-боте.","contact":{"name":"Support","url":"https://t.me/rrelaxo"}},"externalDocs":{"description":"Terms of Service","url":"https://api.relaxo.dev/legal/tos?lang=ru"},"servers":[{"url":"https://api.relaxo.dev"}],"tags":[{"name":"Account"},{"name":"Stock"},{"name":"Orders"}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"API key"}},"schemas":{"Account":{"type":"object","required":["user_id","balance_rub","total_deposited_rub","language"],"properties":{"user_id":{"type":"integer","example":123456789},"username":{"type":["string","null"],"example":"reseller"},"balance_rub":{"type":"number","example":2500},"total_deposited_rub":{"type":"number","example":5000},"language":{"type":"string","enum":["ru","en","de"]},"api_rate_limit_per_minute":{"type":"integer","example":60}}},"StockPeriod":{"type":"object","required":["stock","price_per_boost_rub"],"properties":{"stock":{"type":"integer","example":120},"price_per_boost_rub":{"type":"number","example":85}}},"Stock":{"type":"object","required":["currency","month_1","month_3","updated_at"],"properties":{"currency":{"type":"string","const":"RUB"},"month_1":{"$ref":"#/components/schemas/StockPeriod"},"month_3":{"$ref":"#/components/schemas/StockPeriod"},"updated_at":{"type":"string","format":"date-time"}}},"OrderCreate":{"type":"object","additionalProperties":false,"required":["invite","months","quantity"],"properties":{"invite":{"type":"string","example":"https://discord.gg/example"},"months":{"type":"integer","enum":[1,3],"example":1},"quantity":{"type":"integer","minimum":2,"maximum":30,"multipleOf":2,"example":10}}},"Order":{"type":"object","required":["order_id","months","quantity","delivered","status","invite","total_rub","refunded_rub","created_at","updated_at"],"properties":{"order_id":{"type":"string","example":"BLY4F6D4A91C2"},"months":{"type":"integer","enum":[1,3]},"quantity":{"type":"integer","example":10},"delivered":{"type":"integer","example":0},"status":{"type":"string","enum":["creating","processing","retrying","completed","partial","failed","manual_review"]},"invite":{"type":"string","example":"https://discord.gg/example"},"total_rub":{"type":"number","example":850},"refunded_rub":{"type":"number","example":0},"error_code":{"type":["string","null"],"enum":["PARTIAL_DELIVERY","DELIVERY_FAILED","MANUAL_REVIEW_REQUIRED",null]},"error":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"example":{"order_id":"BLY4F6D4A91C2","months":1,"quantity":10,"delivered":0,"status":"processing","invite":"https://discord.gg/example","total_rub":850,"refunded_rub":0,"error_code":null,"error":null,"created_at":"2026-07-12T14:30:00.000Z","updated_at":"2026-07-12T14:30:02.000Z"}},"OrderList":{"type":"object","required":["count","orders"],"properties":{"count":{"type":"integer","example":1},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}},"Error":{"type":"object","required":["code","error","request_id"],"properties":{"code":{"type":"string","example":"INSUFFICIENT_BALANCE"},"error":{"type":"string","example":"Insufficient balance"},"request_id":{"type":"string","format":"uuid"}},"additionalProperties":true,"example":{"code":"INSUFFICIENT_BALANCE","error":"Insufficient balance","request_id":"b28abf23-0f7d-4a3a-8a90-60d42d77514a","required_rub":850,"balance_rub":300}}},"responses":{"BadRequest":{"description":"Неверный запрос","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Неверный API-ключ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Необходимо принять актуальные юридические документы","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"TERMS_ACCEPTANCE_REQUIRED","error":"Accept the current Terms of Service and User Agreement in the Telegram bot before using the API","request_id":"b28abf23-0f7d-4a3a-8a90-60d42d77514a","terms_version":"2026-07-12","terms_of_service_url":"https://api.relaxo.dev/legal/tos?lang=ru","user_agreement_url":"https://api.relaxo.dev/legal/user-agreement?lang=ru"}}}},"PaymentRequired":{"description":"Недостаточно средств","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"INSUFFICIENT_BALANCE","error":"Insufficient balance","request_id":"b28abf23-0f7d-4a3a-8a90-60d42d77514a","required_rub":850,"balance_rub":300}}}},"NotFound":{"description":"Заказ не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Конфликт","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Превышен лимит запросов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"Временно недоступно","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"security":[{"ApiKey":[]},{"Bearer":[]}],"paths":{"/v1/me":{"get":{"tags":["Account"],"summary":"Получить профиль и баланс","responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/stock":{"get":{"tags":["Stock"],"summary":"Получить остатки и цены","responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stock"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/orders":{"get":{"tags":["Orders"],"summary":"Получить свои заказы","parameters":[{"in":"query","name":"limit","required":false,"description":"Максимальное количество заказов (1–100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Orders"],"summary":"Создать заказ","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"description":"Уникальный ключ для безопасного повтора. Повторно используйте только для точно такого же запроса.","schema":{"type":"string","minLength":1,"maxLength":191},"example":"order-2026-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreate"}}}},"responses":{"201":{"description":"Заказ создан","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"order_id":"BLY4F6D4A91C2","months":1,"quantity":10,"delivered":0,"status":"processing","invite":"https://discord.gg/example","total_rub":850,"refunded_rub":0,"error_code":null,"error":null,"created_at":"2026-07-12T14:30:00.000Z","updated_at":"2026-07-12T14:30:02.000Z"}}}},"202":{"description":"Заказ принят и выполняется","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"order_id":"BLY4F6D4A91C2","months":1,"quantity":10,"delivered":0,"status":"processing","invite":"https://discord.gg/example","total_rub":850,"refunded_rub":0,"error_code":null,"error":null,"created_at":"2026-07-12T14:30:00.000Z","updated_at":"2026-07-12T14:30:02.000Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/orders/{order_id}":{"get":{"tags":["Orders"],"summary":"Получить свой заказ","parameters":[{"in":"path","name":"order_id","required":true,"schema":{"type":"string"},"example":"BLY4F6D4A91C2"}],"responses":{"200":{"description":"Успешный ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"order_id":"BLY4F6D4A91C2","months":1,"quantity":10,"delivered":0,"status":"processing","invite":"https://discord.gg/example","total_rub":850,"refunded_rub":0,"error_code":null,"error":null,"created_at":"2026-07-12T14:30:00.000Z","updated_at":"2026-07-12T14:30:02.000Z"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}