🔑 Xác thực
Tất cả API đều cần api_key để sử dụng.
API key Chưa đăng nhập
Bạn chưa đăng nhập. Vui lòng đăng nhập tài khoản để xem api_key của mình.
📋 1. Lấy danh sách dịch vụ
GET /api_thuesim/services.php
Tham số:
- api_key
- country:
vn hoặc la (không bắt buộc)
- search: tìm theo tên dịch vụ (không bắt buộc)
- service_id: lọc theo mã dịch vụ (không bắt buộc)
Ví dụ tất cả dịch vụ:
https://thilyquan.xyz/api_thuesim/services.php?api_key=YOUR_API_KEY
Ví dụ sim Việt Nam:
https://thilyquan.xyz/api_thuesim/services.php?api_key=YOUR_API_KEY&country=vn
Ví dụ sim Lào:
https://thilyquan.xyz/api_thuesim/services.php?api_key=YOUR_API_KEY&country=la
Response mẫu:
{
"success": true,
"message": "OK",
"data": {
"count": 1,
"items": [
{
"service_id": 78,
"name": "Facebook",
"country": "vn",
"price": 1600,
"status": "active"
}
]
}
}
💰 2. Kiểm tra số dư
GET /api_thuesim/balance.php
Ví dụ:
https://thilyquan.xyz/api_thuesim/balance.php?api_key=YOUR_API_KEY
Response mẫu:
{
"success": true,
"message": "OK",
"data": {
"user_id": 1,
"username": "demo",
"balance": 100000
}
}
📲 3. Tạo đơn thuê sim
POST /api_thuesim/add.php
Tham số:
- api_key
- service_id
- country:
vn hoặc la
Ví dụ CURL:
curl -X POST "https://thilyquan.xyz/api_thuesim/add.php" -d "api_key=YOUR_API_KEY" -d "service_id=78" -d "country=vn"
Response mẫu:
{
"success": true,
"message": "Tạo đơn thành công",
"data": {
"order_id": 1234,
"request_id": "512104214",
"service_id": 78,
"service_name": "Facebook",
"country": "vn",
"price": 1600,
"phone": "03xxxxxxxx",
"status": "pending"
}
}
📩 4. Kiểm tra OTP / trạng thái đơn
GET /api_thuesim/status.php
Tham số:
- api_key
- order_id hoặc request_id hoặc trans_id
Ví dụ theo order_id:
https://thilyquan.xyz/api_thuesim/status.php?api_key=YOUR_API_KEY&order_id=1234
Ví dụ theo request_id:
https://thilyquan.xyz/api_thuesim/status.php?api_key=YOUR_API_KEY&request_id=512104214
Ví dụ theo trans_id (giống lịch sử web):
https://thilyquan.xyz/api_thuesim/status.php?api_key=YOUR_API_KEY&trans_id=TSIM1773899527609
Response mẫu:
{
"success": true,
"message": "OK",
"data": {
"order_id": 1234,
"trans_id": "TSIM1773899527609",
"request_id": "512104214",
"service_id": 78,
"service_name": "Facebook",
"country": "vn",
"price": 1600,
"phone": "03xxxxxxxx",
"code": "123456",
"status": "ok",
"created_at": "2025-10-11 17:47:47",
"updated_at": "2025-10-11 17:49:03"
}
}
👉 trans_id là mã đơn hiển thị trong lịch sử đơn hàng trên web.
👉 Nên dùng trans_id để đối chiếu và hỗ trợ khách hàng.
📦 5. Lịch sử đơn
GET /api_thuesim/orders.php
Tham số:
- api_key
- page (không bắt buộc)
- limit (không bắt buộc)
- status (không bắt buộc)
- country (không bắt buộc)
Ví dụ:
https://thilyquan.xyz/api_thuesim/orders.php?api_key=YOUR_API_KEY&page=1&limit=20
Response mẫu:
{
"success": true,
"message": "OK",
"data": {
"items": [
{
"order_id": 1234,
"request_id": "512104214",
"service_name": "Facebook",
"country": "vn",
"price": 1600,
"phone": "03xxxxxxxx",
"code": "123456",
"status": "ok",
"created_at": "2025-10-11 17:47:47",
"updated_at": "2025-10-11 17:49:03"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
}
⚠️ Lỗi thường gặp
- api_key không hợp lệ: kiểm tra lại token tài khoản
- Thiếu service_id: chưa truyền mã dịch vụ
- country chỉ chấp nhận vn hoặc la: sai mã quốc gia
- Số dư không đủ: tài khoản không đủ tiền để tạo đơn
- Không tìm thấy đơn hàng: sai order_id hoặc request_id