PLESK - ORDERS - CREATE ORDER

Plesk - Orders - Create Order API Endpoints

Complete documentation for all Plesk - Orders - Create Order related endpoints.

POST

Create Plesk Order

Create a new Web Hosting order for a domain.

Endpoint Details

HTTP Request
POST https://0xhost.com/API/orders/create_order_plesk
Parameters
Parameter Type Required Description
plan_id string Yes Plesk plan ID
client_id string Yes Plesk client ID
domain_name string Yes Domain name for hosting
ftp_login string Yes FTP username
ftp_password string Yes FTP password
subscription_duration integer Yes Duration in months (1, 2, or 3)
type_payment string Yes Payment method (balance or crypto)
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,
    "message": "Plesk order created successfully",
    "order": {
        "id": "order123-4567-8901-2345-678901234567",
        "order_number": "PLK_20250320_123456",
        "status": "completed",
        "amount": "9.99",
        "currency": "EUR"
    },
    "subscription": {
        "id": "sub123-4567-8901-2345-678901234567",
        "domain_name": "example.com",
        "status": "active",
        "expires_at": "2025-04-20 10:30:00"
    },
    "balance_after": "90.01"
}

Code Examples

Programming Languages
JavaScript (Fetch API)
async function makeRequest() {
  try {
    const response = await fetch('https://0xhost.com/API/orders/create_order_plesk', {
      method: 'POST',
      headers: {
        'x-api-key': 'your_api_key_here',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
          "plan_id": "plan123-4567-8901-2345-678901234567",
          "client_id": "client123-4567-8901-2345-678901234567",
          "domain_name": "example.com",
          "ftp_login": "ftp_user",
          "ftp_password": "FtpPass123",
          "subscription_duration": "1",
          "type_payment": "balance"
      })
    });

    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.com/API/orders/create_order_plesk'
    headers = {
        'x-api-key': api_key,
        'Content-Type': 'application/json'
    }
    data = {
        "plan_id": "plan123-4567-8901-2345-678901234567",
        "client_id": "client123-4567-8901-2345-678901234567",
        "domain_name": "example.com",
        "ftp_login": "ftp_user",
        "ftp_password": "FtpPass123",
        "subscription_duration": "1",
        "type_payment": "balance"
    }

    response = requests.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.com/API/orders/create_order_plesk';
    $data = {
        "plan_id": "plan123-4567-8901-2345-678901234567",
        "client_id": "client123-4567-8901-2345-678901234567",
        "domain_name": "example.com",
        "ftp_login": "ftp_user",
        "ftp_password": "FtpPass123",
        "subscription_duration": "1",
        "type_payment": "balance"
    };

    $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: 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.com/API/orders/create_order_plesk' \
  -H 'x-api-key: your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{    "plan_id": "plan123-4567-8901-2345-678901234567",    "client_id": "client123-4567-8901-2345-678901234567",    "domain_name": "example.com",    "ftp_login": "ftp_user",    "ftp_password": "FtpPass123",    "subscription_duration": "1",    "type_payment": "balance"}'