Tài Liệu API & Hướng Dẫn Thuê Số Tự Động (/api/v1)
Tích hợp tự động thuê số nhận mã OTP hơn 200 quốc gia toàn cầu. Hỗ trợ hủy số sau 2 phút hoặc tự động hoàn tiền sau 20 phút nếu không có mã.
https://otp.shopclone99.com/api/v1
YOUR_API_TOKEN_HERE
Lấy Quốc Gia & Dịch Vụ
Gọi /getcountries và /getservices?country=VN để lấy danh sách mã & bảng giá.
Gửi Lệnh Thuê Số (/buy)
Gọi /buy?token=...&serviceId=...&country=VN. Nhận ngay requestId và phoneNum.
Lấy Mã OTP (/getcode)
Gọi /getcode?requestId=... mỗi 2–3s cho tới khi status = 11 nhận mã OTP.
Hủy 2 Phút / Hoàn Tiền 20m
Sau 2 phút có thể gọi /cancel để hoàn tiền ngay. Quá 20 phút hệ thống tự hoàn tiền 100%.
{ "info": "Bấm một trong các nút /balance, /getcountries, /getservices, /buy, /getcode hoặc /cancel ở trên để test trực tiếp." }
1. GET /api/v1/balance
Kiểm tra tên tài khoản và số dư hiện tại.
GET https://otp.shopclone99.com/api/v1/balance?token=YOUR_API_TOKEN
2. GET /api/v1/getcountries
Lấy danh sách mã quốc gia, cờ, mã vùng (+84, +1, +44...). Tham số server=1 hoặc server=2.
GET https://otp.shopclone99.com/api/v1/getcountries?server=1&token=YOUR_API_TOKEN
3. GET /api/v1/getservices
Lấy danh sách dịch vụ và bảng giá VNĐ theo từng quốc gia.
GET https://otp.shopclone99.com/api/v1/getservices?country=VN&server=1&token=YOUR_API_TOKEN
4. POST /api/v1/buy
Thuê số mới hoặc thuê lại số cũ. Trả về ngay requestId, phoneNum và ttl.
POST https://otp.shopclone99.com/api/v1/buy Tham số: token=... & serviceId=1 & country=VN [& carrier=Viettel] [& number=098xxx]
5. GET /api/v1/getcode
Kiểm tra trạng thái & lấy mã OTP. Polling mỗi 2-3s. Khi status = 11 kèm mã code.
GET https://otp.shopclone99.com/api/v1/getcode?requestId=98451203&token=YOUR_API_TOKEN
6. POST /api/v1/cancel
Hủy số và hoàn tiền ngay lập tức (chỉ được hủy sau 120 giây kể từ khi tạo lệnh).
POST https://otp.shopclone99.com/api/v1/cancel?requestId=98451203&token=YOUR_API_TOKEN
import time
import requests
API_BASE = "https://otp.shopclone99.com/api/v1"
TOKEN = "YOUR_API_TOKEN_HERE"
COUNTRY = "VN" # Mã quốc gia: VN, VN2, KH, KH2, US...
SERVICE_ID = 1 # ID dịch vụ từ /getservices
# 1. Gửi lệnh thuê số
buy_res = requests.post(f"{API_BASE}/buy", data={
"token": TOKEN,
"serviceId": SERVICE_ID,
"country": COUNTRY
}, timeout=15).json()
if "requestId" not in buy_res:
print("Thuê số thất bại:", buy_res.get("message", buy_res))
exit()
req_id = buy_res["requestId"]
phone = buy_res["phoneNum"]
print(f"Thuê số thành công! Số: {phone} | Request ID: {req_id}")
# 2. Polling chờ nhận mã OTP (lặp trong tối đa 20 phút)
for _ in range(400):
time.sleep(3)
code_res = requests.get(f"{API_BASE}/getcode", params={"token": TOKEN, "requestId": req_id}, timeout=10).json()
if code_res.get("status") == 11 and code_res.get("code"):
print(">>> OTP Nhận Được:", code_res["code"], "| SMS:", code_res.get("message"))
break
else:
print("Quá thời gian 20 phút, hệ thống tự động hoàn tiền.")