nhanh.v3.0.product.detail
POST/v3.0/product/detailGọi qua 360: POST https://partner.quantri360.com/v1/nhanh/v3.0/product/detail
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
Chi tiết một sản phẩm Nhanh: giá, thuộc tính, tồn theo từng kho (thêm các cột tạm giữ / đang chuyển loại xuất S), nhà cung cấp, video, giá theo chi nhánh và danh sách sản phẩm con (childs) khi là sản phẩm cha.
- Id đặt TRONG
filters:{"filters":{"id":…}}. Gửi{"id":…}ở cấp gốc → code 0ERR_INVALID_DATA"Invalid filters parmam"; gửifilters.ids→ERR_DATA_404"Không tìm thấy dữ liệu". - Danh mục / thương hiệu trả dạng id (
categoryId,brandId), không kèm tên — tra tên qua /v3.0/product/category. - Gọi id sản phẩm cha: tồn của cha bằng 0, tồn thật nằm trong từng phần tử
childs.
Request
Địa chỉ
POST https://partner.quantri360.com/v1/nhanh/v3.0/product/detail
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 | 100001 | Gian hàng (lấy ở GET /v1/platforms → shops[].platform_shop_id). BẮT BUỘC khi brand có > 1 gian hàng trên nền tảng; 360 bỏ tham số này trước khi chuyển tiếp. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| filters.id | body | int | Có | 40388315 | Id sản phẩm Nhanh (lấy từ /v3.0/product/list). |
Ví dụ request
curl -s -X POST "https://partner.quantri360.com/v1/nhanh/v3.0/product/detail" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"filters":{"id":40388315}}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/nhanh/v3.0/product/detail",
params={},
json={
"filters": {
"id": 40388315
}
},
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/nhanh/v3.0/product/detail');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'POST',
headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"filters":{"id":40388315}}),
});
console.log(r.status, await r.json());PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/nhanh/v3.0/product/detail' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"filters":{"id":40388315}}');
$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 Nhanh.vn)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| code | int | 1 | 1 = thành công; 0 = lỗi (xem `errorCode`, `messages`). |
| messages | string[] | Thông điệp lỗi. | |
| data | object | Sản phẩm (một object, không phải mảng). | |
| id | int | 40388315 | |
| parentId | int | 40388279 | `-2` = sản phẩm cha, `-1` = độc lập, khác = id sản phẩm cha. |
| code | string | SQKBC03M-Màu 3-35/28 | |
| barcode | string | ||
| name | string | ||
| status | int | 1 | |
| categoryId | int | 538678 | Id danh mục. |
| brandId | int | 66906 | Id thương hiệu. |
| type | object | {id, name} — vd `{"id":1,"name":"Sản phẩm"}`. | |
| prices | object | {retail, import, wholesale, old, avgCost, retailVat, importVat} — VND. | |
| shipping | object | {weight (gram), length, width, height}. | |
| inventory | object | Tồn tổng. | |
| remain | float | 4 | |
| available | float | 4 | |
| holding | float | 0 | |
| shipping | float | 0 | |
| transfering | float | 0 | |
| damaged | float | 0 | |
| warranty | float | 0 | Bảo hành (ở đây là SỐ, khác product/list là object). |
| warrantyHolding | float | 0 | |
| holdingNew | float | 0 | Tạm giữ loại xuất S. |
| shippingExport | float | 0 | Đang chuyển loại xuất S. |
| depots | object[] | Tồn theo kho: {id, remain, available, holding, shipping, transfering, damaged, warranty, warrantyHolding, holdingNew, shippingExport}. | |
| attributes | object[] | {id, name, value, order, orderValue}. | |
| suppliers | object[] | Nhà cung cấp: {id, name, mobile}. | |
| videos | object[] | [] | |
| branchPrices | object[] | [] | Giá theo chi nhánh: {branch{id,name}, price, wholesalePrice}. |
| childs | object[] | Sản phẩm con (chỉ có phần tử khi gọi id sản phẩm cha) — cấu trúc như phần tử của product/list. | |
| createdAt | int | 1676623677 | Unix giây. |
| updatedAt | int | 1789629996 | Unix giây. |
| tagIds | int[] | [] |
Mẫu phản hồi
{
"code": 1,
"data": {
"id": 40388315,
"parentId": 40388279,
"code": "SQKBC03M-Màu 3-35/28",
"barcode": "171962310",
"name": "Quần kaki dáng suông ( Regular fit)/SQKBC03M/Màu 3 - Xanh/35/28/UNF08",
"status": 1,
"priceVatMode": 0,
"importPriceVatMode": 0,
"categoryId": 538678,
"prices": {
"retail": 299000,
"retailVat": 0,
"import": 0,
"importVat": 0,
"old": 0,
"wholesale": 0,
"avgCost": 0
},
"images": {
"others": []
},
"warranty": [],
"brandId": 66906,
"type": {
"id": 1,
"name": "Sản phẩm"
},
"shipping": {
"width": 0,
"height": 0,
"length": 0,
"weight": 500
},
"units": {
"name": "Chiếc",
"list": []
},
"combos": [],
"inventory": {
"remain": 4,
"shipping": 0,
"damaged": 0,
"holding": 0,
"transfering": 0,
"warranty": 0,
"warrantyHolding": 0,
"holdingNew": 0,
"shippingExport": 0,
"available": 4,
"depots": [
{
"id": 104483,
"remain": 3,
"shipping": 0,
"damaged": 0,
"holding": 0,
"transfering": 0,
"warranty": 0,
"warrantyHolding": 0,
"holdingNew": 0,
"shippingExport": 0,
"available": 3
},
{
"id": 154040,
"remain": 1,
"shipping": 0,
"damaged": 0,
"holding": 0,
"transfering": 0,
"warranty": 0,
"warrantyHolding": 0,
"holdingNew": 0,
"shippingExport": 0,
"available": 1
}
]
},
"attributes": [
{
"id": 131362,
"name": "Kích thước",
"value": "35/28",
"order": 0,
"orderValue": 0
},
{
"id": 131361,
"name": "Màu sắc",
"value": "Xanh",
"order": 0,
"orderValue": 0
}
],
"updatedAt": 1789629996,
"createdAt": 1676623677,
"tagIds": [],
"suppliers": [
{
"id": 169166,
"name": "Nhà cung cấp A",
"mobile": "0901234567"
}
],
"videos": [],
"branchPrices": [],
"childs": []
}
}
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 Nhanh.vn)
- Gọi theo ví dụ ở trên