tiktok.fulfillment.202609.order.sof.track.update
POST/fulfillment/202609/order/sof/track/updateGọi qua 360: POST https://partner.quantri360.com/v1/tiktok/fulfillment/202609/order/sof/track/update
Endpoint ghi — thay đổi dữ liệu trên TikTok Shop. Key phải được tạo với tick "Cho phép gọi API ghi", nếu không sẽ nhận 403 write_not_allowed. Mỗi lần gọi được ghi nhật ký.
Mô tả API
Cập nhật trạng thái hành trình vận chuyển.
- Gọi qua /v1/tiktok/fulfillment/202609/order/sof/track/update với Authorization: Bearer <key>; dùng platform_shop_id khi có nhiều shop. 360 tự gắn app_key, shop_cipher, sign và access_token.
- API GHI: thay đổi dữ liệu thật trên TikTok Shop; cần key có quyền ghi (can_write) và gói mở module Đơn hàng. Cập nhật trạng thái hành trình vận chuyển.
- HTTP 200 vẫn có thể có lỗi nghiệp vụ; kiểm code trước khi dùng kết quả.
Request
Địa chỉ
POST https://partner.quantri360.com/v1/tiktok/fulfillment/202609/order/sof/track/update
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ả |
|---|---|---|---|---|---|
| country | body | string | Có | VN | Quốc gia. |
| order_id | body | string | Có | 100000000000000001 | Mã đơn hàng. |
| external_tracking_url | body | string | Không | https://example.com/tep-minh-hoa.pdf | Bên ngoài vận đơn url. |
| tracks | body | object[] | Có | Các mốc hành trình. Tối đa 50. | |
| tracks[].action_code | body | int | Có | 1 | Hành động mã. |
| tracks[].occur_time | body | int | Có | 1792650000 | Xảy ra thời gian. Mốc Unix mili giây. |
| tracks[].description | body | string | Có | minh-hoa | Mô tả. |
| tracks[].failed_reason | body | string | Không | R110 | Thất bại lý do. |
| tracks[].proof_url | body | string | Không | https://example.com/tep-minh-hoa.pdf | Bằng chứng url. |
| tracks[].location | body | object | Không | Vị trí. | |
| tracks[].location.country | body | string | Không | VN | Quốc gia. |
| tracks[].location.state | body | string | Không | SP | Trạng thái. |
| tracks[].location.city | body | string | Không | minh-hoa | Thành phố. |
| tracks[].location.zip_code | body | string | Không | minh-hoa | Bưu chính mã. |
| tracks[].tracking_no | body | string | Có | BR443310090002 | Vận đơn số. |
| provider_id | body | string | Có | 100000000000000001 | Mã đơn vị. |
Ví dụ request
curl -s -X POST "https://partner.quantri360.com/v1/tiktok/fulfillment/202609/order/sof/track/update" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"country":"VN","order_id":"100000000000000001","tracks":[{"action_code":1,"occur_time":1792650000,"description":"minh-hoa","failed_reason":"R110","proof_url":"https://example.com/tep-minh-hoa.pdf","location":{"country":"VN","state":"SP","city":"minh-hoa","zip_code":"minh-hoa"},"tracking_no":"BR443310090002"}],"provider_id":"100000000000000001"}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/tiktok/fulfillment/202609/order/sof/track/update",
params={},
json={
"country": "VN",
"order_id": "100000000000000001",
"tracks": [
{
"action_code": 1,
"occur_time": 1792650000,
"description": "minh-hoa",
"failed_reason": "R110",
"proof_url": "https://example.com/tep-minh-hoa.pdf",
"location": {
"country": "VN",
"state": "SP",
"city": "minh-hoa",
"zip_code": "minh-hoa"
},
"tracking_no": "BR443310090002"
}
],
"provider_id": "100000000000000001"
},
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/tiktok/fulfillment/202609/order/sof/track/update');
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({"country":"VN","order_id":"100000000000000001","tracks":[{"action_code":1,"occur_time":1792650000,"description":"minh-hoa","failed_reason":"R110","proof_url":"https://example.com/tep-minh-hoa.pdf","location":{"country":"VN","state":"SP","city":"minh-hoa","zip_code":"minh-hoa"},"tracking_no":"BR443310090002"}],"provider_id":"100000000000000001"}),
});
console.log(r.status, await r.json());PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/tiktok/fulfillment/202609/order/sof/track/update' . '?' . 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, '{"country":"VN","order_id":"100000000000000001","tracks":[{"action_code":1,"occur_time":1792650000,"description":"minh-hoa","failed_reason":"R110","proof_url":"https://example.com/tep-minh-hoa.pdf","location":{"country":"VN","state":"SP","city":"minh-hoa","zip_code":"minh-hoa"},"tracking_no":"BR443310090002"}],"provider_id":"100000000000000001"}');
$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 TikTok Shop)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| code | int | 0 | Mã kết quả; 0 là thành công. |
| message | string | Success | Thông báo kết quả; khi lỗi, đọc nội dung để xử lý. |
| request_id | string | DEMO_REQUEST_0001 | Mã truy vết yêu cầu. |
| data | object | Dữ liệu. | |
| track_results | object[] | Hành trình các kết quả. Giá trị / trường liên quan: code, message. | |
| action_code | int | 1 | Hành động mã. |
| occur_time | int | 1792650000 | Xảy ra thời gian. Mốc Unix mili giây. |
| description | string | Mô tả. | |
| code | int | 0 | Mã kết quả; 0 là thành công. |
| message | string | Success | Thông báo kết quả; khi lỗi, đọc nội dung để xử lý. |
| tracking_no | string | VNDEMO0001 | Vận đơn số. |
Mẫu phản hồi
{
"code": 0,
"message": "Success",
"request_id": "DEMO_REQUEST_0001",
"data": {
"track_results": [
{
"action_code": 1,
"occur_time": 1792650000,
"description": "",
"code": 0,
"message": "Success",
"tracking_no": "VNDEMO0001"
}
]
}
}
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Đơn hàng ở trang nền tảng
- Tạo API key (tick kênh TikTok Shop)
- Gọi theo ví dụ ở trên