curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "nordwind-furniture.com",
"offer_business_email": false
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url"
payload = {
"domain": "nordwind-furniture.com",
"offer_business_email": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'nordwind-furniture.com', offer_business_email: false})
};
fetch('https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url', 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://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url",
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([
'domain' => 'nordwind-furniture.com',
'offer_business_email' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url"
payload := strings.NewReader("{\n \"domain\": \"nordwind-furniture.com\",\n \"offer_business_email\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"nordwind-furniture.com\",\n \"offer_business_email\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"nordwind-furniture.com\",\n \"offer_business_email\": false\n}"
response = http.request(request)
puts response.read_body{
"url": "https://checkout.example.com/session/7c1e9f2a4b8d4e6f9a3c5b7d1e2f4a6c"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create domain checkout link
Creates a one-time checkout link for buying a domain through Base44.
Not every workspace can buy domains through the API. For one that can’t, the call is rejected and the domain has to be bought in the Base44 editor.
Pass domain to open checkout on that domain, and check it first with Check domain availability. Leave it out to open checkout on a domain search.
The person who opens the link pays at checkout, and nothing is bought until they finish. The domain is then attached to the app once it’s registered, and appears in List custom domains.
Each call returns a new link and buys nothing, so retrying is safe, including after a timeout. The call fails while the checkout provider is unavailable.
Creating links is limited to 6 requests a minute and 20 an hour per caller. Some workspaces have a different limit.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "nordwind-furniture.com",
"offer_business_email": false
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url"
payload = {
"domain": "nordwind-furniture.com",
"offer_business_email": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'nordwind-furniture.com', offer_business_email: false})
};
fetch('https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url', 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://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url",
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([
'domain' => 'nordwind-furniture.com',
'offer_business_email' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url"
payload := strings.NewReader("{\n \"domain\": \"nordwind-furniture.com\",\n \"offer_business_email\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"nordwind-furniture.com\",\n \"offer_business_email\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/custom-domains/purchase-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"nordwind-furniture.com\",\n \"offer_business_email\": false\n}"
response = http.request(request)
puts response.read_body{
"url": "https://checkout.example.com/session/7c1e9f2a4b8d4e6f9a3c5b7d1e2f4a6c"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app you're finding a domain for.
Body
Domain to open checkout on, such as example.com. Leave it out to open checkout on a domain search.
"nordwind-furniture.com"
Whether checkout also offers a business email address on the domain after the purchase (true) or not (false).
false
Response
Successful Response
A checkout link for buying a domain.
Checkout link to open in the browser of the person who'll pay. Treat it as opaque. It works once, so create a new one for each checkout.
"https://checkout.example.com/session/7c1e9f2a4b8d4e6f9a3c5b7d1e2f4a6c"
Was this page helpful?