Loading...
SUBGIARE RESELLER API

Tài liệu API v2

API chuẩn cho reseller. Mọi giá trị tiền khách hàng trả về bằng USD.

POST https://www.subgiare.top/api/v2

Xác thực

Gửi API key trong trường POST key. Bạn có thể tạo, sao chép hoặc thu hồi key tại trang Hồ sơ.

curl -X POST 'https://www.subgiare.top/api/v2' \
  -d 'key=sg_example_key_not_real' \
  -d 'action=balance'

Services

action=services — chỉ trả dịch vụ đang hoạt động và hiển thị cho khách hàng. Rate là USD trên 1.000.

[{"service":3574,"name":"Example service","type":"default","category":"X","rate":0.152761,"min":100,"max":10000,"refill":false,"cancel":false}]

Tạo đơn

action=add&service=3574&link=https://example.com/post&quantity=100

Có thể gửi request_id (8–64 ký tự) để retry an toàn, không tạo trùng. Đơn đi qua kiểm tra số dư/dịch vụ và Worker bình thường.

{"order":12345,"replayed":false}

Trạng thái đơn

action=status&order=12345

{"order":12345,"status":"Processing","charge":0.015276,"start_count":0,"remains":100,"currency":"USD"}

Balance

action=balance

{"balance":12.5,"currency":"USD"}

PHP / JavaScript

// PHP
$response = file_get_contents('https://www.subgiare.top/api/v2', false, stream_context_create([
  'http' => ['method' => 'POST', 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", 'content' => http_build_query(['key' => 'sg_example_key_not_real', 'action' => 'services'])]
]));

// JavaScript
fetch('https://www.subgiare.top/api/v2', {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:new URLSearchParams({key:'sg_example_key_not_real', action:'services'})});

Lỗi và giới hạn

Lỗi có dạng {"error":"message"}. HTTP 400/401/402/404/409/422/429/500 được dùng phù hợp. Giới hạn ban đầu: 60 request/phút/API key.