Trang chủ / Đối tác / API Documentation
Gateway v1.0 • Live 99.9%

Tài Liệu Tích Hợp API

Tài liệu kết nối API nạp Robux 120H tự động, tra cứu Roblox & Webhooks realtime.

PRODUCTION REST ENDPOINT
200 OK
$ curl https://shopshouldcare.com/api/v1
SDK (PHP / JS / Python) Mã lỗi API
API CREDENTIALS
Khóa Bí Mật & Ví Đối Tác
Demo Mode
Số Dư Khả Dụng
0 đ
Secret API Key (Bearer Token) Giữ bí mật
shouldcare_demo_••••••••••••••••••••••••••••••••

Đăng nhập tài khoản đối tác để lấy key thật và thực hiện giao dịch.

AUTH

Xác thực API (Authentication)

Header: Authorization: Bearer <key>

Tất cả các endpoint yêu cầu xác thực đối tác đều sử dụng Bearer Token truyền qua HTTP Request Header hoặc header tùy chỉnh X-API-KEY:

Quy định & định dạng API Key:
  • Định dạng chuẩn: shouldcare_ + 36 ký tự ngẫu nhiên.
  • Truyền qua header: Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6 hoặc X-API-KEY: shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6.
  • Tuyệt đối KHÔNG chia sẻ API Key công khai lên client-side (Frontend HTML/JS công khai).
  • Quản lý và cấp lại API Key tại trang Quản Lý API Key.
Header Example
curl "https://shopshouldcare.com/api/v1/partner/me" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Accept: application/json"
SCHEMA

Chuẩn Response Envelope (v1.0)

Cấu trúc dữ liệu đồng nhất

Mọi endpoint trong hệ thống đều trả về cấu trúc chuẩn kèm mã định danh theo dõi trace_id và mốc thời gian ISO:

THÀNH CÔNG (200 OK) status: true
{
  "status": true,
  "code": 200,
  "trace_id": "req_9f3a12b4e7",
  "timestamp": "2026-11-20T10:30:00+07:00",
  "data": {
    ...
  }
}
THẤT BẠI / LỖI (4XX, 5XX) status: false
{
  "status": false,
  "code": 402,
  "error_code": "INSUFFICIENT_BALANCE",
  "message": "Số dư ví không đủ để thanh toán!",
  "trace_id": "req_8f12a9bc74",
  "timestamp": "2026-11-20T10:30:00+07:00"
}
STANDARDS

Idempotency & Tốc Độ Giới Hạn (Rate Limits)

Bảo đảm an toàn giao dịch
Idempotency-Key Header

Truyền header Idempotency-Key: <uuid> khi gọi POST tạo đơn để chống tạo trùng lặp đơn khi mạng bị ngắt quãng hoặc retry.

Nếu cùng 1 key gửi lại trong vòng 24h, hệ thống sẽ trả lại đúng kết quả đơn cũ mà không trừ thêm tiền.

Hạn Mức Tần Suất (Rate Limits)
  • GET endpoints: Tối đa 300 requests / phút / API Key.
  • POST endpoints: Tối đa 60 requests / phút / API Key.
  • Vượt quá giới hạn sẽ trả về HTTP 429 Too Many Requests.
GET /rates
PUBLIC Lấy bảng tỷ giá & cấu hình hiện tại

Lấy tỷ giá tốt nhất hiện tại, hạn mức mua tối thiểu, tối đa và tổng quan các tier đang hoạt động theo từng nguồn cung cấp (supplier=1 Nguồn 1 mặc định, hoặc supplier=2 Nguồn 2).

Query Param Kiểu Mặc định Mô tả
supplier string "1" Chọn nguồn cung cấp: 1 (Nguồn 1 - mặc định) hoặc 2 (Nguồn 2). Cũng hỗ trợ định danh source_1 / source_2.
curl -X GET "https://shopshouldcare.com/api/v1/rates?supplier=1" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "supplier": "1",
        "supplier_label": "Nguồn 1",
        "robux_120h": {
            "supplier": "1",
            "supplier_label": "Nguồn 1",
            "enabled": true,
            "rate_id": "rate_4_3",
            "rate_vnd_per_1000": 154800,
            "rate_vnd_per_unit": 154.8,
            "rate_usd_per_1000": 4.3,
            "unit": "Robux (120H Gamepass)",
            "currency": "VND",
            "min_robux": 10,
            "max_robux": 100000,
            "max_instant_order": 25000
        },
        "suppliers": {
            "1": {
                "supplier": "1",
                "supplier_label": "Nguồn 1",
                "enabled": true,
                "online": true,
                "rate_vnd_per_1000": 154800,
                "total_stock": 850000,
                "max_instant_order": 25000
            },
            "2": {
                "supplier": "2",
                "supplier_label": "Nguồn 2",
                "enabled": true,
                "online": true,
                "rate_vnd_per_1000": 154800,
                "total_stock": 620000,
                "max_instant_order": 28572
            }
        },
        "robux_plus": {
            "rate_vnd_per_1000": 165000,
            "unit": "Robux Plus (Quốc tế về 1s)",
            "currency": "VND",
            "enabled": true
        }
    }
}
GET /stock
PUBLIC Lấy tồn kho Robux theo từng nguồn hoặc tổng quan

