curl --request POST \
--url http://localhost:8080/users/{user_id}/subscription \
--header 'Content-Type: application/json' \
--data '
{
"is_trial": false,
"duration_days": 123,
"traffic_limit_gb": 123,
"device_limit": 123,
"squad_uuid": "<string>",
"connected_squads": [
"<string>"
],
"replace_existing": false
}
'{
"id": 123,
"status": "<string>",
"language": "<string>",
"balance_kopeks": 123,
"balance_rubles": 123,
"has_had_paid_subscription": true,
"has_made_first_topup": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"telegram_id": 123,
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"referral_code": "<string>",
"referred_by_id": 123,
"last_activity": "2023-11-07T05:31:56Z",
"promo_group": {
"id": 123,
"name": "<string>",
"server_discount_percent": 123,
"traffic_discount_percent": 123,
"device_discount_percent": 123,
"apply_discounts_to_addons": true
},
"subscription": {
"id": 123,
"status": "<string>",
"actual_status": "<string>",
"is_trial": true,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"traffic_limit_gb": 123,
"traffic_used_gb": 123,
"device_limit": 123,
"autopay_enabled": true,
"autopay_days_before": 123,
"subscription_url": "<string>",
"subscription_crypto_link": "<string>",
"connected_squads": [
"<string>"
]
}
}Создать или заменить подписку для пользователя. Поддерживает создание как триальных, так и платных подписок.
curl --request POST \
--url http://localhost:8080/users/{user_id}/subscription \
--header 'Content-Type: application/json' \
--data '
{
"is_trial": false,
"duration_days": 123,
"traffic_limit_gb": 123,
"device_limit": 123,
"squad_uuid": "<string>",
"connected_squads": [
"<string>"
],
"replace_existing": false
}
'{
"id": 123,
"status": "<string>",
"language": "<string>",
"balance_kopeks": 123,
"balance_rubles": 123,
"has_had_paid_subscription": true,
"has_made_first_topup": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"telegram_id": 123,
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"referral_code": "<string>",
"referred_by_id": 123,
"last_activity": "2023-11-07T05:31:56Z",
"promo_group": {
"id": 123,
"name": "<string>",
"server_discount_percent": 123,
"traffic_discount_percent": 123,
"device_discount_percent": 123,
"apply_discounts_to_addons": true
},
"subscription": {
"id": 123,
"status": "<string>",
"actual_status": "<string>",
"is_trial": true,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"traffic_limit_gb": 123,
"traffic_used_gb": 123,
"device_limit": 123,
"autopay_enabled": true,
"autopay_days_before": 123,
"subscription_url": "<string>",
"subscription_crypto_link": "<string>",
"connected_squads": [
"<string>"
]
}
}Successful Response
Show child attributes
Show child attributes