PAYMENTS - SERVER - CREATE ORDER SCALE SERVER CHANGE PLAN

Payments - Server - Create Order Scale Server Change Plan API Endpoints

Complete documentation for all Payments - Server - Create Order Scale Server Change Plan related endpoints.

POST

Create Order Scale Server Change Plan

Change server plan with scaling options.

Endpoint Details

HTTP Request
POST https://0xhost.net/API/orders/create_order
Parameters
Parameter Type Required Description
user_id string Yes User UUID
server_id string Yes Server UUID
plan_id string Yes New Plan ID
Authentication
API Key Required in header
Headers
Header Value Required Description
x-api-key your_api_key_here Yes Your unique API key for authentication
Content-Type application/json Optional Recommended for consistent response handling

Response Fields

Field Type Description
success boolean Indicates if the operation was successful
message string Response message describing the result
data object/array Contains the response data

Success Response

API Response Example
{
    "success": true,
    "amount": 54.75,
    "balance_before": "3383.53",
    "type": "scale_server",
    "plan_id": "7",
    "password": null,
    "hours_purchased": "720",
    "upgrade_difference": 24.76,
    "order_id": "f6ecf947-c8cb-11f0-8cdf-525400792197",
    "server_status": {
        "id": "8ecf771b-9d61-11f0-8cae-525400792197",
        "id_solusvm": 251,
        "solusvm_uuid": null,
        "cpu_cores": 2,
        "ram": 6442450944,
        "disk": 40,
        "disk_type": "ssd",
        "cpu": null,
        "ramD": null,
        "diskD": null,
        "name": "demo-server-001",
        "auto_renew": 0,
        "primary_ip": "192.168.100.101",
        "extra_ips": null,
        "status": "active",
        "updated_at": "2025-11-24 01:24:39",
        "plan_id": 7,
        "location": "Slovenia",
        "os_image_id": 6,
        "rental_duration_hours": 720,
        "owner_id": "user12345-6789-0123-4567-890123456789",
        "created_at": "2025-09-29 20:24:39",
        "expire_date": "2026-01-17 19:50:04",
        "metadata": "password=demoPassword123",
        "user_id": "user12345-6789-0123-4567-890123456789",
        "username": "root",
        "userIsActive": 1,
        "plan_price": "29.99"
    }
}

Code Examples

Programming Languages
JavaScript (Fetch API)
async function makeRequest() {
  try {
    const response = await fetch('https://0xhost.net/API/orders/create_order', {
      method: 'POST',
      headers: {
        'x-api-key': 'your_api_key_here',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
    "user_id": "user12345-6789-0123-4567-890123456789",
    "server_id": "server12345-6789-0123-4567-890123456789",
    "plan_id": "7"
})
    });
    
    const data = await response.json();
    console.log('Response:', data);
    return data;
  } catch (error) {
    console.error('Error:', error);
  }
}
Python (Requests)
import requests
import json

def make_request(api_key):
    url = 'https://0xhost.net/API/orders/create_order'
    headers = {
        'x-api-key': api_key,
        'Content-Type': 'application/json'
    }
    data = {
    "user_id": "user12345-6789-0123-4567-890123456789",
    "server_id": "server12345-6789-0123-4567-890123456789",
    "plan_id": "7"
}
    
    response = requests.request('POST', url, headers=headers, json=data)
    
    if response.status_code == 200:
        return response.json()
    else:
        print(f'Error: {response.status_code}')
        return None
PHP (cURL)
function makeRequest($apiKey) {
    $url = 'https://0xhost.net/API/orders/create_order';
    $data = {
    "user_id": "user12345-6789-0123-4567-890123456789",
    "server_id": "server12345-6789-0123-4567-890123456789",
    "plan_id": "7"
};
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'x-api-key: ' . $apiKey,
        'Content-Type: ' . $apiKey,
        'Content-Type: application/json'
    ]);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    return json_decode($response, true);
}
cURL Command
curl -X POST 'https://0xhost.net/API/orders/create_order' \
  -H 'x-api-key: your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "user_id": "user12345-6789-0123-4567-890123456789",
    "server_id": "server12345-6789-0123-4567-890123456789",
    "plan_id": "7"
}'