curl --request POST \
--url http://localhost:8080/cabinet/admin/users/{user_id}/subscription \
--header 'Content-Type: application/json' \
--data '
{
"action": "<string>",
"days": 1825,
"end_date": "2023-11-07T05:31:56Z",
"tariff_id": 123,
"traffic_limit_gb": 1,
"traffic_used_gb": 1,
"autopay_enabled": true,
"traffic_gb": 2,
"traffic_purchase_id": 123,
"is_trial": true,
"device_limit": 2
}
'{
"success": true,
"message": "<string>",
"subscription": {
"id": 123,
"status": "<string>",
"is_trial": true,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"traffic_limit_gb": 0,
"traffic_used_gb": 0,
"device_limit": 1,
"tariff_id": 123,
"tariff_name": "<string>",
"autopay_enabled": false,
"is_active": false,
"days_remaining": 0,
"purchased_traffic_gb": 0,
"traffic_purchases": []
}
}Update user subscription.
Actions:
curl --request POST \
--url http://localhost:8080/cabinet/admin/users/{user_id}/subscription \
--header 'Content-Type: application/json' \
--data '
{
"action": "<string>",
"days": 1825,
"end_date": "2023-11-07T05:31:56Z",
"tariff_id": 123,
"traffic_limit_gb": 1,
"traffic_used_gb": 1,
"autopay_enabled": true,
"traffic_gb": 2,
"traffic_purchase_id": 123,
"is_trial": true,
"device_limit": 2
}
'{
"success": true,
"message": "<string>",
"subscription": {
"id": 123,
"status": "<string>",
"is_trial": true,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"traffic_limit_gb": 0,
"traffic_used_gb": 0,
"device_limit": 1,
"tariff_id": 123,
"tariff_name": "<string>",
"autopay_enabled": false,
"is_active": false,
"days_remaining": 0,
"purchased_traffic_gb": 0,
"traffic_purchases": []
}
}Request to update user subscription.
Action: extend, set_end_date, change_tariff, set_traffic, toggle_autopay, cancel
Days to extend
1 <= x <= 3650New end date
New tariff ID
New traffic limit in GB
x >= 0Set traffic used in GB
x >= 0Enable/disable autopay
Traffic GB to add
x >= 1Traffic purchase ID to remove
Is trial subscription
Device limit
x >= 1