Kiểm tra số lượng Robux sẵn sàng cấp tự động trong kho. Truyền ?supplier=1 hoặc ?supplier=2 để xem nguồn tương ứng (kèm danh sách cả 2 nguồn trong data.suppliers).

curl -X GET "https://shopshouldcare.com/api/v1/stock?supplier=2" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "supplier": "2",
        "supplier_label": "Nguồn 2",
        "total_stock": 621825,
        "total_stock_text": "621.825 R$",
        "available": true,
        "supplier_status": "online",
        "suppliers": {
            "1": {
                "supplier": "1",
                "supplier_label": "Nguồn 1",
                "enabled": true,
                "total_stock": 850000,
                "available": true,
                "supplier_status": "online"
            },
            "2": {
                "supplier": "2",
                "supplier_label": "Nguồn 2",
                "enabled": true,
                "total_stock": 621825,
                "available": true,
                "supplier_status": "online"
            }
        },
        "updated_at": "2026-12-06T06:27:35+07:00"
    }
}
GET /stock/detailed
PUBLIC Báo cáo tồn kho chuyên sâu theo từng Rate & Nguồn

Trả về báo cáo phân rã chi tiết lượng tồn kho Robux theo từng mức tỷ giá (tier) của nguồn cung cấp đã chọn (?supplier=1 hoặc ?supplier=2), số lượng tài khoản bot đang trực tuyến, hạn mức mua tức thì và huy hiệu chất lượng.

curl -X GET "https://shopshouldcare.com/api/v1/stock/detailed?supplier=1" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "trace_id": "req_8f1a2e4b9c",
    "timestamp": "2026-12-06T06:27:35+07:00",
    "data": {
        "total_stock": 1089761,
        "total_stock_formatted": "1.089.761 R$",
        "is_available": true,
        "total_tiers": 2,
        "tiers": [
            {
                "tier_id": "rate_4_5",
                "rate_usd": 4.5,
                "rate_vnd": 117900,
                "rate_vnd_formatted": "117.900 đ",
                "active_accounts": 14,
                "max_instant_order": 38894,
                "max_instant_formatted": "38.894 R$",
                "stock_amount": 540000,
                "stock_formatted": "540K R$",
                "quality_badge": "★ NGON NHẤT",
                "badge_type": "best"
            },
            {
                "tier_id": "rate_5_0",
                "rate_usd": 5,
                "rate_vnd": 131000,
                "rate_vnd_formatted": "131.000 đ",
                "active_accounts": 8,
                "max_instant_order": 25000,
                "max_instant_formatted": "25.000 R$",
                "stock_amount": 350000,
                "stock_formatted": "350K R$",
                "quality_badge": "🛡 ỔN ĐỊNH",
                "badge_type": "stable"
            }
        ],
        "summary": {
            "min_vnd": 117900,
            "max_vnd": 144100,
            "recommended_vnd": 117900,
            "usd_vnd_exchange": 26200
        },
        "updated_at": "2026-12-06T06:27:35+07:00"
    }
}
GET /roblox/user
AUTH Tra cứu User Roblox & Avatar

Kiểm tra sự tồn tại của tài khoản Roblox, lấy ID số nguyên, Display Name và link ảnh Avatar Headshot chính chủ.

Tham số Kiểu Bắt buộc Mô tả
username string YES Tên tài khoản Roblox cần kiểm tra (VD: Roblox)
curl -X GET "https://shopshouldcare.com/api/v1/roblox/user?username=Roblox" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "user_id": 1,
        "username": "Roblox",
        "display_name": "Roblox",
        "avatar_url": "https://www.roblox.com/headshot-thumbnail/image?userId=1&width=150&height=150&format=png",
        "profile_url": "https://www.roblox.com/users/1/profile"
    }
}
GET /roblox/gamepasses
AUTH Quét danh sách Gamepass của user

