Tổng quan
Dùng API để lấy danh sách dịch vụ, gửi yêu cầu mua hàng và xử lý phản hồi từ hệ thống.
01
Đăng nhập để lấy API key
API Key của bạn
Dùng key này cho các API yêu cầu xác thực.
Current key
{api_key}
02
POST
Lấy danh sách dịch vụ
Dùng để lấy service_id, giá, tồn kho và trạng thái dịch vụ.
Endpoint
/user/api/service.php
act
String · bắt buộc
list
Lấy danh sách dịch vụ đang mở bán.
cURL
curl -X POST "SERVICE_URL" \
-d "act=list"
Example response
{"success":true,"message":"OK","data":[{"id":"nvr","name":"Novery","price":300,"status":1,"description":"","geo":"VN","timespan":1684931518,"total":0,"total_available":0}],"timespan":1684958785}
03
POST
Mua hàng
Gửi yêu cầu mua theo service_id. Hệ thống sẽ trừ tiền và trả dữ liệu tài khoản nếu đủ tồn kho.
Endpoint
/user/api/order.php
Parameter cũ vẫn giữ nguyên: act, api_key, amount, service_id. Client đang chạy không cần đổi format.
actString · bắt buộc
paid
Thao tác mua tài khoản.
api_keyString · bắt buộc
{api_key}
API key của tài khoản user.
service_idString · bắt buộc
nvr
Mã dịch vụ lấy từ API danh sách dịch vụ.
amountNumber · bắt buộc
10
Số lượng tài khoản cần mua.
cURL
curl -X POST "ORDER_URL" \
-d "act=paid" \
-d "api_key={api_key}" \
-d "service_id=nvr" \
-d "amount=10"
Example response
{"success":true,"message":"Purchased 1 account successfully.","order_id":"ORDER_xxx","amount":1,"unit_price":300,"total_paid":300,"balance_after":9700,"balance_main_after":9700,"balance_promo_after":0,"paid_from_main":300,"paid_from_promo":0,"data":["uid|password|cookie|email|email_pass|email_token|client_id|recovery_email|2fa|fb_token"],"timespan":1684958978}
04
Lưu ý khi xử lý response
Client nên kiểm tra field success trước khi đọc dữ liệu.
success = true
Yêu cầu thành công, có thể đọc `data` hoặc thông tin order.
success = false
Đọc `message` để biết lỗi: sai API key, thiếu tiền, hết hàng hoặc thiếu parameter.
request_id
Có thể gửi thêm `request_id` khi mua hàng để chống đặt trùng ở client.