{"id":10091,"date":"2024-06-10T11:59:29","date_gmt":"2024-06-10T11:59:29","guid":{"rendered":"https:\/\/www.purewl.com\/developer\/docs\/api-reference\/api-reference\/vpn-account-management-vam\/renew-account\/"},"modified":"2025-09-03T08:53:54","modified_gmt":"2025-09-03T08:53:54","slug":"renew-account","status":"publish","type":"docs","link":"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/vpn-account-management-vam\/renew-account\/","title":{"rendered":"Renew Account"},"content":{"rendered":"\n<p>Renewing VPN accounts via API is an essential feature for managing subscription-based VPN services. This functionality allows users or administrators to extend the validity of a VPN account seamlessly, ensuring continuous access to VPN resources. This article provides a concise technical overview of how to implement VPN account renewal through API calls.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Renew<\/h2>\n\n\n\n<p>Use this API to renew and account period and package with Preferences.<\/p>\n\n\n\n<p>Returns JSON object that contains the VPN user name and renew day.<\/p>\n\n\n\n<p><strong><em>Note: The account can only be renewed when 10 days or fewer remain before expiration.<\/em><\/strong><\/p>\n\n\n\n<ul>\n<li><strong>URL:&nbsp;<\/strong>&lt;base url&gt;\/vam\/v2\/renew<\/li>\n\n\n\n<li><strong>Request Method:&nbsp;<\/strong>PUT<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Payload<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>Key<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Type<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Pass in<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>X-AccessToken<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Header<\/td><td class=\"has-text-align-left\" data-align=\"left\"><kbd>accessToken<\/kbd> retrieved from <a href=\"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/api-access-authentication\/#get-access-token\" data-type=\"link\" data-id=\"https:\/\/www.purewl.com\/developer\/guides\/api\/api-reference\/inventory-management\/countries\/\" target=\"_blank\" rel=\"noreferrer noopener\">Get Access Token<\/a> endpoint<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>vpnUsername<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Body<\/td><td class=\"has-text-align-left\" data-align=\"left\">VPN Username<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>period<\/code>*<\/td><td class=\"has-text-align-left\" data-align=\"left\">Integer<\/td><td class=\"has-text-align-left\" data-align=\"left\">Body<\/td><td class=\"has-text-align-left\" data-align=\"left\">Period of account. It can be maximum 3700<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>preferences<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">String<\/td><td class=\"has-text-align-left\" data-align=\"left\">Body<\/td><td class=\"has-text-align-left\" data-align=\"left\">A structured JSON to specify allowed options such as multi-login limit and locations for the VPN account.<br>Sample JSON:\u00a0 {\u201cmulti_login\u201d:5,\u201dsession_limit\u201d:50,\u201dcountry\u201d:[1,2,3],\u201dcity\u201d:[1,2,3],\u201dprotocol\u201d:[1,2,3]}<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>preferences_format<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">Body<\/td><td class=\"has-text-align-left\" data-align=\"left\">Format of the preferences\u00a0and its value should always be\u00a0<strong>keys<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Response<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>Key<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Type<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>header<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that describes return code and message<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><code>body<\/code><\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON<\/td><td class=\"has-text-align-left\" data-align=\"left\">JSON object that return username and renew days<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Possible API error codes<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Code<\/strong><\/td><td><strong>Message<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><code>11001<\/code><\/td><td>The provided username is not valid for this reseller<\/td><td>The provided username is not recognized as valid for the associated reseller.<\/td><\/tr><tr><td><code>100010<\/code><\/td><td>You can renew account when 10 or less days are remaining<\/td><td>The account can only be renewed when 10 or fewer days are left until expiration.<\/td><\/tr><tr><td><code>100033<\/code><\/td><td>This Dedicated User IP has been assigned to another user<\/td><td>The Dedicated IP has been assigned to a different user.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sample Response<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-json\" data-lang=\"JSON\" data-show-lang=\"1\"><code>{\n  &quot;header&quot;: {\n    &quot;response_code&quot;: 1,\n    &quot;message&quot;: &quot;VPN account has been renewed successfully&quot;\n  },\n  &quot;body&quot;: {\n    &quot;vpnUsername&quot;: &quot;xxxxxxxx&quot;,\n    &quot;renewForDays&quot;: &quot;xxxxxxxx&quot;,\n  }\n}<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Renewing VPN accounts via API is an essential feature for managing subscription-based VPN services. This functionality allows users or administrators to extend the validity of a VPN account seamlessly, ensuring continuous access to VPN resources. This article provides a concise technical overview of how to implement VPN account renewal through API calls. Renew Use this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":10017,"menu_order":8,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10091"}],"collection":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/comments?post=10091"}],"version-history":[{"count":19,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10091\/revisions"}],"predecessor-version":[{"id":11142,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10091\/revisions\/11142"}],"up":[{"embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/docs\/10017"}],"wp:attachment":[{"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/media?parent=10091"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.purewl.com\/developer\/wp-json\/wp\/v2\/doc_tag?post=10091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}