Developer & Reseller Center

Tài liệu tích hợp Public SMM API v2

Chuẩn API RESTful kết nối tự động mua dịch vụ dành cho đại lý sỉ, lập trình viên và các hệ thống website panel.

Đăng nhập để lấy API Key

Thông tin kết nối Endpoint API

API Endpoint URL http://demo30.suncodevn.com/api/v2
Phương thức HTTP Method POST (application/x-www-form-urlencoded hoặc multipart/form-data)

1. Lấy danh sách gói dịch vụ (Services List)

action = services

Trả về danh sách đầy đủ tất cả gói cước khả dụng. Giá bán (rate) đã tự động tính theo % chiết khấu cấp bậc tài khoản của API Key.

// Response JSON Example:
[
  {
    "service": 1,
    "name": "Like Bài Viết Facebook Server 1 (Tốc độ cao)",
    "type": "Default",
    "category": "Facebook Like",
    "rate": "15.00",
    "min": "100",
    "max": "10000",
    "dripfeed": false,
    "refill": true,
    "cancel": false
  }
]

2. Tạo đơn hàng mới (Add Order)

action = add
Tham số Kiểu dữ liệu Bắt buộc Mô tả
keyStringMã API Key cá nhân của bạn
actionStringGiá trị cố định: add
serviceIntegerMã ID gói dịch vụ
linkStringĐường dẫn target (URL bài viết, UID, Fanpage, Channel...)
quantityIntegerSố lượng cần tăng
commentsStringTùy chọnDanh sách bình luận (nếu là dịch vụ comment, các dòng cách nhau bằng \n)
// Response Thành công:
{"order": 10582}
// Response Lỗi:
{"error": "Số dư tài khoản không đủ thanh toán."}

3. Kiểm tra trạng thái đơn hàng (Order Status)

action = status

Truyền order để kiểm tra 1 đơn hoặc orders (phân cách bằng dấu phẩy) để tra cứu nhiều đơn cùng lúc.

// Single Order Response:
{
  "charge": "15.00",
  "start_count": "120",
  "remains": "0",
  "currency": "VND",
  "status": "Completed" // Trạng thái: Pending, In progress, Completed, Partial, Canceled
}

4. Kiểm tra số dư ví (Account Balance)

action = balance
{
  "balance": "1500000.00",
  "currency": "VND"
}

5. Gửi yêu cầu bảo hành (Request Refill)

action = refill
{
  "refill": 123456
}

Code Mẫu Tích hợp (cURL / PHP / Python)

# PHP cURL Example:
<?php
$ch = curl_init('http://demo30.suncodevn.com/api/v2');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'key' => 'YOUR_API_KEY_HERE',
    'action' => 'add',
    'service' => 1,
    'link' => 'https://facebook.com/123456789',
    'quantity' => 1000
]));
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>