Tự động tìm kiếm và quét toàn bộ các Gamepass đang mở bán công khai của tài khoản Roblox, kèm giá bán Robux, Place ID, Universe ID.

Tham số Kiểu Bắt buộc Mô tả
username string YES Username tài khoản Roblox để quét Gamepass
curl -X GET "https://shopshouldcare.com/api/v1/roblox/gamepasses?username=Roblox" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "user": {
            "id": 1,
            "username": "Roblox",
            "displayName": "Roblox",
            "avatar": "https://tr.rbxcdn.com/..."
        },
        "username": "Roblox",
        "user_id": 1,
        "total": 2,
        "gamepasses": [
            {
                "id": 12345678,
                "name": "VIP Server Pass",
                "price": 100,
                "after_tax": 70,
                "icon_url": "https://tr.rbxcdn.com/...",
                "place_id": 9872472334,
                "place_name": "My Awesome Game",
                "is_public": true
            },
            {
                "id": 87654321,
                "name": "Extra Speed",
                "price": 500,
                "after_tax": 350,
                "icon_url": "https://tr.rbxcdn.com/...",
                "place_id": 9872472334,
                "place_name": "My Awesome Game",
                "is_public": true
            }
        ]
    }
}
POST /orders/robux-120h
AUTH Tạo đơn nạp Robux 120H tự động

Khởi tạo đơn hàng mua Robux 120H qua Gamepass. Số dư ví đối tác được trừ tự động và an toàn (ACID transaction). Bot tự động mua Gamepass ngay khi đơn được tạo.

Field (JSON) Kiểu Bắt buộc Mô tả
gamepass_id integer YES ID của Gamepass cần nạp (lấy từ API /roblox/gamepasses)
robux_amount integer YES Số lượng Robux Gamepass (tối thiểu 10 R$; phải khớp với giá niêm yết trên Roblox)
supplier string OPTIONAL Nguồn cung cấp Robux 120H: "1" (Nguồn 1 - mặc định) hoặc "2" (Nguồn 2, tối đa 20.000 R$ sau thuế / 28.572 R$ niêm yết).
username string OPTIONAL Username Roblox chủ sở hữu Gamepass (tự động dò từ Roblox API nếu bỏ trống; khuyến nghị truyền khi dùng Nguồn 2)
place_id integer OPTIONAL Place ID chứa Gamepass trên Roblox (tự động phân giải nếu bỏ trống; khuyến nghị truyền từ API /roblox/gamepasses khi dùng Nguồn 2)
rate_id string OPTIONAL ID tier tỷ giá mong muốn (VD: rate_4_3) lấy từ /rates hoặc /stock/detailed
webhook_url string OPTIONAL URL nhận kết quả realtime khi đơn hoàn tất hoặc thất bại
curl -X POST "https://shopshouldcare.com/api/v1/orders/robux-120h" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json" \
  -d '{"gamepass_id":12345678,"robux_amount":100,"username":"Player123","place_id":987654321,"supplier":"1","webhook_url":"https:\/\/yourwebsite.com\/api\/callback"}'
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "order_code": "API_A8F19B4C2D",
        "supplier": "1",
        "supplier_label": "Nguồn 1",
        "product_name": "Robux 120H (100 R$)",
        "robux_amount": 100,
        "price_vnd": 15480,
        "status": "processing",
        "message": "Đã tạo đơn thành công, bot đang tiến hành mua Gamepass...",
        "created_at": "2026-12-06T06:27:35+07:00"
    }
}
GET /orders/status
AUTH Tra cứu trạng thái đơn hàng

Xem chi tiết tiến độ xử lý của đơn hàng theo mã đơn order_code.

Tham số Kiểu Bắt buộc Mô tả
order_code string YES Mã đơn nhận được khi tạo đơn (VD: API_A8F19B4C2D)
Các giá trị status:
pending: Chờ xử lý processing: Đang tiến hành giao completed: Đã hoàn tất failed: Thất bại (đã hoàn tiền)
curl -X GET "https://shopshouldcare.com/api/v1/orders/status?order_code=API_A8F19B4C2D" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "order_code": "API_A8F19B4C2D",
        "package_name": "Robux 120H (100 R$)",
        "price": 14000,
        "status": "completed",
        "created_at": "2026-12-06T06:22:35+07:00",
        "updated_at": "2026-12-06T06:27:35+07:00"
    }
}
POST /orders/check-status
AUTH Kích hoạt kiểm tra trạng thái tức thì

