{"openapi":"3.0.0","paths":{"/users/me":{"get":{"operationId":"UsersController_me","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}}],"responses":{"200":{"description":"Данные текущего пользователя","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Данные текущего пользователя","tags":["Пользователи"]}},"/orders":{"get":{"description":"Возвращает покупки eSIM и пополнения с пагинацией и сортировкой по дате создания; по умолчанию сначала новые","operationId":"OrdersController_list","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"page","required":false,"in":"query","description":"Номер страницы","schema":{"minimum":1,"maximum":100000,"default":1,"type":"integer"}},{"name":"per_page","required":false,"in":"query","description":"Количество записей на странице","schema":{"minimum":1,"maximum":100,"default":100,"type":"integer"}},{"name":"sort_order","required":false,"in":"query","description":"Порядок по дате создания заказа: desc — сначала новые, asc — сначала старые","schema":{"default":"desc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Список заказов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderListResponseDto"}}}},"400":{"description":"Некорректные параметры запроса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Список заказов","tags":["Заказы"]},"post":{"description":"Создаёт заказ на один или несколько тарифов eSIM. Оплата в RUB","operationId":"OrdersController_create","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"Idempotency-Key","in":"header","description":"Ключ идемпотентности запроса","required":true,"schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderDto"}}}},"responses":{"200":{"description":"Заказ завершён","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"202":{"description":"Заказ принят в обработку","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Некорректный запрос","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"402":{"description":"Недостаточно средств на балансе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"409":{"description":"Конфликт ключа идемпотентности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"Сервис поставщика недоступен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Покупка тарифов eSIM","tags":["Заказы"]}},"/orders/{id}":{"get":{"operationId":"OrdersController_get","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID заказа","schema":{"type":"string"}}],"responses":{"200":{"description":"Заказ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"404":{"description":"Заказ не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Заказ по ID","tags":["Заказы"]}},"/orders/topup":{"post":{"operationId":"OrdersController_topup","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"Idempotency-Key","in":"header","description":"Ключ идемпотентности запроса","required":true,"schema":{"type":"string","minLength":8,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTopupDto"}}}},"responses":{"200":{"description":"Пополнение завершено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"202":{"description":"Пополнение принято в обработку","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponseDto"}}}},"400":{"description":"Некорректный запрос","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"402":{"description":"Недостаточно средств на балансе","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"404":{"description":"eSIM или пакет не найден","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"409":{"description":"Конфликт ключа идемпотентности","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"Сервис поставщика недоступен","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Пополнение eSIM","tags":["Заказы"]}},"/products":{"get":{"description":"Возвращает тарифы с пагинацией, сортировкой, фильтрами и общим текстовым поиском","operationId":"CatalogueController_list","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"page","required":false,"in":"query","description":"Номер страницы","schema":{"minimum":1,"maximum":100000,"default":1,"type":"integer"}},{"name":"per_page","required":false,"in":"query","description":"Количество записей на странице","schema":{"minimum":1,"maximum":100,"default":100,"type":"integer"}},{"name":"sort_by","required":false,"in":"query","description":"Поле сортировки: цена или цена за 1 ГБ","schema":{"type":"string","enum":["price","price_per_gb_rub"]}},{"name":"sort_order","required":false,"in":"query","description":"Направление сортировки","schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"name":"data_type","required":false,"in":"query","description":"Тип пакета трафика","schema":{"type":"string","enum":["fixed","unlimited","daily"]}},{"name":"countries","required":false,"in":"query","description":"ISO-коды стран. Тариф должен покрывать все выбранные страны. Можно передать несколько параметров или строку через запятую","schema":{"minItems":1,"maxItems":100,"example":["TR","US"],"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}}},{"name":"price_min_rub","required":false,"in":"query","description":"Минимальная цена для партнёра, RUB","schema":{"minimum":0,"type":"number"}},{"name":"price_max_rub","required":false,"in":"query","description":"Максимальная цена для партнёра, RUB","schema":{"minimum":0,"type":"number"}},{"name":"duration_days_min","required":false,"in":"query","description":"Минимальная требуемая длительность тарифа, дней","schema":{"minimum":1,"type":"integer"}},{"name":"duration_days_max","required":false,"in":"query","description":"Максимальная требуемая длительность тарифа, дней","schema":{"minimum":1,"type":"integer"}},{"name":"data_megabytes_min","required":false,"in":"query","description":"Минимальный общий объём трафика, МБ","schema":{"minimum":0,"maximum":9007199254740991,"type":"integer"}},{"name":"data_megabytes_max","required":false,"in":"query","description":"Максимальный общий объём трафика, МБ","schema":{"minimum":0,"maximum":9007199254740991,"type":"integer"}},{"name":"daily_data_gb_min","required":false,"in":"query","description":"Минимальный дневной объём высокоскоростного трафика, ГБ","schema":{"minimum":0,"type":"number"}},{"name":"daily_data_gb_max","required":false,"in":"query","description":"Максимальный дневной объём высокоскоростного трафика, ГБ","schema":{"minimum":0,"type":"number"}},{"name":"topup_supported","required":false,"in":"query","description":"Доступно ли пополнение тарифа","schema":{"type":"boolean"}},{"name":"search","required":false,"in":"query","description":"Общий поиск по названию тарифа, стране и объёму/типу трафика","schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"description":"Список тарифов","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductListResponseDto"}}}},"400":{"description":"Некорректные параметры запроса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Список доступных тарифов","tags":["Тарифы"]}},"/products/export.xlsx":{"get":{"description":"Все продукты в виде файла XLSX, Партнёрские цены и условия тарифов; без ID","operationId":"CatalogueController_exportXlsx","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}}],"responses":{"200":{"description":"XLSX с листом «Продукты»; первая строка содержит названия колонок","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Выгрузка всех продуктов в XLSX для маркетинга","tags":["Тарифы"]}},"/products/by-slug/{slug}":{"get":{"operationId":"CatalogueController_bySlug","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"slug","required":true,"in":"path","description":"Slug тарифа","schema":{"type":"string"}}],"responses":{"200":{"description":"Тариф","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}},"308":{"description":"Старый slug перенаправляет на актуальный адрес тарифа"},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Тариф по slug","tags":["Тарифы"]}},"/products/{id}":{"get":{"operationId":"CatalogueController_get","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID тарифа","schema":{"type":"string"}}],"responses":{"200":{"description":"Тариф","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Тариф по ID","tags":["Тарифы"]}},"/esims/{id}/sms":{"post":{"description":"Только для собственной выданной и не отменённой eSIM. Для доставки нужен активный профиль. Повторяйте запрос с тем же Idempotency-Key, в том числе после 503 или таймаута; новый ключ означает новое SMS. Ключ Stellar должен иметь разрешение esims:sms.","operationId":"EsimsController_sendSms","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID eSIM","schema":{"format":"uuid","type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEsimSmsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimSmsResponseDto"}}}},"400":{"description":"Некорректное сообщение, ключ или eSIM ещё не готова","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"404":{"description":"eSIM не найдена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"409":{"description":"SMS недоступно для eSIM или ключ уже использован с другими параметрами","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Сообщение отклонено поставщиком","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"429":{"description":"Лимит отправки SMS; повторите с тем же ключом","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"Результат отправки неизвестен; повторите с тем же ключом","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Отправить служебное SMS на eSIM","tags":["eSIM"]}},"/esims/{id}/email/retry":{"post":{"description":"Ставит письмо в фоновую очередь на email из заказа, включая ранее отправленные письма. Доступно только владельцу eSIM. Повторный запрос во время ожидания или отправки не создаёт дубликат. Ответ 202 не означает доставку письма; статус доступен в GET /esims/{id}.","operationId":"EsimsController_retryEmail","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID eSIM","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRetryResponseDto"}}}},"400":{"description":"Нет email или eSIM недоступна для отправки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"404":{"description":"eSIM не найдена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"409":{"description":"Состояние отправки изменилось, обновите eSIM","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"Отправка писем не настроена","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Повторно отправить письмо с eSIM","tags":["eSIM"]}},"/esims":{"get":{"description":"Возвращает eSIM с пагинацией и сортировкой по дате создания заказа; по умолчанию сначала новые","operationId":"EsimsController_list","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"page","required":false,"in":"query","description":"Номер страницы","schema":{"minimum":1,"maximum":100000,"default":1,"type":"integer"}},{"name":"per_page","required":false,"in":"query","description":"Количество записей на странице","schema":{"minimum":1,"maximum":100,"default":100,"type":"integer"}},{"name":"sort_order","required":false,"in":"query","description":"Порядок по дате создания заказа: desc — сначала новые, asc — сначала старые","schema":{"default":"desc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Список eSIM","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimListResponseDto"}}}},"400":{"description":"Некорректные параметры запроса","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Список eSIM","tags":["eSIM"]}},"/esims/{id}":{"get":{"operationId":"EsimsController_get","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID eSIM","schema":{"type":"string"}}],"responses":{"200":{"description":"Данные eSIM","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"eSIM по ID","tags":["eSIM"]}},"/esims/{id}/usage":{"get":{"description":"Снимок из БД. Воркер обновляет его примерно каждые 5 минут; HTTP-запрос не обращается к поставщику.","operationId":"EsimsController_usage","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID eSIM","schema":{"type":"string"}}],"responses":{"200":{"description":"Расход трафика и статус eSIM","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Сохранённый расход трафика и статус eSIM","tags":["eSIM"]}},"/esims/{id}/topup-plans":{"get":{"operationId":"EsimsController_topupPlans","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"ID eSIM","schema":{"type":"string"}}],"responses":{"200":{"description":"Доступные тарифы для пополнения","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TopupPlanResponseDto"}}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"partner-token":[]}],"summary":"Тарифы для пополнения eSIM","tags":["eSIM"]}},"/esims/{id}/cancel":{"post":{"description":"Отменяет всю выданную eSIM с нулевым расходом, включая завершённые пополнения. Ожидающие, обрабатываемые и проверяемые пополнения блокируют отмену. После подтверждения поставщика возвращает фактически списанные рубли на партнёрский кошелёк. refunded_amount_rub — общая уже зачисленная сумма за eSIM и пополнения. Тело и Idempotency-Key не нужны. Незавершённая операция имеет status=pending и can_cancel=false.","operationId":"cancelEsim","parameters":[{"name":"Authorization","in":"header","description":"Партнёрский токен доступа","required":true,"schema":{"type":"string","example":"Bearer ett_<token-uuid>.<random-secret>"}},{"name":"id","required":true,"in":"path","description":"Наш ID eSIM","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimCancellationResponseDto"}}}},"401":{"description":"Токен отсутствует, неверен или отозван","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"409":{"description":"Условия не выполнены или поставщик отклонил отмену","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimCancellationErrorDto"}}}},"429":{"description":"Превышен лимит поставщика","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimCancellationErrorDto"}}}},"503":{"description":"Временная ошибка или частичный возврат. Статус операции и зачисленная сумма передаются в data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EsimCancellationErrorDto"}}}}},"security":[{"partner-token":[]}],"summary":"Отменить неиспользованную eSIM и вернуть оплату на баланс","tags":["eSIM"]}}},"info":{"title":"Партнёрский API eSIM to Trip","description":"Партнёрский токен передаётся в заголовке Authorization","version":"1.0.0","contact":{}},"tags":[],"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"partner-token":{"scheme":"bearer","bearerFormat":"Partner API token","type":"http"}},"schemas":{"ErrorResponseDto":{"type":"object","properties":{"statusCode":{"type":"number","example":401,"description":"HTTP-статус"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Описание ошибки"},"error":{"type":"string","example":"Unauthorized","description":"Тип ошибки"}},"required":["statusCode","message","error"]},"WalletTransactionResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ID транзакции"},"user_id":{"type":"string","format":"uuid","description":"ID пользователя"},"order_id":{"type":"string","nullable":true,"format":"uuid","description":"ID связанного заказа"},"kind":{"enum":["deposit","payment","refund"],"type":"string","description":"Тип транзакции"},"reference":{"type":"string","description":"Внешний идентификатор транзакции"},"comment":{"type":"string","description":"Комментарий к транзакции"},"amount_rub":{"type":"string","example":"250.00","description":"Сумма в RUB"},"created_at":{"type":"string","format":"date-time","description":"Время транзакции"}},"required":["id","user_id","order_id","kind","reference","comment","amount_rub","created_at"]},"UserResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ID пользователя"},"email":{"type":"string","format":"email","description":"Email пользователя"},"name":{"type":"string","description":"Имя пользователя"},"createdAt":{"type":"string","format":"date-time","description":"Время создания аккаунта"},"updatedAt":{"type":"string","format":"date-time","description":"Время обновления аккаунта"},"balance_rub":{"type":"string","example":"0.00","description":"Баланс в RUB"},"transactions":{"description":"Все транзакции пользователя: пополнения, покупки и возвраты, сначала новые","type":"array","items":{"$ref":"#/components/schemas/WalletTransactionResponseDto"}}},"required":["id","email","name","createdAt","updatedAt","balance_rub","transactions"]},"EsimCancellationResponseDto":{"type":"object","properties":{"status":{"enum":["none","pending","completed","rejected"],"type":"string"},"refunded_amount_rub":{"type":"string","description":"Общая сумма, уже зачисленная на баланс за eSIM и пополнения, в RUB.","example":"500.00"},"can_cancel":{"type":"boolean","description":"Можно начать возврат по сохранённым данным eSIM. Окончательное решение принимает поставщик."}},"required":["status","refunded_amount_rub","can_cancel"]},"EsimPlanSummaryDto":{"type":"object","properties":{"name":{"type":"string"},"emoji":{"type":"string","nullable":true},"speed":{"type":"string","nullable":true},"data_type":{"type":"string","nullable":true},"data_label":{"type":"string","nullable":true},"data_megabytes":{"type":"string","nullable":true}},"required":["name","emoji","speed","data_type","data_label","data_megabytes"]},"LifecycleResponseDto":{"type":"object","properties":{"order_esim_id":{"type":"string","format":"uuid","description":"ID eSIM"},"status":{"type":"string","nullable":true,"description":"Статус eSIM"},"profile_status":{"type":"string","nullable":true,"description":"Статус профиля eSIM"},"total_bytes":{"type":"string","nullable":true,"description":"Общий объём трафика, байт"},"used_bytes":{"type":"string","nullable":true,"description":"Использованный трафик, байт"},"remaining_bytes":{"type":"string","nullable":true,"description":"Оставшийся трафик, байт"},"usage_percent":{"type":"string","nullable":true,"description":"Использованный трафик, %"},"installation_detected_at":{"type":"string","nullable":true,"format":"date-time","description":"Время обнаружения установки"},"activation_detected_at":{"type":"string","nullable":true,"format":"date-time","description":"Время обнаружения активации"},"last_status_update_at":{"type":"string","nullable":true,"format":"date-time","description":"Время обновления статуса"},"last_usage_update_at":{"type":"string","nullable":true,"format":"date-time","description":"Время обновления расхода трафика"},"expires_at":{"type":"string","nullable":true,"format":"date-time","description":"Время окончания срока действия"},"activated_at":{"type":"string","nullable":true,"format":"date-time","description":"Время активации eSIM"},"usage_synced_at":{"type":"string","nullable":true,"format":"date-time","description":"Время синхронизации трафика"},"usage_fetched_at":{"type":"string","nullable":true,"format":"date-time","description":"Время получения снимка нашим воркером"},"installed":{"type":"boolean","nullable":true,"description":"Установлена ли eSIM"},"usage_stale":{"type":"boolean","nullable":true,"description":"Устарели ли данные о трафике"},"usage_refreshed":{"type":"boolean","nullable":true,"description":"Обновил ли поставщик данные при последней синхронизации"}},"required":["order_esim_id","status","profile_status","total_bytes","used_bytes","remaining_bytes","usage_percent","installation_detected_at","activation_detected_at","last_status_update_at","last_usage_update_at","expires_at","activated_at","usage_synced_at","usage_fetched_at","installed","usage_stale","usage_refreshed"]},"EsimResponseDto":{"type":"object","properties":{"cancellation":{"description":"Доступность и состояние возврата по сохранённым данным eSIM, оплаты и пополнений. Без отдельного запроса проверки или обращения к поставщику. POST /esims/{id}/cancel повторно проверяет условия перед отменой.","allOf":[{"$ref":"#/components/schemas/EsimCancellationResponseDto"}]},"purchased_at":{"type":"string","nullable":true,"format":"date-time"},"plan_summary":{"$ref":"#/components/schemas/EsimPlanSummaryDto"},"usage":{"description":"Последний снимок статистики; обновляется воркером каждые 5 минут","allOf":[{"$ref":"#/components/schemas/LifecycleResponseDto"}]},"email_next_attempt_at":{"type":"string","nullable":true,"format":"date-time","description":"Время следующей попытки отправки письма; null, если отправка не запланирована"},"customer_page_url":{"type":"string","nullable":true,"format":"uri","description":"Приватная ссылка клиента на установку и статус eSIM"},"email_sent_at":{"type":"string","nullable":true,"format":"date-time","description":"Время отправки eSIM на email"},"email_last_error":{"type":"string","nullable":true,"description":"Последняя ошибка отправки email"},"id":{"type":"string","format":"uuid","description":"ID eSIM"},"order_id":{"type":"string","format":"uuid","description":"ID заказа"},"product_id":{"type":"string","nullable":true,"format":"uuid","description":"ID тарифа"},"plan_name":{"type":"string","description":"Название тарифа"},"plan_duration_days":{"type":"number","description":"Срок действия тарифа, дней"},"plan_unit_price_rub":{"type":"string","nullable":true,"example":"300.00","description":"Цена одной eSIM"},"sim_id":{"type":"string","nullable":true,"pattern":"^[0-9]{16}$","description":"ICCID eSIM"},"status":{"type":"string","nullable":true,"description":"Статус eSIM"},"activation_code":{"type":"string","nullable":true,"description":"Код ручной установки eSIM"},"ios_installation_url":{"type":"string","nullable":true,"format":"uri","description":"Ссылка на установку eSIM на iPhone"},"android_installation_url":{"type":"string","nullable":true,"format":"uri","description":"Ссылка на установку eSIM на Android"},"qr_code_url":{"type":"string","nullable":true,"format":"uri","description":"Ссылка на QR-код"},"installation_pdf_url":{"type":"string","nullable":true,"format":"uri","description":"Ссылка на PDF-инструкцию"},"files_last_error":{"type":"string","nullable":true,"description":"Последняя ошибка генерации файлов"},"apn":{"type":"string","nullable":true,"description":"APN для eSIM"},"fulfilled_at":{"type":"string","nullable":true,"format":"date-time","description":"Время выдачи eSIM"},"updated_at":{"type":"string","nullable":true,"format":"date-time","description":"Время обновления eSIM"}},"required":["cancellation","purchased_at","plan_summary","usage","email_next_attempt_at","customer_page_url","email_sent_at","email_last_error","id","order_id","product_id","plan_name","plan_duration_days","plan_unit_price_rub","sim_id","status","activation_code","ios_installation_url","android_installation_url","qr_code_url","installation_pdf_url","files_last_error","apn","fulfilled_at","updated_at"]},"FailureDto":{"type":"object","properties":{"code":{"type":"string","nullable":true,"description":"Код ошибки"},"message":{"type":"string","nullable":true,"description":"Описание ошибки"}},"required":["code","message"]},"TopupResponseDto":{"type":"object","properties":{"order_esim_id":{"type":"string","format":"uuid","description":"ID eSIM"},"package_code":{"type":"string","description":"Код пакета пополнения"},"package_name":{"type":"string","description":"Название пакета"},"package_name_rus":{"type":"string","nullable":true,"example":"Италия 1 ГБ 7 дней","description":"Название пакета на русском"},"data_megabytes":{"type":"string","nullable":true,"description":"Объём трафика, МБ"},"data_label":{"type":"string","nullable":true,"description":"Отображаемый объём трафика"},"validity_days":{"type":"number","nullable":true,"description":"Срок действия, дней"},"period_num":{"type":"number","nullable":true,"description":"Выбранный период"},"price_rub":{"type":"string","description":"Цена пополнения в RUB"},"refunded":{"type":"boolean","description":"Возвращена ли оплата"},"failure":{"nullable":true,"description":"Ошибка пополнения","type":"object","allOf":[{"$ref":"#/components/schemas/FailureDto"}]},"submitted_at":{"type":"string","nullable":true,"format":"date-time","description":"Время отправки пополнения"},"fulfilled_at":{"type":"string","nullable":true,"format":"date-time","description":"Время выполнения пополнения"},"failed_at":{"type":"string","nullable":true,"format":"date-time","description":"Время ошибки пополнения"}},"required":["order_esim_id","package_code","package_name","package_name_rus","data_megabytes","data_label","validity_days","period_num","price_rub","refunded","failure","submitted_at","fulfilled_at","failed_at"]},"OrderResponseDto":{"type":"object","properties":{"customer_email":{"type":"string","nullable":true,"format":"email","description":"Email клиента"},"id":{"type":"string","format":"uuid","description":"ID заказа"},"order_type":{"enum":["esim","topup"],"type":"string","description":"Тип заказа"},"source":{"enum":["partner_api","manual_buy"],"type":"string","description":"Источник заказа"},"status":{"enum":["processing","completed","refunded","failed","manual_review"],"type":"string","description":"Статус заказа.\n\n- `processing` — обработка\n- `completed` — выполнен\n- `refunded` — возврат\n- `failed` — ошибка\n- `manual_review` — ручная проверка"},"quantity":{"type":"number","description":"Количество eSIM"},"total_amount_rub":{"type":"string","nullable":true,"example":"1200.00","description":"Сумма заказа в RUB"},"esims":{"description":"eSIM в заказе","type":"array","items":{"$ref":"#/components/schemas/EsimResponseDto"}},"topup":{"nullable":true,"description":"Данные пополнения","type":"object","allOf":[{"$ref":"#/components/schemas/TopupResponseDto"}]},"last_error":{"type":"string","nullable":true,"description":"Последняя ошибка заказа"},"created_at":{"type":"string","format":"date-time","description":"Время создания заказа"},"settled_at":{"type":"string","nullable":true,"format":"date-time","description":"Время завершения заказа"}},"required":["customer_email","id","order_type","source","status","quantity","total_amount_rub","esims","topup","last_error","created_at","settled_at"]},"OrderListResponseDto":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"example":123,"description":"Общее количество записей"},"per_page":{"type":"integer","minimum":1,"maximum":100,"example":20,"description":"Количество записей на странице"},"current_page":{"type":"integer","minimum":1,"example":2,"description":"Номер текущей страницы"},"last_page":{"type":"integer","minimum":1,"example":7,"description":"Номер последней страницы"},"data":{"description":"Заказы текущей страницы","type":"array","items":{"$ref":"#/components/schemas/OrderResponseDto"}}},"required":["total","per_page","current_page","last_page","data"]},"CreateOrderItemDto":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"ID тарифа"},"quantity":{"type":"number","minimum":1,"maximum":10,"description":"Количество eSIM"},"days":{"type":"number","minimum":1,"maximum":365,"description":"Срок действия настраиваемого тарифа, дней"}},"required":["product_id","quantity"]},"CreateOrderDto":{"type":"object","properties":{"customer_email":{"type":"string","maxLength":254,"format":"email","description":"Email клиента для отправки eSIM"},"items":{"minItems":1,"description":"Позиции заказа","type":"array","items":{"$ref":"#/components/schemas/CreateOrderItemDto"}}},"required":["items"]},"CreateTopupDto":{"type":"object","properties":{"order_esim_id":{"type":"string","format":"uuid","description":"ID eSIM"},"package_code":{"type":"string","minLength":1,"maxLength":160,"description":"Код пакета пополнения"},"period_num":{"type":"number","minimum":1,"maximum":365,"description":"Период для пакета с настраиваемым сроком"}},"required":["order_esim_id","package_code"]},"ProductDataDto":{"type":"object","properties":{"megabytes":{"type":"string","description":"Объём трафика в МБ. Для безлимитного тарифа может быть 0"},"label":{"type":"string","nullable":true,"description":"Отображаемый объём трафика"},"type":{"type":"string","nullable":true,"enum":["fixed","daily","unlimited"],"description":"Тип пакета трафика"}},"required":["megabytes","label","type"]},"DurationDto":{"type":"object","properties":{"configurable":{"type":"boolean","description":"Можно ли выбрать срок действия"},"default_days":{"type":"number","description":"Срок действия по умолчанию, дней"},"minimum_days":{"type":"number","description":"Минимальный срок, дней"},"maximum_days":{"type":"number","description":"Максимальный срок, дней"}},"required":["configurable","default_days","minimum_days","maximum_days"]},"FairUseDto":{"type":"object","properties":{"high_speed_data_gb_per_day":{"type":"string","nullable":true,"description":"Лимит трафика на высокой скорости, ГБ в день"},"reduced_speed_mbps":{"type":"string","nullable":true,"description":"Скорость после исчерпания лимита, Мбит/с"}},"required":["high_speed_data_gb_per_day","reduced_speed_mbps"]},"CountryDto":{"type":"object","properties":{"country":{"type":"string","description":"Название страны"},"country_rus":{"type":"string","nullable":true,"description":"Название страны на русском"},"country_code":{"type":"string","description":"Код страны"}},"required":["country","country_rus","country_code"]},"NetworkDto":{"type":"object","properties":{"country":{"type":"string","nullable":true,"description":"Страна"},"country_rus":{"type":"string","nullable":true,"description":"Название страны на русском"},"country_code":{"type":"string","nullable":true,"description":"Код страны"},"operator":{"type":"string","nullable":true,"description":"Оператор связи"},"network":{"type":"string","nullable":true,"description":"Тип сети"}},"required":["country","country_rus","country_code","operator","network"]},"CoverageDto":{"type":"object","properties":{"codes":{"description":"Коды стран покрытия","type":"array","items":{"type":"string"}},"countries":{"description":"Страны покрытия","type":"array","items":{"$ref":"#/components/schemas/CountryDto"}},"networks":{"nullable":true,"description":"Доступные сети","type":"array","items":{"$ref":"#/components/schemas/NetworkDto"}},"breakout_ip_country_codes":{"nullable":true,"description":"Коды стран выхода IP","type":"array","items":{"type":"string"}}},"required":["codes","countries","networks","breakout_ip_country_codes"]},"ActivationDto":{"type":"object","properties":{"billing_starts":{"type":"string","nullable":true,"description":"Условие начала срока действия"},"pre_install_days":{"type":"number","nullable":true,"description":"Допустимый срок до установки, дней"}},"required":["billing_starts","pre_install_days"]},"TopupSupportDto":{"type":"object","properties":{"supported":{"type":"boolean","description":"Доступно ли пополнение"},"type":{"type":"string","nullable":true,"description":"Тип пополнения"}},"required":["supported","type"]},"ProductPriceDto":{"type":"object","properties":{"price_partner_rub":{"type":"string","example":"300.00","description":"Цена для партнёра"},"price_retail_rub":{"type":"string","example":"400.00","description":"Рекомендуемая розничная цена"},"price_partner_per_gb_rub":{"type":"string","nullable":true,"example":"100.000000","description":"Цена для партнёра за 1 ГБ. Null для безлимитных тарифов"},"price_retail_per_gb_rub":{"type":"string","nullable":true,"example":"133.333333","description":"Рекомендуемая розничная цена за 1 ГБ"},"billing_unit":{"type":"string","enum":["day","plan"],"description":"Единица расчёта: день или тариф"}},"required":["price_partner_rub","price_retail_rub","price_partner_per_gb_rub","price_retail_per_gb_rub","billing_unit"]},"ProductResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ID тарифа"},"name":{"type":"string","description":"Название тарифа"},"nameRus":{"type":"string","nullable":true,"example":"Турция 3 ГБ 30 дней","description":"Название тарифа на русском"},"slug":{"type":"string","description":"Slug тарифа"},"emoji":{"type":"string","nullable":true,"description":"Эмодзи направления"},"destination":{"type":"string","nullable":true,"description":"Направление тарифа"},"country_code":{"type":"string","nullable":true,"description":"Код страны"},"data":{"description":"Пакет трафика","allOf":[{"$ref":"#/components/schemas/ProductDataDto"}]},"validity_days":{"type":"number","description":"Срок действия, дней"},"duration":{"description":"Настройки срока действия","allOf":[{"$ref":"#/components/schemas/DurationDto"}]},"speed":{"type":"string","nullable":true,"description":"Скорость сети"},"tethering_allowed":{"type":"boolean","description":"Разрешена ли раздача интернета"},"fair_use":{"nullable":true,"description":"Ограничения fair use","type":"object","allOf":[{"$ref":"#/components/schemas/FairUseDto"}]},"coverage":{"description":"Покрытие тарифа","allOf":[{"$ref":"#/components/schemas/CoverageDto"}]},"activation":{"description":"Условия активации","allOf":[{"$ref":"#/components/schemas/ActivationDto"}]},"topup":{"description":"Параметры пополнения","allOf":[{"$ref":"#/components/schemas/TopupSupportDto"}]},"price":{"description":"Цены тарифа","allOf":[{"$ref":"#/components/schemas/ProductPriceDto"}]},"additional_info":{"type":"string","nullable":true,"description":"Дополнительная информация"},"available":{"type":"boolean","description":"Доступен ли тариф для покупки"},"updated_at":{"type":"string","nullable":true,"format":"date-time","description":"Время обновления тарифа"}},"required":["id","name","nameRus","slug","emoji","destination","country_code","data","validity_days","duration","speed","tethering_allowed","fair_use","coverage","activation","topup","price","additional_info","available","updated_at"]},"ProductListResponseDto":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"example":123,"description":"Общее количество записей"},"per_page":{"type":"integer","minimum":1,"maximum":100,"example":20,"description":"Количество записей на странице"},"current_page":{"type":"integer","minimum":1,"example":2,"description":"Номер текущей страницы"},"last_page":{"type":"integer","minimum":1,"example":7,"description":"Номер последней страницы"},"data":{"description":"Тарифы текущей страницы","type":"array","items":{"$ref":"#/components/schemas/ProductResponseDto"}}},"required":["total","per_page","current_page","last_page","data"]},"SendEsimSmsDto":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":500,"pattern":"\\S","description":"Служебное SMS. Управляющие символы запрещены."}},"required":["message"]},"EsimSmsResponseDto":{"type":"object","properties":{"sim_id":{"type":"string","pattern":"^[0-9]{16}$"},"status":{"type":"string","enum":["sent"],"description":"SMS принято оператором; доставка на устройство не гарантируется."}},"required":["sim_id","status"]},"EmailRetryResponseDto":{"type":"object","properties":{"status":{"type":"string","enum":["queued"],"description":"Письмо ожидает отправки или уже отправляется"}},"required":["status"]},"EsimListResponseDto":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"example":123,"description":"Общее количество записей"},"per_page":{"type":"integer","minimum":1,"maximum":100,"example":20,"description":"Количество записей на странице"},"current_page":{"type":"integer","minimum":1,"example":2,"description":"Номер текущей страницы"},"last_page":{"type":"integer","minimum":1,"example":7,"description":"Номер последней страницы"},"data":{"description":"eSIM текущей страницы","type":"array","items":{"$ref":"#/components/schemas/EsimResponseDto"}}},"required":["total","per_page","current_page","last_page","data"]},"TopupDataDto":{"type":"object","properties":{"megabytes":{"type":"string","nullable":true,"description":"Объём трафика, МБ"},"label":{"type":"string","nullable":true,"description":"Отображаемый объём трафика"}},"required":["megabytes","label"]},"TopupPeriodDto":{"type":"object","properties":{"required":{"type":"boolean","description":"Нужно ли указать период"},"minimum":{"type":"number","nullable":true,"description":"Минимальный период"},"maximum":{"type":"number","nullable":true,"description":"Максимальный период"},"default":{"type":"number","nullable":true,"description":"Период по умолчанию"}},"required":["required","minimum","maximum","default"]},"TopupPriceDto":{"type":"object","properties":{"price_partner_rub":{"type":"string","example":"125.00","description":"Цена для партнёра за пакет или день"},"price_retail_rub":{"type":"string","example":"200.00","description":"Рекомендуемая розничная цена за пакет или день"}},"required":["price_partner_rub","price_retail_rub"]},"TopupPlanResponseDto":{"type":"object","properties":{"package_code":{"type":"string","description":"Код пакета пополнения"},"name":{"type":"string","description":"Название пакета"},"country_rus":{"type":"string","nullable":true,"example":"Италия","description":"Название страны на русском"},"data":{"description":"Пакет трафика","allOf":[{"$ref":"#/components/schemas/TopupDataDto"}]},"validity_days":{"type":"number","nullable":true,"description":"Срок действия, дней"},"period":{"description":"Параметры периода","allOf":[{"$ref":"#/components/schemas/TopupPeriodDto"}]},"price":{"description":"Цены пополнения","allOf":[{"$ref":"#/components/schemas/TopupPriceDto"}]}},"required":["package_code","name","country_rus","data","validity_days","period","price"]},"EsimCancellationErrorDto":{"type":"object","properties":{"statusCode":{"type":"number"},"code":{"type":"string","enum":["cancellation_not_allowed","cancellation_temporarily_unavailable"]},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/EsimCancellationResponseDto"}},"required":["statusCode","code","message","data"]}}},"security":[{"partner-token":[]}]}