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.
https://shopshouldcare.com/api/v1
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.
Xác thực API (Authentication)
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:
- Định dạng chuẩn:
shouldcare_ + 36 ký tự ngẫu nhiên. - Truyền qua header:
Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6hoặcX-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.
curl "https://shopshouldcare.com/api/v1/partner/me" \
-H "Authorization: Bearer shouldcare_live_k9x2m4p8q1v7w3y5z6a0b1c2d3e4f5g6" \
-H "Accept: application/json"
Chuẩn Response Envelope (v1.0)
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:
{
"status": true,
"code": 200,
"trace_id": "req_9f3a12b4e7",
"timestamp": "2026-11-20T10:30:00+07:00",
"data": {
...
}
}
{
"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"
}
Idempotency & Tốc Độ Giới Hạn (Rate Limits)
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.
- 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.
/rates
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"
{
"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
}
}
}
/stock
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"
{
"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"
}
}
/stock/detailed
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"
{
"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"
}
}
/roblox/user
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"
{
"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"
}
}
/roblox/gamepasses
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"
{
"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
}
]
}
}
/orders/robux-120h
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"}'
{
"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"
}
}
/orders/status
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) |
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"
{
"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"
}
}
/orders/check-status
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"}'
{
"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"
}
}
/partner/me
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"
{
"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"
}
}
/partner/transactions
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"
{
"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"
}
]
}
}
Webhooks Callbacks (Báo Kết Quả Tự Động)
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:
{
"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"
}
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).
Danh Mục Mã Lỗi (Error Codes)
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). |
Trọn Bộ SDK Mẫu (PHP / Node.js / Python)
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);