Skip to main content
POST
/
cabinet
/
admin
/
users
/
{user_id}
/
subscription
Update User Subscription
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": []
  }
}

Path Parameters

user_id
integer
required

Body

application/json

Request to update user subscription.

action
string
required

Action: extend, set_end_date, change_tariff, set_traffic, toggle_autopay, cancel

days
integer | null

Days to extend

Required range: 1 <= x <= 3650
end_date
string<date-time> | null

New end date

tariff_id
integer | null

New tariff ID

traffic_limit_gb
integer | null

New traffic limit in GB

Required range: x >= 0
traffic_used_gb
number | null

Set traffic used in GB

Required range: x >= 0
autopay_enabled
boolean | null

Enable/disable autopay

traffic_gb
integer | null

Traffic GB to add

Required range: x >= 1
traffic_purchase_id
integer | null

Traffic purchase ID to remove

is_trial
boolean | null

Is trial subscription

device_limit
integer | null

Device limit

Required range: x >= 1

Response

Successful Response

Response after subscription update.

success
boolean
required
message
string
required
subscription
UserSubscriptionInfo · object

User subscription information.