Domains
Purchase Domain
Purchase a domain.
This is a billable action. Ensure you have sufficient funds in your account. The domain will be registered with the provided contact information.
POST
/
api
/
v1
/
registrar
/
purchase
Purchase Domain
curl --request POST \
--url https://api.dotlet.net/api/v1/registrar/purchase \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"domain": "<string>",
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"organization": "<string>",
"address2": "<string>"
},
"years": 1,
"nameservers": [
"<string>"
],
"privacy": true,
"auto_renew": true,
"registrar": "namecheap",
"setup_dns": false,
"dns_provider": "cloudflare"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain: '<string>',
contact: {
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>',
organization: '<string>',
address2: '<string>'
},
years: 1,
nameservers: ['<string>'],
privacy: true,
auto_renew: true,
registrar: 'namecheap',
setup_dns: false,
dns_provider: 'cloudflare'
})
};
fetch('https://api.dotlet.net/api/v1/registrar/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dotlet.net/api/v1/registrar/purchase"
payload = {
"domain": "<string>",
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"organization": "<string>",
"address2": "<string>"
},
"years": 1,
"nameservers": ["<string>"],
"privacy": True,
"auto_renew": True,
"registrar": "namecheap",
"setup_dns": False,
"dns_provider": "cloudflare"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dotlet.net/api/v1/registrar/purchase"
payload := strings.NewReader("{\n \"domain\": \"<string>\",\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"organization\": \"<string>\",\n \"address2\": \"<string>\"\n },\n \"years\": 1,\n \"nameservers\": [\n \"<string>\"\n ],\n \"privacy\": true,\n \"auto_renew\": true,\n \"registrar\": \"namecheap\",\n \"setup_dns\": false,\n \"dns_provider\": \"cloudflare\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"domain": "<string>",
"order_id": "<string>",
"registrar_order_id": "<string>",
"registration_date": "2023-11-07T05:31:56Z",
"expiry_date": "2023-11-07T05:31:56Z",
"nameservers": [],
"error_message": "<string>",
"dns_setup": {},
"status_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
APIKeyHeaderHTTPBearer
Body
application/json
Request to purchase a domain
Required string length:
1 - 255Contact information for domain registration
Show child attributes
Show child attributes
Required range:
1 <= x <= 10Registrar to use (currently only namecheap is supported)
Automatically setup DNS after purchase
DNS provider to use for setup
Response
Successful Response
Response for domain purchase
⌘I
Purchase Domain
curl --request POST \
--url https://api.dotlet.net/api/v1/registrar/purchase \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"domain": "<string>",
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"organization": "<string>",
"address2": "<string>"
},
"years": 1,
"nameservers": [
"<string>"
],
"privacy": true,
"auto_renew": true,
"registrar": "namecheap",
"setup_dns": false,
"dns_provider": "cloudflare"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain: '<string>',
contact: {
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>',
organization: '<string>',
address2: '<string>'
},
years: 1,
nameservers: ['<string>'],
privacy: true,
auto_renew: true,
registrar: 'namecheap',
setup_dns: false,
dns_provider: 'cloudflare'
})
};
fetch('https://api.dotlet.net/api/v1/registrar/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dotlet.net/api/v1/registrar/purchase"
payload = {
"domain": "<string>",
"contact": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"organization": "<string>",
"address2": "<string>"
},
"years": 1,
"nameservers": ["<string>"],
"privacy": True,
"auto_renew": True,
"registrar": "namecheap",
"setup_dns": False,
"dns_provider": "cloudflare"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dotlet.net/api/v1/registrar/purchase"
payload := strings.NewReader("{\n \"domain\": \"<string>\",\n \"contact\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"organization\": \"<string>\",\n \"address2\": \"<string>\"\n },\n \"years\": 1,\n \"nameservers\": [\n \"<string>\"\n ],\n \"privacy\": true,\n \"auto_renew\": true,\n \"registrar\": \"namecheap\",\n \"setup_dns\": false,\n \"dns_provider\": \"cloudflare\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"domain": "<string>",
"order_id": "<string>",
"registrar_order_id": "<string>",
"registration_date": "2023-11-07T05:31:56Z",
"expiry_date": "2023-11-07T05:31:56Z",
"nameservers": [],
"error_message": "<string>",
"dns_setup": {},
"status_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}