API Queries - Renew Domain
The renew API function renews a domain for a specified number of years. Renewed years are added to the expiry date of your domain. Note that there are limits on the minimum and maximum number of years some domains can be registered. You will receive an error if the number of years provided is outside of this range. Some registries also limit the number of renewals that can be performed per day.
It is recommended you use the Check Pricing and Check Balance functions to check the domain cost and that your account balance is adequate before proceeding. The funds will be deducted from your account balance or an error will be returned if you do not have sufficient funds. Additional parameters are required for this function.
Additional Parameters
- domain - Domain name to renew. Note: http://www. should not be included.
- renew_year - Number of years to extend your domain registration by.
Your API key is required and all values should be correctly URL encoded.
Example 1
In the below example, we will renew the domain "shoes.com" (domain=shoes.com). There are various errors that could be returned and need to be handled by your custom application such as insufficient funds or domain not in your account.
Query
https://www.above.com/registrar/api/query.html?key=APIKEY&query=renew&domain=shoes.com&renew_year=2
Response
<results code="100" />
Example 2
In this example we will attempt to renew a domain for 12 years, which is beyond what we allow. We will use the domain "laces.com" (domain=laces.com).
Query
https://www.above.com/registrar/api/query.html?key=APIKEY&query=renew&domain=laces.com&renew_year=12
Response
<results code="803"> <msg>Renewal years must be 1-10 years</msg> </results>
Error Codes
Possible error responses for this function are:
- 508 - Insufficient balance
- 509 - Specified domain is not in your account
- 510 - Domain not specified or invalid domain
- 512 - Domain extension must be specified
- 514 - Domain is pending update or registrar/registry locked
- 801 - Renewal years not specified or value is not a valid number
- 802 - Renew Request exceeds the registry's policy limits
- 803 - Renewal years must be 1-10 years
- 804 - Renewal not allowed for this TLD
- General errors, such as 401 - Invalid API key or 500 - System unavailable.