Tích hợp hệ thống đặt mua máy chủ Cloud VPS Quốc Tế, quản lý IP, mật khẩu và gửi lệnh điều khiển (Reboot, Tắt nguồn, Bật máy) tự động 100% vào ứng dụng của bạn.
Thông tin kết nối và cấu trúc RESTful API VPS Quốc Tế
https://shopmmostudio.com/api/v1/vps
JSON (application/json)
Cách thức gửi API Key & Secret qua HTTP Request Headers
Tất cả request gọi API đều yêu cầu cung cấp các Header sau:
| Header | Ví dụ giá trị | Mô tả |
|---|---|---|
| X-API-Key | sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 |
API Key của bạn (bắt đầu bằng sk_live_) |
| X-API-Secret | sk_secret_a1b2c3d4e5f6g7h... |
API Secret bí mật (bắt đầu bằng sk_secret_) |
| Content-Type | application/json |
Bắt buộc khi gửi POST request |
X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2 Content-Type: application/json
Lấy danh sách các gói cấu hình Cloud VPS đang mở bán, danh sách OS và Datacenter
Endpoint này công khai hoặc có thể gửi kèm API Key để nhận kèm thông tin số dư ví.
<?php
$ch = curl_init('https://shopmmostudio.com/api/v1/vps/plans');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6',
'X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2'
]
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
import requests
url = "https://shopmmostudio.com/api/v1/vps/plans"
headers = {
"X-API-Key": "sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"X-API-Secret": "sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2"
}
res = requests.get(url, headers=headers)
print(res.json())
curl -X GET "https://shopmmostudio.com/api/v1/vps/plans" \ -H "X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \ -H "X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2"
{
"success": true,
"timestamp": 1792813050,
"data": {
"plans": [
{
"id": 4,
"plan_id": "g6-standard-1",
"name": "Cloud VPS Standard 2GB",
"cpu_cores": 1,
"ram_mb": 2048,
"ram_formatted": "2GB",
"disk_gb": 50,
"transfer_gb": 2000,
"price_monthly": 15000,
"price_formatted": "15.000đ",
"billing_cycle": "30_days"
},
{
"id": 5,
"plan_id": "g6-standard-2",
"name": "Cloud VPS Standard 4GB",
"cpu_cores": 2,
"ram_mb": 4096,
"ram_formatted": "4GB",
"disk_gb": 80,
"transfer_gb": 4000,
"price_monthly": 40000,
"price_formatted": "40.000đ",
"billing_cycle": "30_days"
}
],
"operating_systems": {
"windows": [
{ "id": "windows-2022", "name": "Windows Server 2022 Datacenter", "default_port": 3389, "connection_type": "RDP" },
{ "id": "windows-2019", "name": "Windows Server 2019 Datacenter", "default_port": 3389, "connection_type": "RDP" }
],
"linux": [
{ "id": "ubuntu24.04", "name": "Ubuntu 24.04 LTS", "default_port": 22, "connection_type": "SSH" },
{ "id": "debian12", "name": "Debian 12 Bookworm", "default_port": 22, "connection_type": "SSH" }
]
},
"regions": [
{ "id": "ap-south", "name": "Singapore (ap-south)", "country": "Singapore", "is_recommended": true },
{ "id": "jp-tyo", "name": "Tokyo, Japan (jp-tyo)", "country": "Japan" },
{ "id": "us-lax", "name": "Los Angeles, US (us-lax)", "country": "United States" }
]
}
}
Trừ số dư tài khoản và khởi tạo máy chủ Cloud VPS mới tự động qua API
provisioning). Khi máy chuyển sang running, bạn có thể kết nối ngay qua RDP (cổng 3389) hoặc SSH (cổng 22). | Tham số | Kiểu | Bắt buộc | Mô tả & Giá trị mẫu |
|---|---|---|---|
| plan_id | int | string | Bắt buộc | ID của gói cấu hình (VD: 4 hoặc mã chuỗi "g6-standard-1") |
| image | string | Tùy chọn | Mã hệ điều hành. Mặc định: "windows-2022". Hỗ trợ: windows-2022, windows-2019, ubuntu24.04, ubuntu22.04, debian12, almalinux9, rocky9, kali... |
| region | string | Tùy chọn | Vùng Datacenter. Mặc định: "ap-south" (Singapore). Hỗ trợ: jp-tyo, us-lax, us-east, eu-central... |
| password | string | Tùy chọn | Mật khẩu root/Administrator (ít nhất 8 ký tự). Nếu để trống, hệ thống sẽ tự sinh mật khẩu mạnh bảo mật ngẫu nhiên. |
| label | string | Tùy chọn | Tên gợi nhớ của máy chủ (VD: "my-node-1") |
<?php
$apiKey = 'sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6';
$apiSecret = 'sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2';
$data = [
'plan_id' => 4, // ID gói VPS
'image' => 'windows-2022', // Windows Server 2022 Datacenter
'region' => 'ap-south', // Datacenter Singapore
'password' => 'VpsAdmin@2026!#x', // (Tùy chọn) Mật khẩu
'label' => 'vps-marketing-01' // (Tùy chọn) Tên máy chủ
];
$ch = curl_init('https://shopmmostudio.com/api/v1/vps/order');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . $apiKey,
'X-API-Secret: ' . $apiSecret,
'Content-Type: application/json'
]
]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true));
import requests
url = "https://shopmmostudio.com/api/v1/vps/order"
headers = {
"X-API-Key": "sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"X-API-Secret": "sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2",
"Content-Type": "application/json"
}
payload = {
"plan_id": 4,
"image": "windows-2022",
"region": "ap-south",
"password": "VpsAdmin@2026!#x",
"label": "vps-marketing-01"
}
res = requests.post(url, json=payload, headers=headers)
print(res.json())
curl -X POST "https://shopmmostudio.com/api/v1/vps/order" \
-H "X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
-H "X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2" \
-H "Content-Type: application/json" \
-d '{
"plan_id": 4,
"image": "windows-2022",
"region": "ap-south",
"password": "VpsAdmin@2026!#x",
"label": "vps-marketing-01"
}'
{
"success": true,
"message": "Khởi tạo Cloud VPS thành công!",
"data": {
"order_id": 18,
"trans_id": "VPS_9D28B1CA4E",
"linode_id": 61284920,
"plan": {
"id": 4,
"name": "Cloud VPS Standard 2GB",
"plan_id": "g6-standard-1",
"cpu": 1,
"ram_mb": 2048,
"disk_gb": 50
},
"operating_system": {
"id": "windows-2022",
"name": "Windows Server 2022 Datacenter",
"is_windows": true
},
"connection": {
"ip": "172.104.45.182",
"ipv6": "2400:8902::f03c:93ff:fe2b:110a",
"username": "Administrator",
"password": "VpsAdmin@2026!#x",
"port": 3389,
"protocol": "RDP"
},
"region": "ap-south",
"amount": 15000,
"balance_before": 100000,
"balance_after": 85000,
"status": "provisioning",
"notice": "Máy chủ đang nạp Hệ điều hành trên Cloud (khoảng 2-4 phút). Kết nối RDP/SSH sẽ sẵn sàng ngay khi máy chuyển sang trạng thái running.",
"created_at": "2026-10-24 10:45:00",
"expires_at": "2026-11-23 10:45:00"
}
}
Lấy danh sách tất cả máy chủ Cloud VPS của bạn kèm phân trang và bộ lọc
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
| page | int | 1 |
Trang cần xem |
| limit | int | 10 |
Số lượng bản ghi mỗi trang (tối đa 100) |
| status | string | all |
Lọc theo trạng thái: running, provisioning, offline, hoặc all |
| search | string | null | Tìm theo IP, mã đơn (trans_id), hoặc nhãn máy chủ (label) |
<?php
$ch = curl_init('https://shopmmostudio.com/api/v1/vps/orders?page=1&limit=10&status=running');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6',
'X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2'
]
]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true));
curl -X GET "https://shopmmostudio.com/api/v1/vps/orders?page=1&limit=10" \ -H "X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \ -H "X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2"
Xem thông tin chi tiết 1 máy chủ và tự động cập nhật trạng thái mới nhất từ Cloud
Tính năng Realtime Sync: Khi máy chủ đang ở trạng thái provisioning hoặc booting, hệ thống tự động đồng bộ realtime từ Cloud Linode. Ngay khi máy cài xong OS, kết quả sẽ cập nhật thành running!
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
| trans_id | string | 1 trong 2 | Mã đơn hàng Cloud VPS (VD: "VPS_9D28B1CA4E") |
| order_id | int | 1 trong 2 | ID đơn hàng máy chủ trong hệ thống (VD: 18) |
<?php
$transId = 'VPS_9D28B1CA4E';
$ch = curl_init('https://shopmmostudio.com/api/v1/vps/detail?trans_id=' . $transId);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6',
'X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2'
]
]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true));
curl -X GET "https://shopmmostudio.com/api/v1/vps/detail?trans_id=VPS_9D28B1CA4E" \ -H "X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \ -H "X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2"
Gửi lệnh Khởi động lại (Reboot), Tắt nguồn (Shutdown), hoặc Bật máy (Boot)
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
| order_id | int | 1 trong 2 | ID đơn hàng máy chủ |
| trans_id | string | 1 trong 2 | Mã giao dịch (VD: "VPS_9D28B1CA4E") |
| action | string | Bắt buộc |
Hành động thực hiện: • reboot: Khởi động lại máy chủ• shutdown: Tắt nguồn máy chủ• boot: Bật nguồn máy chủ |
<?php
$data = [
'trans_id' => 'VPS_9D28B1CA4E',
'action' => 'reboot' // 'reboot', 'shutdown', hoặc 'boot'
];
$ch = curl_init('https://shopmmostudio.com/api/v1/vps/action');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6',
'X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2',
'Content-Type: application/json'
]
]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true));
curl -X POST "https://shopmmostudio.com/api/v1/vps/action" \
-H "X-API-Key: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
-H "X-API-Secret: sk_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2" \
-H "Content-Type: application/json" \
-d '{
"trans_id": "VPS_9D28B1CA4E",
"action": "reboot"
}'
Bảng mã tham chiếu hệ điều hành và khu vực đặt máy chủ
| Mã image | Tên phiên bản | Tài khoản RDP |
|---|---|---|
windows-2022 | Windows Server 2022 Datacenter 64-bit | Administrator |
windows-2019 | Windows Server 2019 Datacenter 64-bit | Administrator |
windows-2016 | Windows Server 2016 Datacenter 64-bit | Administrator |
windows-11 | Windows 11 Pro 64-bit | Administrator |
windows-10 | Windows 10 Pro 64-bit | Administrator |
| Mã image | Tên phiên bản | Tài khoản SSH |
|---|---|---|
ubuntu24.04 | Ubuntu 24.04 LTS (Noble Numbat) | root |
ubuntu22.04 | Ubuntu 22.04 LTS (Jammy Jellyfish) | root |
debian12 | Debian 12 Bookworm | root |
almalinux9 | AlmaLinux 9 | root |
rocky9 | Rocky Linux 9 | root |
centos-stream9 | CentOS Stream 9 | root |
kali | Kali Linux Rolling Release | root |
| Mã region | Địa điểm Datacenter | Độ trễ về VN |
|---|---|---|
ap-south | Singapore (Khuyên dùng) | ~30 - 45ms (Cực thấp) |
jp-tyo | Tokyo, Japan | ~65 - 80ms |
us-lax | Los Angeles, California, US | ~160 - 180ms |
us-east | Newark / New York, US | ~200 - 230ms |
eu-central | Frankfurt, Germany | ~170 - 190ms |
Các mã lỗi (error_code) trả về từ hệ thống API
| Error Code | HTTP Code | Ý nghĩa & Cách xử lý |
|---|---|---|
INVALID_API_KEY |
401 | API Key không hợp lệ hoặc không tồn tại. Vui lòng kiểm tra lại header X-API-Key. |
INVALID_API_SECRET |
401 | API Secret không chính xác với API Key đã cung cấp. |
INSUFFICIENT_BALANCE |
400 | Số dư ví tài khoản không đủ để thanh toán gói VPS. Vui lòng nạp thêm tiền. |
PLAN_NOT_FOUND |
400 | Gói cấu hình không hợp lệ hoặc đã ngừng kinh doanh. |
SERVER_PROVISIONING |
400 | Máy chủ đang nạp Hệ điều hành trên Cloud. Không thể điều khiển lúc này, vui lòng chờ 2 - 4 phút. |
ACTION_COOLDOWN |
429 | Mỗi thao tác điều khiển chỉ được thực hiện 60 phút 1 lần. API trả về số phút còn lại. |
NOT_FOUND |
404 | Không tìm thấy máy chủ với ID / trans_id đã chỉ định hoặc bạn không có quyền. |
PROVISION_FAILED |
500 | Khởi tạo máy chủ thất bại do cụm cloud bận. Hệ thống đã tự động hoàn lại 100% tiền vào số dư ví. |