Get Renewal Price
The getContinueRentPrice method allows you to obtain the current renewal cost of a virtual number through the SMS.online API. This method is used to automate cost calculations before deciding to continue using the number.
The method provides the exact renewal cost for the specified period. This helps in planning expenses in advance and managing your account balance effectively.
A successful request returns an object with information about the renewal cost, including the number ID, renewal period, and amount. This method is recommended for systems with regular number renewals and cost control.
Example Request:
Input Data
Parameter | Required | Note | Description |
---|---|---|---|
Yes | See in profile settings API Key | API key provides access to paid services | |
Yes | getContinueRentPrice | Method name | |
Yes | Numeric value | Activation ID obtained when requesting the number | |
Yes | 4, 8, 12, 24, 72, 168, 360, 720, 2160 | Rental time in hours |
Server Response
JSON
{ "status": "success", "price": "100" }
Example Code
const api_key = "API_KEY"; # Replace 'API_KEY' with your actual API key.const id = 1; # Insert the activation ID obtained when requesting the numberconst rent_time = 1; # Insert the extension time in hours from the table abovetry {const response = await fetch(`https://api.sms.onlinestubs/handler_api.php?api_key=${api_key}&action=getContinueRentPrice&id=${id}&rent_time=${rent_time}`);# Make a GET request to the specified URLconst data = await response.json();# Output the content of the server responseconsole.log(data);} catch (err) {# If an error occurred, output the error messageconsole.error(err);}
Possible Errors
Parameter | Description |
---|---|
Invalid action | |
Invalid API key | |
Error in query | |
Time until account is unbanned | |
Account is inactive | |
Rental ID not specified | |
Number rented by someone else (incorrect rental ID) | |
Invalid extension time | |
Rental cannot be extended as the number's lifespan has expired | |
Maximum available time exceeded | |
Account is blocked |