API MMO

API MMO — Kho tài khoản

Tích hợp kho tài khoản MMO của SocNeo.Com qua HTTP GET/POST: duyệt danh mục, kiểm tra tồn kho theo thời gian thực, đặt mua và lấy thông tin sản phẩm đã mua. Phản hồi JSON, xác thực bằng API key.

HTTP Method GET / POST
API URL https://socneo.com/api/mmo
API Key /account/api (cần bật 2FA)
Phản hồi JSON

API MMO

HTTP Method GET / POST
Base URL https://socneo.com/api/mmo
API Key Lấy tại /account/api (yêu cầu bật 2FA)
Auth X-Api-Key, Authorization: Bearer, hoặc ?api_key=
Response format JSON

Format response

{ "status": "success", "msg": "...", "<fields>": ... }
{ "status": "error",   "msg": "<lý do>" }

Đơn vị tiền tệ

Các endpoint trả về tiền (profile, products, product, order) đính kèm field currency. Với tài khoản của bạn, các giá trị tiền trả về dạng "VND" — chuỗi số nguyên không có phần thập phân (vd. "12000"). Trên /order.php, field total_vnd giữ nguyên VND cho client cũ; client mới đọc total + currency.

HTTP Khi nào
401 Sai / thiếu api_key
403 IP whitelist từ chối
404 Đơn không tồn tại / không thuộc user
409 Idempotency-Key dùng với tham số khác
429 Rate limit / lock idempotency
503 Bảo trì

Profile

GET /profile.php

{
  "status": "success",
  "currency": "VND",
  "data": { "username": "myuser", "money": "150000" }
}

Catalog

GET /products.php — danh sách phẳng: mỗi danh mục chứa products trực tiếp. parent_id luôn 0 (giữ field để tương thích parser cũ).

{
  "status": "success",
  "currency": "VND",
  "categories": [
    {
      "id": "2", "parent_id": 0, "name": "FB Việt cổ 2015",
      "products": [
        { "id": "5", "name": "FB Việt cổ - Live OK", "price": "12000",
          "amount": 230, "min": "1", "max": "1000", "flag": "vn",
          "description": "ID|Pass|Email|MailPass" }
      ]
    }
  ]
}

price đã apply markup + discount theo role. amount = stock. Cache 60s.


Product detail

GET /product.php?product=ID

{ "status": "success", "currency": "VND", "product": { "id": "5", "name": "...", "price": "12000", "amount": 230 } }

Không tìm thấy → "product": [].


Buy

POST /buy_product.php

Field Required Mô tả
id id sản phẩm
amount 1 ≤ n ≤ 1.000.000
idempotency_key optional hoặc header Idempotency-Key

Success:

{
  "status": "success",
  "trans_id": "mmo3aH8d2fK9bP4qX",
  "data": ["[email protected]|pass1|...", "[email protected]|pass2|..."]
}

Async (data: null) → poll /order.php sau 1–2 phút.

Cần admin (requires_admin: true, data: null) → copy trans_id gửi admin.

Fail → tự động refund + restock, trả {"status":"error","msg":"..."}.

Idempotency

  • Cùng key + cùng tham số trong 24h → trả response gốc, header Idempotent-Replay: true.
  • Cùng key + khác tham số → 409.
  • Đang chạy cùng key → 429 + Retry-After: 5.

Order detail

GET /order.php?order=TRANS_ID

{
  "status": "success",
  "order": {
    "trans_id": "mmo3aH8d2fK9bP4qX",
    "product_id": "5", "quantity": 2,
    "currency": "VND", "total": "24000", "total_vnd": "24000",
    "status": "completed",
    "data": ["[email protected]|pass1|...", "[email protected]|pass2|..."],
    "data_expired_at": "2026-06-07 14:23:11"
  }
}
status
processing Đang chờ giao
completed Đủ credentials
partial Hoàn 1 phần
failed Hoàn 100%
refunded Admin hoàn thủ công

data chỉ trả trong 30 ngày kể từ delivered_at. Sau đó data: null. Đơn không thuộc user → 404.


cURL

curl -sS https://socneo.com/api/mmo/profile.php \
     -H "X-Api-Key: YOUR_API_KEY"

curl -sS https://socneo.com/api/mmo/buy_product.php \
     -H "X-Api-Key: YOUR_API_KEY" \
     -H "Idempotency-Key: my-order-001" \
     -d "id=5&amount=1"

curl -sS "https://socneo.com/api/mmo/order.php?order=TRANS_ID" \
     -H "X-Api-Key: YOUR_API_KEY"