curl --request POST \
--url https://rdp.sh/api/v1/order \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"plan_id": 123,
"region_id": 1,
"distro_id": 123,
"duration": 1,
"ssh_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example"
}
'import requests
url = "https://rdp.sh/api/v1/order"
payload = {
"plan_id": 123,
"region_id": 1,
"distro_id": 123,
"duration": 1,
"ssh_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plan_id: 123,
region_id: 1,
distro_id: 123,
duration: 1,
ssh_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example'
})
};
fetch('https://rdp.sh/api/v1/order', 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://rdp.sh/api/v1/order",
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([
'plan_id' => 123,
'region_id' => 1,
'distro_id' => 123,
'duration' => 1,
'ssh_key' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://rdp.sh/api/v1/order"
payload := strings.NewReader("{\n \"plan_id\": 123,\n \"region_id\": 1,\n \"distro_id\": 123,\n \"duration\": 1,\n \"ssh_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.post("https://rdp.sh/api/v1/order")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"plan_id\": 123,\n \"region_id\": 1,\n \"distro_id\": 123,\n \"duration\": 1,\n \"ssh_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rdp.sh/api/v1/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan_id\": 123,\n \"region_id\": 1,\n \"distro_id\": 123,\n \"duration\": 1,\n \"ssh_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"server_id": 123,
"invoice_id": 123,
"duration": 1,
"amount_charged": 102,
"expiry_date": "2027-05-04T12:00:00.000000Z"
}Purchase server
This API endpoint allows you to purchase a new server using your
available balance. By default the server is provisioned for one month;
pass duration to purchase a longer initial term and benefit from the
duration discount tiers.
curl --request POST \
--url https://rdp.sh/api/v1/order \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"plan_id": 123,
"region_id": 1,
"distro_id": 123,
"duration": 1,
"ssh_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example"
}
'import requests
url = "https://rdp.sh/api/v1/order"
payload = {
"plan_id": 123,
"region_id": 1,
"distro_id": 123,
"duration": 1,
"ssh_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plan_id: 123,
region_id: 1,
distro_id: 123,
duration: 1,
ssh_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example'
})
};
fetch('https://rdp.sh/api/v1/order', 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://rdp.sh/api/v1/order",
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([
'plan_id' => 123,
'region_id' => 1,
'distro_id' => 123,
'duration' => 1,
'ssh_key' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://rdp.sh/api/v1/order"
payload := strings.NewReader("{\n \"plan_id\": 123,\n \"region_id\": 1,\n \"distro_id\": 123,\n \"duration\": 1,\n \"ssh_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.post("https://rdp.sh/api/v1/order")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"plan_id\": 123,\n \"region_id\": 1,\n \"distro_id\": 123,\n \"duration\": 1,\n \"ssh_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rdp.sh/api/v1/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan_id\": 123,\n \"region_id\": 1,\n \"distro_id\": 123,\n \"duration\": 1,\n \"ssh_key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"server_id": 123,
"invoice_id": 123,
"duration": 1,
"amount_charged": 102,
"expiry_date": "2027-05-04T12:00:00.000000Z"
}Authorizations
Body
ID of the plan to purchase.
ID of the region to deploy in.
1
ID of the distro or ISO image to install on the server.
Number of months to purchase the server for (1-12). The total
is calculated as plan.price * duration with the duration
discount tier applied:
- 3 months: 5% off
- 6 months: 10% off
- 12 months: 15% off
Other durations (1, 2, 4, 5, 7, 8, 9, 10, 11) receive no discount.
1 <= x <= 12Optional raw SSH public key (e.g. ssh-ed25519 AAAA... user@host)
to install on the new server. Only valid when distro_id
refers to a Linux distro — supplying it together with a
Windows ISO returns an error.
The key is provisioned via cloud-init at first boot. You do not need to register the key on the dashboard first.
8192"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyDataHere user@example"
Response
The request was successful, and a new resource was created.
ID of the invoice created for this purchase.
Number of months the server was purchased for.
1
Total amount deducted from the user's balance after applying the duration discount tier.
102
ISO-8601 expiry timestamp for the new server.
"2027-05-04T12:00:00.000000Z"