/api/v1/vpn/subscriptions/{subscription_id}/renewДобавляет полный период тарифа по текущей цене из GET /plans. Истёкшая подписка возобновляется с текущего момента, действующая получает дни к концу срока. Замороженную сначала разморозьте.
curl -X POST https://api.relayhub.surf/api/v1/vpn/subscriptions/<subscription_id>/renew \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"custom_id": "11111111-1111-4111-8111-111111111111"
}'{
"success": true,
"custom_id": "11111111-1111-4111-8111-111111111111",
"subscription": {
"subscription_id": "01a06315-1270-705a-8d4c-58fea607bf2c",
"external_user_id": "user-42",
"plan_uuid": "550e8400-e29b-41d4-a716-446655440000",
"plan_name": "Standart 30d",
"is_trial": false,
"status": "active",
"subscription_url": "https://api.relayhub.surf/sub/wnT9NRf0Zk6McRRnp2nggc3K",
"days": 30,
"days_left": 60,
"devices": 2,
"auto_renew": false,
"renewal_count": 1,
"created_at": "2026-09-02T12:00:00Z",
"end_date": "2026-11-01T12:00:00Z",
"price_minor": 450,
"price_usd": "4.50"
},
"charged_minor": 450,
"charged_usd": "4.50",
"balance_after_minor": 11600,
"balance_after_usd": "116.00"
}Заголовок Authorization: Bearer <ключ> на каждом запросе. Ключ один на аккаунт, выпускается в кабинете партнёра и показывается один раз. Он тратит депозит: держите его на сервере.
custom_idstringобязательноВаш идентификатор операции, уникальный в рамках аккаунта. Повтор запроса с тем же custom_id вернёт результат первой попытки без повторного списания.
successbooleanобязательноcustom_idstringобязательноsubscriptionobjectобязательноcharged_minorintegerобязательноcharged_usdstringобязательноbalance_after_minorintegerобязательноbalance_after_usdstringобязательно401unauthorized: Неверный или отсутствующий API-ключ402insufficient_balance: Недостаточно средств на депозите403api_disabled: Доступ к API для этого аккаунта закрыт404subscription_not_found: Подписка не найдена; plan_not_found: Тариф не найден или недоступен409subscription_frozen: Подписка заморожена; trial_not_renewable: Пробную подписку нельзя продлить; custom_id_conflict: Этот custom_id уже использован с другими параметрами; operation_in_progress: Операция с этим custom_id ещё выполняется422Validation Error429rate_limited: Слишком много запросов503upstream_unavailable: Поставщик VPN временно недоступенcurl -X POST https://api.relayhub.surf/api/v1/vpn/subscriptions/<subscription_id>/renew \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"custom_id": "11111111-1111-4111-8111-111111111111"
}'{
"success": true,
"custom_id": "11111111-1111-4111-8111-111111111111",
"subscription": {
"subscription_id": "01a06315-1270-705a-8d4c-58fea607bf2c",
"external_user_id": "user-42",
"plan_uuid": "550e8400-e29b-41d4-a716-446655440000",
"plan_name": "Standart 30d",
"is_trial": false,
"status": "active",
"subscription_url": "https://api.relayhub.surf/sub/wnT9NRf0Zk6McRRnp2nggc3K",
"days": 30,
"days_left": 60,
"devices": 2,
"auto_renew": false,
"renewal_count": 1,
"created_at": "2026-09-02T12:00:00Z",
"end_date": "2026-11-01T12:00:00Z",
"price_minor": 450,
"price_usd": "4.50"
},
"charged_minor": 450,
"charged_usd": "4.50",
"balance_after_minor": 11600,
"balance_after_usd": "116.00"
}