Kích hoạt bot kiểm tra tức thì tình trạng nạp Gamepass trên hệ thống và đồng bộ trạng thái ngay lập tức.

curl -X POST "https://shopshouldcare.com/api/v1/orders/check-status" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json" \
  -d '{"order_code":"API_A8F19B4C2D"}'
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "order_code": "API_A8F19B4C2D",
        "status": "completed",
        "package_name": "Robux 120H (100 R$)",
        "checked_at": "2026-12-06T06:27:35+07:00"
    }
}
GET /partner/me
AUTH Kiểm tra thông tin đại lý & số dư ví

Truy vấn thông tin tài khoản đối tác, số dư VND hiện tại, số dư Scoin và cấu hình webhook đã đăng ký.

curl -X GET "https://shopshouldcare.com/api/v1/partner/me" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "user_id": 108,
        "username": "daoly_vip",
        "balance": 2500000,
        "balance_text": "2.500.000 đ",
        "scoin": 150,
        "role": "partner",
        "discount_rate": 0,
        "app_name": "Website Đại Lý Tự Động",
        "webhook_url": "https://yourwebsite.com/api/callback"
    }
}
GET /partner/transactions
AUTH Xem lịch sử biến động số dư

Xem danh sách các giao dịch trừ tiền tạo đơn, nạp tiền hoặc hoàn tiền trên tài khoản ví đối tác.

curl -X GET "https://shopshouldcare.com/api/v1/partner/transactions?limit=10&page=1" \
  -H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
  -H "Content-Type: application/json"
Response 200 OK
{
    "status": true,
    "code": 200,
    "data": {
        "total": 58,
        "page": 1,
        "limit": 10,
        "total_pages": 6,
        "transactions": [
            {
                "id": 1204,
                "type": "buy",
                "amount": 14000,
                "balance_after": 2486000,
                "description": "Mua Robux 120H qua API (Mã đơn: API_A8F19B4C2D)",
                "status": "success",
                "created_at": "2026-12-06 06:27:35"
            }
        ]
    }
}
EVENTS

Webhooks Callbacks (Báo Kết Quả Tự Động)

Gửi tự động qua HTTP POST

Khi một đơn hàng hoàn tất hoặc thất bại, hệ thống ShouldCare Store sẽ tự động bắn một request HTTP POST chứa JSON payload đến Webhook URL mà bạn đã đăng ký hoặc truyền trong lúc tạo đơn:

Webhook Payload Example (POST JSON) Content-Type: application/json
{
  "event": "order.completed",
  "order_code": "API_A8F19B4C2D",
  "status": "completed",
  "robux_amount": 100,
  "gamepass_id": 12345678,
  "username": "Player123",
  "message": "Nạp Robux thành công cho khách hàng",
  "timestamp": "2026-12-06T06:27:35+07:00",
  "signature": "sha256_hash_here"
}
Xác thực Webhook Signature (Bảo mật):

Header X-ShouldCare-Signature được tính bằng hash_hmac('sha256', $rawPayload, $secretKey) (sử dụng Webhook Secret trong trang Quản Lý API Key).

ERRORS

Danh Mục Mã Lỗi (Error Codes)

Chuẩn HTTP Status & Error Code

Tất cả các lỗi đều kèm theo trường error_code để đối tác dễ dàng bắt lỗi bằng code:

