VI | EN
Nhắn Messenger
Dành cho developer

Lấy chi tiết sản phẩm Nhanh.vn — API Nhanh.vn

nhanh.v3.0.product.detail · gọi qua Quantri360 bằng một API key cho chính tài khoản / tài sản bạn đã kết nối và ủy quyền — 360 lo việc ký request và làm mới phiên đăng nhập bạn đã cấp.

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 0 ERR_INVALID_DATA "Invalid filters parmam"; gửi filters.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ênVị tríKiểuMẫuMô tả
AuthorizationheaderheaderBearer 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_idquerystring100001Gian 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ênVị tríKiểuBắt buộcMẫuMô tả
filters.idbodyintCó40388315Id 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ênKiểuMẫuMô tả
codeint11 = thành công; 0 = lỗi (xem `errorCode`, `messages`).
messagesstring[]Thông điệp lỗi.
dataobjectSản phẩm (một object, không phải mảng).
idint40388315
parentIdint40388279`-2` = sản phẩm cha, `-1` = độc lập, khác = id sản phẩm cha.
codestringSQKBC03M-Màu 3-35/28
barcodestring
namestring
statusint1
categoryIdint538678Id danh mục.
brandIdint66906Id thương hiệu.
typeobject{id, name} — vd `{"id":1,"name":"Sản phẩm"}`.
pricesobject{retail, import, wholesale, old, avgCost, retailVat, importVat} — VND.
shippingobject{weight (gram), length, width, height}.
inventoryobjectTồn tổng.
remainfloat4
availablefloat4
holdingfloat0
shippingfloat0
transferingfloat0
damagedfloat0
warrantyfloat0Bảo hành (ở đây là SỐ, khác product/list là object).
warrantyHoldingfloat0
holdingNewfloat0Tạm giữ loại xuất S.
shippingExportfloat0Đang chuyển loại xuất S.
depotsobject[]Tồn theo kho: {id, remain, available, holding, shipping, transfering, damaged, warranty, warrantyHolding, holdingNew, shippingExport}.
attributesobject[]{id, name, value, order, orderValue}.
suppliersobject[]Nhà cung cấp: {id, name, mobile}.
videosobject[][]
branchPricesobject[][]Giá theo chi nhánh: {branch{id,name}, price, wholesalePrice}.
childsobject[]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.
createdAtint1676623677Unix giây.
updatedAtint1789629996Unix giây.
tagIdsint[][]

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

  1. Đăng ký tài khoản Partner
  2. Mở loại dữ liệu thuộc nhóm Sản phẩm ở trang nền tảng
  3. Tạo API key (tick kênh Nhanh.vn)
  4. Gọi theo ví dụ ở trên