get /shops/{SHOP_ID}/products/variations
GET/shops/{SHOP_ID}/products/variationsGọi qua 360: GET https://partner.quantri360.com/v1/pancake_pos/shops/{SHOP_ID}/products/variations
Sắp mở. API này đã chạy thật qua 360 và đang được chốt giá — bạn có thể đọc tài liệu và chuẩn bị tích hợp trước.
Mô tả API
Danh sách MẪU MÃ (biến thể / SKU) kèm sản phẩm cha, giá bán, giá nhập, tồn kho theo từng kho (có thể bán, thực có, chờ giao, đang hoàn, giữ chỗ), cờ sắp hết hàng. Dùng để đồng bộ danh mục + tồn kho về hệ thống của bạn, cảnh báo hết hàng, so tồn đa kênh.
product.display_idở API này là MÃ SẢN PHẨM người bán đặt (vdWT20035J) — trong API chi tiết sản phẩm, mã đó nằm ởcustom_id, còndisplay_idlà số thứ tự (vd 7262).- Bộ lọc tồn kho nhận chuỗi JSON trong MỘT tham số (URL-encode), không phải tham số lồng.
- Tiền là số nguyên VND; mẫu mã chưa nhập giá có
retail_price: 0.
Request
Địa chỉ
GET https://partner.quantri360.com/v1/pancake_pos/shops/{SHOP_ID}/products/variations
Xác thực & gian hàng
| Tên | Vị trí | Kiểu | Mẫu | Mô tả |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | 1234567 | SHOP_ID đã nối — có thể bỏ khi đường dẫn có /shops/{SHOP_ID}. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| SHOP_ID | path | int | Có | 1234567 | Mã cửa hàng đã nối với 360. |
| page_number | query | int | Không | 1 | |
| page_size | query | int | Không | 100 | Số mẫu mã / trang (thử thật 1000 vẫn nhận; nên ≤ 1000 cho phản hồi nhẹ). |
| search | query | string | Không | WT20035J | Tìm theo tên / mã. |
| remainQuantity | query | string (JSON) | Không | {"type":"greaterOrEqual","value":1} | Lọc theo tồn CÓ THỂ BÁN: chuỗi JSON type = greaterOrEqual | smallerOrEqual | between (dùng minValue / maxValue). Cùng cấu trúc: actualQuantity (tồn thực), waittingQuantity (chờ giao — đúng chính tả này), returningQuantity, pendingQuantity, totalQuantity. |
| nearly_out | query | bool | Không | true | Chỉ mẫu mã bị đánh dấu sắp hết ở ít nhất một kho. Tương tự: limit_quantity_to_warn=true (chạm ngưỡng cảnh báo), defectQuantity=true (có hàng lỗi). |
| product_status | query | string | Không | not_locked | locked · not_locked. |
| selling_status | query | string | Không | normal | Tốc độ bán: none · bad · normal · star. |
| category_id[] | query | int[] | Không | 614041900 | Lọc danh mục (lặp tham số). |
| startDate / endDate | query | timestamp | Không | 1790787600 | Khoảng tạo sản phẩm (Unix giây). |
| start_time_update / end_time_update | query | timestamp | Không | 1790787600 | Khoảng cập nhật sản phẩm (Unix giây) — dùng cho đồng bộ tăng dần. |
| variation_ids[] | query | string[] | Không | 5c49d772-a1e1-49ef-9f43-78539d396363 | Lấy đúng các mẫu mã này. |
| warehouse_until | query | string | Không | 2026-10-01T00:00:00Z | Tồn kho tại một thời điểm trong quá khứ. |
Phân trang
page_number = 1 … total_pages.
Ví dụ request
curl -s "https://partner.quantri360.com/v1/pancake_pos/shops/1234567/products/variations?page_number=1&page_size=100&remainQuantity=%7B%22type%22%3A%22greaterOrEqual%22%2C%22value%22%3A1%7D" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/pancake_pos/shops/1234567/products/variations",
params={
"page_number": 1,
"page_size": 100,
"remainQuantity": "{\"type\":\"greaterOrEqual\",\"value\":1}"
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/pancake_pos/shops/1234567/products/variations');
for (const [k, v] of Object.entries({"page_number":1,"page_size":100,"remainQuantity":"{\"type\":\"greaterOrEqual\",\"value\":1}"})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/pancake_pos/shops/1234567/products/variations' . '?' . http_build_query(['page_number' => 1, 'page_size' => 100, 'remainQuantity' => '{"type":"greaterOrEqual","value":1}']);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;Response
Tham số phản hồi (nguyên của Pancake POS)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| success | bool | true | |
| page_number / page_size | int | 1 / 100 | |
| total_entries | int | 27283 | Tổng mẫu mã khớp lọc. |
| total_pages | int | 273 | |
| data | object[] | Mẫu mã. | |
| id | string | 5c49d772-a1e1-49ef-9f43-78539d396363 | Mã mẫu mã (variation_id trên đơn). |
| display_id | string | 2 | Mã hiển thị của mẫu mã trong sản phẩm. |
| barcode | string | 16199713 | Mã vạch. |
| product_id | string | cf288440-ef56-493b-832b-9006ecff172f | Sản phẩm cha. |
| product | object | Sản phẩm cha: name, display_id (mã SP người bán đặt, vd `WT20035J`), categories, tags, brand_id, image, note… | |
| fields | object[] | [] | Thuộc tính (màu, size…): name, value. |
| retail_price | int | 698000 | Giá bán (VND). |
| retail_price_after_discount | int | 698000 | Giá sau giảm. |
| price_at_counter | int | 0 | Giá tại quầy. |
| last_imported_price / average_imported_price | int | 0 | Giá nhập gần nhất / bình quân. |
| total_purchase_price | int | 0 | |
| wholesale_price | object[] | [{"levelProduct":"1","wholesalePrices":"0"}] | Giá sỉ theo cấp. |
| remain_quantity | int | 1 | Tồn có thể bán (cộng mọi kho). |
| variations_warehouses | object[] | Tồn theo kho: warehouse_id, remain_quantity (có thể bán), actual_remain_quantity (thực có), total_quantity, waiting_quantity (chờ giao), returning_quantity, pending_quantity, shelf_position… | |
| warehouse_ids | string[] | Kho có hàng. | |
| weight | int | 0 | Gram. |
| images | string[] | ||
| is_locked / is_hidden / is_removed | bool | false | |
| is_composite / composite_products | Sản phẩm cấu thành. | ||
| inserted_at / updated_at | string | 2025-12-09T06:39:23.869731 | Giờ UTC. |
Mẫu phản hồi
{
"success": true,
"page_number": 1,
"page_size": 1,
"total_entries": 9252,
"total_pages": 9252,
"data": [
{
"id": "5c49d772-a1e1-49ef-9f43-78539d396363",
"display_id": "2",
"barcode": "16199713",
"product_id": "cf288440-ef56-493b-832b-9006ecff172f",
"retail_price": 698000,
"retail_price_after_discount": 698000,
"last_imported_price": 0,
"average_imported_price": 0,
"remain_quantity": 1,
"weight": 0,
"fields": [],
"warehouse_ids": [
"6d1b3245-31a2-4d2b-a3c1-c96f5c8bc76e"
],
"product": {
"name": "Chân váy A khóa sau/WT20035J/Đ18",
"display_id": "WT20035J",
"categories": [],
"tags": [],
"brand_id": "950f8fc6-6260-4dc9-8594-392489920efa"
},
"variations_warehouses": [
{
"warehouse_id": "6d1b3245-31a2-4d2b-a3c1-c96f5c8bc76e",
"remain_quantity": 1,
"actual_remain_quantity": 1,
"total_quantity": 1,
"waiting_quantity": 0,
"returning_quantity": 0,
"pending_quantity": 0
}
],
"is_locked": false,
"is_hidden": false,
"inserted_at": "2025-12-09T06:39:23.869731"
}
]
}
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Sản phẩm ở trang nền tảng
- Tạo API key (tick kênh Pancake POS)
- Gọi theo ví dụ ở trên