HTTP Code Error Code Ý Nghĩa & Cách Khắc Phục
400 MISSING_PARAMETERS Thiếu tham số bắt buộc trong Request (như username, gamepass_id,...).
401 UNAUTHORIZED API Key không hợp lệ, bị khóa hoặc chưa truyền Bearer Token.
402 INSUFFICIENT_BALANCE Số dư ví đại lý không đủ tiền để tạo đơn. Hãy nạp thêm vào ví shop.
404 ORDER_NOT_FOUND Không tìm thấy mã đơn hàng hoặc đơn không thuộc về tài khoản này.
404 USER_NOT_FOUND Không tìm thấy người dùng Roblox trên hệ thống Roblox.
429 RATE_LIMIT_EXCEEDED Gửi quá nhiều request trong 1 phút. Vui lòng thử lại sau 60 giây.
503 SUPPLIER_OUT_OF_FUNDS Quỹ bot của nguồn cung cấp đã chọn đang tạm hết, hãy thử chuyển supplier sang nguồn còn lại hoặc thử lại sau.
503 SUPPLIER_DISABLED Nguồn cung cấp (supplier=1 hoặc 2) đang tạm bảo trì, vui lòng chuyển sang nguồn khả dụng.
400 AMOUNT_OUT_OF_RANGE Số lượng Robux vượt giới hạn tối đa mỗi đơn của nguồn đã chọn (VD Nguồn 2 tối đa 20.000 R$ sau thuế / 28.572 R$ niêm yết).
400 MISSING_PLACE_OR_OWNER Không xác định được place_id hoặc username chủ Gamepass (cần truyền thêm khi tạo đơn Nguồn 2).
SDKs

Trọn Bộ SDK Mẫu (PHP / Node.js / Python)

Thư viện wrapper gọi API

Copy đoạn code wrapper bên dưới để tích hợp ngay vào dự án của bạn chỉ trong 2 phút:

<?php
class ShouldCareClient {
    private string $apiKey;
    private string $baseUrl;

    public function __construct(string $apiKey, string $baseUrl = 'https://shopshouldcare.com/api/v1') {
        $this->apiKey = $apiKey;
        $this->baseUrl = rtrim($baseUrl, '/');
    }

    private function request(string $endpoint, string $method = 'GET', array $data = []): array {
        $url = $this->baseUrl . '/' . ltrim($endpoint, '/');
        $ch = curl_init();
        $headers = [
            'Authorization: Bearer ' . $this->apiKey,
            'Accept: application/json',
            'Content-Type: application/json'
        ];
        if ($method === 'POST') {
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        } elseif (!empty($data)) {
            $url .= '?' . http_build_query($data);
        }
        curl_setopt_array($ch, [
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HTTPHEADER => $headers,
            CURLOPT_TIMEOUT => 20
        ]);
        $response = curl_exec($ch);
        curl_close($ch);
        return json_decode($response, true) ?: [];
    }

    public function getRates(string $supplier = '1'): array { return $this->request('/rates', 'GET', ['supplier' => $supplier]); }
    public function getStock(string $supplier = '1'): array { return $this->request('/stock', 'GET', ['supplier' => $supplier]); }
    public function getRobloxUser(string $username): array { return $this->request('/roblox/user', 'GET', ['username' => $username]); }
    public function getGamepasses(string $username): array { return $this->request('/roblox/gamepasses', 'GET', ['username' => $username]); }
    public function createOrder(int $gamepassId, int $robuxAmount, string $username = '', int $placeId = 0, string $supplier = '1'): array {
        return $this->request('/orders/robux-120h', 'POST', array_filter([
            'gamepass_id'  => $gamepassId,
            'robux_amount' => $robuxAmount,
            'username'     => $username,
            'place_id'     => $placeId > 0 ? $placeId : null,
            'supplier'     => $supplier,
        ], fn($v) => $v !== null && $v !== ''));
    }
    public function getOrderStatus(string $orderCode): array { return $this->request('/orders/status', 'GET', ['order_code' => $orderCode]); }
    public function getBalance(): array { return $this->request('/partner/me'); }
}

// Khởi tạo và sử dụng
$client = new ShouldCareClient('shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6');
$rates = $client->getRates();
print_r($rates);

Tuỳ Chỉnh Giao Diện

Chọn 1 trong 3 chế độ màu sắc

CHẾ ĐỘ HIỂN THỊ

Thanh Toán Dịch Vụ

Kiểm tra lại thông tin trước khi thanh toán

Phiếu Thanh Toán
avatar

Khách

@guest

Số dư ví 0 ₫
🎮

Vé Giảm Giá Chọn 1 vé để áp dụng
Hiện chưa có vé giảm giá khả dụng.
Tạm tính 0 ₫
Tổng Thanh Toán 0 ₫

Thanh toán thành công

Cảm ơn bạn đã tin tưởng và mua hàng tại Shouldcare Store

Mã Đơn
#ORD000
Trạng Thái Đang Xử Lý
Dịch vụ Đơn hàng Shop
Thanh toán 0 ₫
Thời gian --:--
Đơn đã ghi nhận. Bấm Xem Đơn để theo dõi tiến độ hoặc Bỏ qua để ở lại trang.
Xem Đơn