VI | EN
Message us on Messenger
Developer resources

Danh mục sản phẩm — Nhanh.vn API

nhanh.v3.0.product.category · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

nhanh.v3.0.product.category

POST/v3.0/product/categoryVia 360: POST https://partner.quantri360.com/v1/nhanh/v3.0/product/category
Coming soon. This API already runs in production through 360 and pricing is being finalised — you can read the docs and prepare your integration now.
Description

Danh mục sản phẩm của doanh nghiệp trên Nhanh (cây cha – con theo parentId) — dùng để hiển thị tên danh mục cho categoryId của sản phẩm và gom báo cáo theo nhóm hàng.

  • Phản hồi chỉ có id, parentId, code, name, order, status — không kèm ảnh / nội dung danh mục.
  • Danh mục ít đổi — lấy toàn bộ một lần, lưu lại và dựng cây theo parentId.

Request

Endpoint

POST https://partner.quantri360.com/v1/nhanh/v3.0/product/category

Authentication & shop

NameInTypeSampleDescription
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.

Request parameters

NameInTypeRequiredSampleDescription
filters.idsbodyint[]NoId danh mục, tối đa 100.
filters.namebodystringNoÁoTìm theo tên (khớp một phần).
filters.codebodystringNoMã danh mục.
filters.statusbodyintNo11 đang dùng · 2 ngừng dùng.
paginator.sizebodyintNo100Số danh mục mỗi trang — tối đa 100.
paginator.nextbodyobjectNo{"id": 588004}Nguyên object paginator.next của trang trước; bỏ ở trang đầu.

Pagination

Lặp khi phản hồi có paginator.next, gửi lại nguyên object; danh mục id lớn (mới tạo) trả trước.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/nhanh/v3.0/product/category" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"paginator":{"size":100}}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/nhanh/v3.0/product/category",
    params={},
    json={
        "paginator": {
            "size": 100
        }
    },
    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/category');
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({"paginator":{"size":100}}),
});
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/category' . '?' . 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, '{"paginator":{"size":100}}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Response fields (as returned by Nhanh.vn)

NameTypeSampleDescription
codeint11 = thành công; 0 = lỗi (xem messages).
messagesstring[][]Thông điệp lỗi của Nhanh.
dataobject[]Dữ liệu.
idint588006Id danh mục.
parentIdint538679Danh mục cha; `0` = danh mục gốc.
codestring2.6.3Mã danh mục.
namestringQuần âu 2 ly
orderint0Thứ tự.
statusint11 đang dùng · 2 ngừng dùng (dữ liệu thật có cả giá trị `0`).
paginatorobjectPhân trang.
nextobject{"id": 588004}Gửi lại nguyên ở request kế; không có = hết.

Response sample

{
  "code": 1,
  "paginator": {
    "next": {
      "id": 588001
    }
  },
  "data": [
    {
      "id": 588003,
      "parentId": 0,
      "code": "2.10",
      "name": "Quần Linen",
      "order": 0,
      "status": 1
    },
    {
      "id": 588002,
      "parentId": 538657,
      "code": "2.8.5",
      "name": "Bộ Tanktop ",
      "order": 0,
      "status": 0
    },
    {
      "id": 588001,
      "parentId": 587996,
      "code": "1.2.10",
      "name": "Áo phao gile 3 lớp ",
      "order": 0,
      "status": 1
    }
  ]
}

Get started

  1. Sign up for Partner
  2. Enable a data type of the Sản phẩm group on the platform page
  3. Create an API key (tick the Nhanh.vn channel)
  4. Call it as in the examples above