Create a server order
curl --request POST \
--url https://console.wenium.com/api/servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selectedTypeId": 1,
"selectedLocationId": 2,
"billingCycle": "monthly",
"instanceCount": 1,
"isCustom": false,
"selectedSoftwareId": "ubuntu-22.04",
"hostname": "web-server-01",
"promoCode": "WELCOME50",
"selectedPlanId": 4,
"customSpec": {
"cpu": 2,
"ram": 2,
"disk": 40,
"bandwidth": 100
},
"addons": {
"additional_ips": 0,
"backups": true,
"ipv6": false
}
}
'import requests
url = "https://console.wenium.com/api/servers"
payload = {
"selectedTypeId": 1,
"selectedLocationId": 2,
"billingCycle": "monthly",
"instanceCount": 1,
"isCustom": False,
"selectedSoftwareId": "ubuntu-22.04",
"hostname": "web-server-01",
"promoCode": "WELCOME50",
"selectedPlanId": 4,
"customSpec": {
"cpu": 2,
"ram": 2,
"disk": 40,
"bandwidth": 100
},
"addons": {
"additional_ips": 0,
"backups": True,
"ipv6": 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({
selectedTypeId: 1,
selectedLocationId: 2,
billingCycle: 'monthly',
instanceCount: 1,
isCustom: false,
selectedSoftwareId: 'ubuntu-22.04',
hostname: 'web-server-01',
promoCode: 'WELCOME50',
selectedPlanId: 4,
customSpec: {cpu: 2, ram: 2, disk: 40, bandwidth: 100},
addons: {additional_ips: 0, backups: true, ipv6: false}
})
};
fetch('https://console.wenium.com/api/servers', 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://console.wenium.com/api/servers",
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([
'selectedTypeId' => 1,
'selectedLocationId' => 2,
'billingCycle' => 'monthly',
'instanceCount' => 1,
'isCustom' => false,
'selectedSoftwareId' => 'ubuntu-22.04',
'hostname' => 'web-server-01',
'promoCode' => 'WELCOME50',
'selectedPlanId' => 4,
'customSpec' => [
'cpu' => 2,
'ram' => 2,
'disk' => 40,
'bandwidth' => 100
],
'addons' => [
'additional_ips' => 0,
'backups' => true,
'ipv6' => 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://console.wenium.com/api/servers"
payload := strings.NewReader("{\n \"selectedTypeId\": 1,\n \"selectedLocationId\": 2,\n \"billingCycle\": \"monthly\",\n \"instanceCount\": 1,\n \"isCustom\": false,\n \"selectedSoftwareId\": \"ubuntu-22.04\",\n \"hostname\": \"web-server-01\",\n \"promoCode\": \"WELCOME50\",\n \"selectedPlanId\": 4,\n \"customSpec\": {\n \"cpu\": 2,\n \"ram\": 2,\n \"disk\": 40,\n \"bandwidth\": 100\n },\n \"addons\": {\n \"additional_ips\": 0,\n \"backups\": true,\n \"ipv6\": false\n }\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://console.wenium.com/api/servers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"selectedTypeId\": 1,\n \"selectedLocationId\": 2,\n \"billingCycle\": \"monthly\",\n \"instanceCount\": 1,\n \"isCustom\": false,\n \"selectedSoftwareId\": \"ubuntu-22.04\",\n \"hostname\": \"web-server-01\",\n \"promoCode\": \"WELCOME50\",\n \"selectedPlanId\": 4,\n \"customSpec\": {\n \"cpu\": 2,\n \"ram\": 2,\n \"disk\": 40,\n \"bandwidth\": 100\n },\n \"addons\": {\n \"additional_ips\": 0,\n \"backups\": true,\n \"ipv6\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.wenium.com/api/servers")
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 \"selectedTypeId\": 1,\n \"selectedLocationId\": 2,\n \"billingCycle\": \"monthly\",\n \"instanceCount\": 1,\n \"isCustom\": false,\n \"selectedSoftwareId\": \"ubuntu-22.04\",\n \"hostname\": \"web-server-01\",\n \"promoCode\": \"WELCOME50\",\n \"selectedPlanId\": 4,\n \"customSpec\": {\n \"cpu\": 2,\n \"ram\": 2,\n \"disk\": 40,\n \"bandwidth\": 100\n },\n \"addons\": {\n \"additional_ips\": 0,\n \"backups\": true,\n \"ipv6\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Order created successfully.",
"invoice_id": 123,
"amount": 21,
"currency": "USD"
}Virtual Machines
Create a server order
POST
/
servers
Create a server order
curl --request POST \
--url https://console.wenium.com/api/servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selectedTypeId": 1,
"selectedLocationId": 2,
"billingCycle": "monthly",
"instanceCount": 1,
"isCustom": false,
"selectedSoftwareId": "ubuntu-22.04",
"hostname": "web-server-01",
"promoCode": "WELCOME50",
"selectedPlanId": 4,
"customSpec": {
"cpu": 2,
"ram": 2,
"disk": 40,
"bandwidth": 100
},
"addons": {
"additional_ips": 0,
"backups": true,
"ipv6": false
}
}
'import requests
url = "https://console.wenium.com/api/servers"
payload = {
"selectedTypeId": 1,
"selectedLocationId": 2,
"billingCycle": "monthly",
"instanceCount": 1,
"isCustom": False,
"selectedSoftwareId": "ubuntu-22.04",
"hostname": "web-server-01",
"promoCode": "WELCOME50",
"selectedPlanId": 4,
"customSpec": {
"cpu": 2,
"ram": 2,
"disk": 40,
"bandwidth": 100
},
"addons": {
"additional_ips": 0,
"backups": True,
"ipv6": 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({
selectedTypeId: 1,
selectedLocationId: 2,
billingCycle: 'monthly',
instanceCount: 1,
isCustom: false,
selectedSoftwareId: 'ubuntu-22.04',
hostname: 'web-server-01',
promoCode: 'WELCOME50',
selectedPlanId: 4,
customSpec: {cpu: 2, ram: 2, disk: 40, bandwidth: 100},
addons: {additional_ips: 0, backups: true, ipv6: false}
})
};
fetch('https://console.wenium.com/api/servers', 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://console.wenium.com/api/servers",
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([
'selectedTypeId' => 1,
'selectedLocationId' => 2,
'billingCycle' => 'monthly',
'instanceCount' => 1,
'isCustom' => false,
'selectedSoftwareId' => 'ubuntu-22.04',
'hostname' => 'web-server-01',
'promoCode' => 'WELCOME50',
'selectedPlanId' => 4,
'customSpec' => [
'cpu' => 2,
'ram' => 2,
'disk' => 40,
'bandwidth' => 100
],
'addons' => [
'additional_ips' => 0,
'backups' => true,
'ipv6' => 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://console.wenium.com/api/servers"
payload := strings.NewReader("{\n \"selectedTypeId\": 1,\n \"selectedLocationId\": 2,\n \"billingCycle\": \"monthly\",\n \"instanceCount\": 1,\n \"isCustom\": false,\n \"selectedSoftwareId\": \"ubuntu-22.04\",\n \"hostname\": \"web-server-01\",\n \"promoCode\": \"WELCOME50\",\n \"selectedPlanId\": 4,\n \"customSpec\": {\n \"cpu\": 2,\n \"ram\": 2,\n \"disk\": 40,\n \"bandwidth\": 100\n },\n \"addons\": {\n \"additional_ips\": 0,\n \"backups\": true,\n \"ipv6\": false\n }\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://console.wenium.com/api/servers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"selectedTypeId\": 1,\n \"selectedLocationId\": 2,\n \"billingCycle\": \"monthly\",\n \"instanceCount\": 1,\n \"isCustom\": false,\n \"selectedSoftwareId\": \"ubuntu-22.04\",\n \"hostname\": \"web-server-01\",\n \"promoCode\": \"WELCOME50\",\n \"selectedPlanId\": 4,\n \"customSpec\": {\n \"cpu\": 2,\n \"ram\": 2,\n \"disk\": 40,\n \"bandwidth\": 100\n },\n \"addons\": {\n \"additional_ips\": 0,\n \"backups\": true,\n \"ipv6\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.wenium.com/api/servers")
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 \"selectedTypeId\": 1,\n \"selectedLocationId\": 2,\n \"billingCycle\": \"monthly\",\n \"instanceCount\": 1,\n \"isCustom\": false,\n \"selectedSoftwareId\": \"ubuntu-22.04\",\n \"hostname\": \"web-server-01\",\n \"promoCode\": \"WELCOME50\",\n \"selectedPlanId\": 4,\n \"customSpec\": {\n \"cpu\": 2,\n \"ram\": 2,\n \"disk\": 40,\n \"bandwidth\": 100\n },\n \"addons\": {\n \"additional_ips\": 0,\n \"backups\": true,\n \"ipv6\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Order created successfully.",
"invoice_id": 123,
"amount": 21,
"currency": "USD"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
1
Example:
2
Available options:
hourly, monthly, quarterly, semi_annually, yearly Example:
"monthly"
Required range:
1 <= x <= 10Example:
1
Example:
false
Example:
"ubuntu-22.04"
Example:
"web-server-01"
Example:
"WELCOME50"
Required if isCustom is false (prebuilt plan order). Nullable if ordering a custom spec server.
Example:
4
Show child attributes
Show child attributes
Show child attributes
Show child attributes
