curl --request POST \
--url https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"purchasePrice": 123,
"years": 1
}
'import requests
url = "https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy"
payload = {
"purchasePrice": 123,
"years": 1
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({purchasePrice: 123, years: 1})
};
fetch('https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purchasePrice' => 123,
'years' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy"
payload := strings.NewReader("{\n \"purchasePrice\": 123,\n \"years\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}HttpResponse<String> response = Unirest.post("https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"purchasePrice\": 123,\n \"years\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchasePrice\": 123,\n \"years\": 1\n}"
response = http.request(request)
puts response.read_body{
"order": 123,
"totalPaid": 0,
"domain": {
"domainName": "example.com",
"createDate": "2023-01-15T14:30:00Z",
"expireDate": "2025-01-15T14:30:00Z",
"autorenewEnabled": true,
"locked": true,
"privacyEnabled": true,
"contacts": {
"admin": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
},
"billing": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
},
"registrant": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
},
"tech": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
}
},
"nameservers": [
"ns1.example.com",
"ns2.example.com"
],
"locks": [
"clientTransferProhibited",
"clientHold"
],
"transferLockExpiresAt": "2023-03-16T14:30:00Z",
"renewalPrice": 12.99
}
}Purchase Privacy
Adds or renews WHOIS privacy protection for a domain. This is used to ensure personal contact details remain hidden from public WHOIS lookups. If WHOIS privacy is already enabled, this will extend the protection. If it’s not yet active, this will enable the service. WHOIS privacy is free for API users and does not add a fee.
curl --request POST \
--url https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"purchasePrice": 123,
"years": 1
}
'import requests
url = "https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy"
payload = {
"purchasePrice": 123,
"years": 1
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({purchasePrice: 123, years: 1})
};
fetch('https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purchasePrice' => 123,
'years' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy"
payload := strings.NewReader("{\n \"purchasePrice\": 123,\n \"years\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}HttpResponse<String> response = Unirest.post("https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"purchasePrice\": 123,\n \"years\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.name.com/core/v1/domains/{domainName}:purchasePrivacy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchasePrice\": 123,\n \"years\": 1\n}"
response = http.request(request)
puts response.read_body{
"order": 123,
"totalPaid": 0,
"domain": {
"domainName": "example.com",
"createDate": "2023-01-15T14:30:00Z",
"expireDate": "2025-01-15T14:30:00Z",
"autorenewEnabled": true,
"locked": true,
"privacyEnabled": true,
"contacts": {
"admin": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
},
"billing": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
},
"registrant": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
},
"tech": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Example Inc.",
"address1": "123 Main Street",
"address2": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"email": "john.doe@example.com",
"phone": "+15551234567",
"fax": "+15557654321",
"isVerified": true,
"verificationId": 12345
}
},
"nameservers": [
"ns1.example.com",
"ns2.example.com"
],
"locks": [
"clientTransferProhibited",
"clientHold"
],
"transferLockExpiresAt": "2023-03-16T14:30:00Z",
"renewalPrice": 12.99
}
}Authorizations
Authenticate via HTTP Basic with your account username and API token. Examples use an explicit 'Authorization: Basic <base64(username:token)>' header; 'curl -u username:token' is equivalent. For sandbox, append "-test" to your username and use your sandbox token on api.dev.name.com.
Headers
A unique string (e.g., a UUID v4) to make the request idempotent. This key ensures that if the request is retried, the operation will not be performed multiple times. Subsequent requests with the same key will return the original result.
"083910ef-04e4-4bd1-a0bf-3737fe005ca8"
Path Parameters
DomainName is the domain to enable or extend Whois Privacy for.
Body
Request body for enabling or extending WHOIS privacy on a domain.
Response
A successful response.
PrivacyResponse contains the updated domain info as well as the order info for the Whois Privacy that was enabled or extended.
Order is an identifier for this purchase.
TotalPaid is the total amount paid, including VAT when applicable. Whois Privacy is free and is not included in this amount.
0
The response format for a domain.
Show child attributes
Show child attributes
Was this page helpful?