KHOMMO VIP · RESELLER API
Tài liệu API đại lý
Kết nối kho sản phẩm số với website hoặc bot của bạn. Đơn API thanh toán thẳng bằng số dư ví; đơn giá luôn lấy từ bảng giá Telegram đã đồng bộ, người gọi API không thể tự truyền giá.
Xác thực
Mỗi request phải gửi API key do bot Telegram KHOMMO cấp trong header. Tạo key mới sẽ tự vô hiệu hóa key cũ của cùng tài khoản.
X-API-Key: sk_kmv_your_key_hereQuickstart
Ba bước để kiểm tra ví, lấy sản phẩm và tạo đơn. Luôn gửi Idempotency-Key riêng cho từng giao dịch để không bị trừ tiền hai lần khi kết nối chập chờn.
# 1. Kiểm tra số dư
curl -X GET https://khommovip.store/api/v1/wallet/balance \
-H "X-API-Key: sk_kmv_your_key_here"
# 2. Lấy sản phẩm và giá Telegram
curl https://khommovip.store/api/v1/products \
-H "X-API-Key: sk_kmv_your_key_here"
# 3. Tạo đơn
curl -X POST https://khommovip.store/api/v1/orders \
-H "X-API-Key: sk_kmv_your_key_here" \
-H "Idempotency-Key: my-order-20260917-001" \
-H "Content-Type: application/json" \
-d '{"product_id":"chatgpt_1m","quantity":1}'Mã phản hồi
https://khommovip.store/api/v1/productsDanh sách sản phẩm
Trả về các SKU đang bán, tồn kho và giá mới nhất do Telegram đồng bộ. Không trả các dịch vụ tương tác mạng xã hội.
curl https://khommovip.store/api/v1/products \
-H "X-API-Key: sk_kmv_your_key_here"
{
"success": true,
"products": [{
"id": "chatgpt_1m",
"name": "ChatGPT Plus 1 tháng",
"price": 150000,
"stock": 50,
"price_source": "telegram"
}]
}https://khommovip.store/api/v1/ordersTạo đơn hàng
Hệ thống khóa đơn giá từ Telegram, kiểm tra tồn kho, trừ số dư ví và giao hàng nếu kho tự động có sẵn.
{
"product_id": "chatgpt_1m",
"quantity": 1,
"email": "customer@example.com"
}https://khommovip.store/api/v1/orders?limit=50Lịch sử đơn API
Chỉ trả các đơn thuộc tài khoản sở hữu API key. Tra một đơn tại GET /orders/{order_id}.
https://khommovip.store/api/v1/wallet/balanceSố dư ví
Đọc số dư ví hiện tại dùng chung giữa web, API và Telegram.
https://khommovip.store/api/v1/wallet/transactions?limit=50Lịch sử giao dịch
Trả về biến động ví: nạp tiền, mua hàng, hoàn tiền và hoa hồng.
NGUỒN GIÁ DUY NHẤT
Đồng bộ từ Telegram
Bot Telegram dùng khóa đồng bộ riêng để cập nhật bảng giá và cấp API key cho khách. Website chỉ hiển thị tài liệu; endpoint mua hàng không nhận trường giá.
POST https://khommovip.store/api/v1/telegram/catalog
X-Telegram-Sync-Key: your_private_sync_key
{
"products": [{
"sku": "chatgpt_1m",
"product_id": "product-id",
"variant_id": "variant-id",
"name": "ChatGPT Plus 1 tháng",
"description": "Bảo hành theo gói",
"price": 150000,
"active": true
}]
}POST https://khommovip.store/api/v1/telegram/api-key
X-Telegram-Sync-Key: your_private_sync_key
{ "username": "ten_tai_khoan_web" }