Update Subscription Type

Estimated reading: 2 minutes

Changing the subscription type of a VPN account is an essential feature for managing user plans and providing flexibility in VPN services. This functionality allows administrators or users to update the subscription type—such as free, trial, or paid—through API calls, enabling dynamic management of VPN accounts based on user needs or changes in service plans. This article provides a technical overview of how to implement subscription type changes through API.

Update Subscription Type

Use this API to update user subscription.

Returns a JSON object that contains the VPN username.

  • URL: <base url>/vam/v1/user/subscription
  • Request Method: PUT

Payload

KeyTypePass inDescription
X-AccessToken*StringHeaderaccessToken retrieved from Get Access Token endpoint
vpnUsername*StringBodyVPN Username
subscriptionType*StringBodyAccount subscription type (trial, paid and freemium) by default is paid
(*) Required Parameter

Response

KeyTypeDescription
headerJSONJSON object that describes return code and message
bodyJSONJSON object that return VPN username

Possible API error codes

CodeMessageDescription
2081There is some problem in updating vpn account Subscription TypeAn error occurred while attempting to update the VPN account subscription type.
2083The user subscription type is same as provided.The provided subscription type is identical to the current one. No changes were made.
11001The provided username is not valid for this reseller.The provided username is not recognized as valid for the associated reseller.
60005Account is expiredThe account has expired and is no longer active.
60006Account is disableThe account has been disabled and is no longer active.

Sample Response

{
  "header": {
    "message": "VPN account Subscription Type has been updated successfully"
    "response_code": 1,
  },
  "body": {
    "vpnUsername": "xxxxxx",
   }
}
Share this Doc

Update Subscription Type

Or copy link

On This Page