nhanh.v3.0.shipping.location
POST/v3.0/shipping/locationVia 360: POST https://partner.quantri360.com/v1/nhanh/v3.0/shipping/location
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
Địa giới hành chính của Nhanh (tỉnh / quận / phường) — dùng khi đối chiếu địa chỉ đơn. Có 2 bộ: v1 = địa giới cũ 63 tỉnh, 3 cấp; v2 = địa giới mới 34 tỉnh, phường / xã nằm thẳng dưới tỉnh.
- Mọi tham số nằm trong object
filters(không đặt ở cấp gốc body). - Danh sách ít đổi — lấy một lần rồi lưu lại, không gọi theo từng đơn.
Request
Endpoint
POST https://partner.quantri360.com/v1/nhanh/v3.0/shipping/location
Authentication & shop
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| 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. |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| filters.locationVersion | body | string | Yes | v2 | v1 (63 tỉnh, tỉnh → quận → phường) · v2 (34 tỉnh, tỉnh → phường / xã). BẮT BUỘC — thiếu thì Nhanh trả code 0 "locationVersion: Chưa truyền giá trị". |
| filters.type | body | string | Yes | CITY | CITY · DISTRICT · WARD. |
| filters.parentId | body | int | No | 254 | Id cấp trên: v1 — quận cần id tỉnh, phường cần id quận; v2 — phường / xã dùng thẳng id tỉnh. |
Request examples
curl -s -X POST "https://partner.quantri360.com/v1/nhanh/v3.0/shipping/location" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"filters":{"locationVersion":"v2","type":"CITY"}}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/nhanh/v3.0/shipping/location",
params={},
json={
"filters": {
"locationVersion": "v2",
"type": "CITY"
}
},
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/shipping/location');
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":{"locationVersion":"v2","type":"CITY"}}),
});
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/shipping/location' . '?' . 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":{"locationVersion":"v2","type":"CITY"}}');
$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)
| Name | Type | Sample | Description |
|---|---|---|---|
| code | int | 1 | 1 = thành công; 0 = lỗi (xem messages). |
| messages | string[] | [] | Thông điệp lỗi của Nhanh. |
| data | object[] | Dữ liệu. | |
| id | int | 254 | |
| name | string | Hà Nội |
Response sample
{
"code": 1,
"data": [
{
"id": "(int) ID địa chỉ 1",
"name": "Tên địa chỉ",
"otherName": "Tên khác của địa chỉ"
},
{
"id": "(int) ID địa chỉ 2",
"name": "Tên địa chỉ"
}
]
}
Get started
- Sign up for Partner
- Enable a data type of the Basic group on the platform page
- Create an API key (tick the Nhanh.vn channel)
- Call it as in the examples above