Tích hợp
Tài liệu API
REST API cho reseller / bot. Trừ tiền ví, auth bằng X-API-Key.
Đấu nối trong 5 bước
- Nạp tiền vào ví (API trừ tiền ví, không có cổng thanh toán riêng).
- Tạo API key tại Trang cá nhân, gửi mọi request với header X-API-Key.
- GET /v1/services — copy field id, dùng làm serviceId khi tạo đơn.
- POST /v1/orders — chỉ gửi serviceId + field phụ của đúng loại dịch vụ.
- Lưu orderCode trong response, dùng GET /v1/orders/:orderCode để theo dõi.
- Base URL:
https://api.thapcammmo.vn - API key: tạo tại Trang cá nhân — header
X-API-Key(key bắt đầu bằngfag_) - Thành công:
{ "data": ..., "message": "" }— lấy payload trongdata - Lỗi:
{ "statusCode": 400, "message": "..." }— đọcmessage(string hoặc mảng) - Rate limit: 100 request / phút / API key
- Không gửi field lạ (kể cả
serviceTypelúc tạo đơn) — server sẽ trả lỗi whitelist
Endpoints
| Method | Path | Mô tả |
|---|---|---|
GET | /v1/balance | Số dư ví hiện tại |
GET | /v1/services | Danh sách dịch vụ. Query tùy chọn: serviceType |
POST | /v1/orders | Tạo đơn. Body chỉ cần serviceId + field phụ, không gửi serviceType |
GET | /v1/orders | Danh sách đơn. Query: page, pageSize, status, serviceType |
GET | /v1/orders/:orderCode | Chi tiết đơn theo orderCode (vd AMXKQT260723102045) |
Đọc GET /v1/services
Field id chính là serviceId lúc tạo đơn. price đã áp dụng giảm giá cấp bậc của tài khoản giữ key.
| Sản phẩm | serviceType |
|---|---|
| Tăng thành viên nhóm Zalo | add_member |
| Mua nhóm Zalo | sell_group |
| Proxy | sell_proxy |
| Tăng tương tác MXH | sell_buff |
| Phần mềm MKT, Source Code, MKT FB, Khóa học | sell_catalog |
Lọc: /v1/services?serviceType=add_member (một trong 5 giá trị trên).
Catalog (sell_catalog) gồm 4 loại, phân biệt bằng meta.kind: software-mkt, source-code, mkt-fb, course. Chỉ đặt được khi meta.purchaseMode = checkout. Nếu meta.pricingMode = options thì bắt buộc gửi pricingOptionId lấy từ meta.pricingOptions[].id.
{
"data": [
{
"serviceType": "add_member",
"id": "1",
"name": "VIP 1",
"price": 80,
"meta": { "availableNickCount": 1200 }
}
],
"message": ""
}Body tạo đơn
quantity là số nguyên JSON (100), không phải chuỗi "100". Field userNote tùy chọn cho mọi loại.
Tăng thành viên nhóm Zalo
add_member — quantity = số thành viên mỗi link. Tổng tiền = price × quantity × số link. groupLinks phải là mảng URL.
{
"serviceId": "1",
"groupLinks": ["https://zalo.me/g/xxxx"],
"quantity": 100
}Mua nhóm Zalo
sell_group — quantity = số gói cần mua.
{
"serviceId": "12",
"quantity": 1
}Proxy
sell_proxy — quantity nằm trong meta.buyMin … min(meta.buyMax, meta.storeQuantity). Hết hàng nếu storeQuantity = 0.
{
"serviceId": "40",
"quantity": 1
}Tăng tương tác MXH
sell_buff — quantity nằm trong meta.min … meta.max. Chỉ gửi buffComments khi meta.type chứa “custom comments” (mỗi dòng 1 comment).
{
"serviceId": "55",
"buffLink": "https://example.com/post",
"quantity": 1000
}Catalog giá cố định
sell_catalog · pricingMode = one_time — Áp dụng Source Code / Khóa học / MKT FB / Phần mềm khi meta.pricingMode = one_time. Không gửi quantity.
{
"serviceId": "25"
}Catalog có gói giá
sell_catalog · pricingMode = options — Bắt buộc pricingOptionId = meta.pricingOptions[].id (id Mongo, không phải serviceId). Hay gặp ở Phần mềm Marketing.
{
"serviceId": "25",
"pricingOptionId": "665f1a2b3c4d5e6f7a8b9c0d"
}Theo dõi đơn
Response tạo đơn trả orderCode (trùng id). Dùng mã này trên path, không dùng Mongo _id.
| status | Ý nghĩa |
|---|---|
pending | Chờ xử lý |
processing | Đang chạy |
completed | Hoàn thành |
cancelled | Đã hủy |
refunded | Đã hoàn tiền |
partially_refunded | Hoàn một phần |
{
"data": {
"id": "AMXKQT260723102045",
"orderCode": "AMXKQT260723102045",
"serviceId": "1",
"status": "processing",
"amount": 8000,
"quantity": 100
},
"message": ""
}Lỗi thường gặp
| Mã / message | Cách xử lý |
|---|---|
401 | Thiếu hoặc sai X-API-Key |
INSUFFICIENT_BALANCE | Ví không đủ tiền — nạp thêm rồi tạo lại đơn |
CATALOG_ITEM_NOT_AVAILABLE | Item contact hoặc không bán qua API — xem meta.purchaseMode phải là checkout |
PRICING_OPTION_REQUIRED | Thiếu pricingOptionId khi meta.pricingMode = options |
GROUP_LINKS_REQUIRED | Thiếu groupLinks (mảng URL nhóm Zalo) |
BUFF_LINK_REQUIRED | Thiếu buffLink |
BUFF_COMMENTS_REQUIRED | Dịch vụ custom comments bắt buộc buffComments |
BUFF_QUANTITY_INVALID / PROXY_QUANTITY_INVALID | quantity ngoài min/max (hoặc proxy hết hàng) |
429 | Vượt 100 request / phút |
Ví dụ curl
# 1. Số dư
curl -H "X-API-Key: YOUR_KEY" https://api.thapcammmo.vn/v1/balance
# 2. Lấy serviceId (field id)
curl -H "X-API-Key: YOUR_KEY" "https://api.thapcammmo.vn/v1/services?serviceType=add_member"
# 3. Tạo đơn tăng thành viên
curl -X POST -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"serviceId":"1","groupLinks":["https://zalo.me/g/xxxx"],"quantity":100}' \
https://api.thapcammmo.vn/v1/orders
# 4. Theo dõi đơn
curl -H "X-API-Key: YOUR_KEY" https://api.thapcammmo.vn/v1/orders/AMXKQT260723102045