tiktok.affiliate_seller.202410.orders.search
POST/affiliate_seller/202410/orders/searchVia 360: POST https://partner.quantri360.com/v1/tiktok/affiliate_seller/202410/orders/search
Description
Đơn hàng có hoa hồng affiliate của gian hàng (đơn phát sinh từ video / LIVE / link của creator): creator nào, nội dung nào, SKU nào, tỉ lệ và tiền hoa hồng ước tính / thực tế, trạng thái quyết toán — dùng để đối soát chi phí KOC / KOL và đo hiệu quả từng creator.
- Gọi qua /v1/tiktok/affiliate_seller/202410/orders/search 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.
- Phân trang theo DÒNG SKU rồi mới gom theo đơn:
orderscó thể ít hơnpage_size, và SKU của cùng một đơn có thể nằm ở hai trang — gộp theoidtrên toàn bộ các trang. - Khoảng
create_time_ge→create_time_lttối đa 3 tháng. Luôn gửi cả hai mốc ở trang đầu để các trang sau giữ đúng bộ lọc. - Tiền dạng
{amount, currency}, amount là chuỗi số (VND). Khoản không áp dụng trả về object RỖNG{}thay vì 0 — xử lý thiếuamountlà "không có", không phải 0. - Tỉ lệ hoa hồng là CHUỖI theo đơn vị 1/100 % (
"500"= 5%). - Phản hồi có thêm
seller_sku,sku_namecho từng SKU;status,refunded_quantity,returned_quantitykhông còn trả về — dùngsettlement_statusvàfully_return. - API chỉ đọc; code = 0 mới là thành công.
Request
Endpoint
POST https://partner.quantri360.com/v1/tiktok/affiliate_seller/202410/orders/search
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 |
|---|---|---|---|---|---|
| page_size | query | int | Yes | 20 | Số dòng SKU mỗi trang: 1–100 (mặc định 20). |
| page_token | query | string | No | next_page_token của trang trước. | |
| create_time_ge | body | int | No | 1790000000 | Đơn tạo từ (Unix giây, ≥). Chỉ gửi create_time_lt mà không có create_time_ge → không giới hạn dưới. |
| create_time_lt | body | int | No | 1793200000 | Đơn tạo trước (Unix giây, <). Bỏ trống = đến hiện tại. Khoảng một lần gọi KHÔNG vượt 3 tháng. |
| program_id | body | string | No | Lọc theo chiến dịch của đối tác affiliate (agency). |
Pagination
Lặp khi data.next_page_token khác rỗng: gửi lại ĐÚNG body (cùng create_time_ge/lt, program_id), thêm query page_token.
Request examples
curl -s -X POST "https://partner.quantri360.com/v1/tiktok/affiliate_seller/202410/orders/search?page_size=20" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"create_time_ge":1790812800,"create_time_lt":1790899200}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/tiktok/affiliate_seller/202410/orders/search",
params={
"page_size": 20
},
json={
"create_time_ge": 1790812800,
"create_time_lt": 1790899200
},
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/affiliate_seller/202410/orders/search');
for (const [k, v] of Object.entries({"page_size":20})) 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({"create_time_ge":1790812800,"create_time_lt":1790899200}),
});
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/affiliate_seller/202410/orders/search' . '?' . http_build_query(['page_size' => 20]);
$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, '{"create_time_ge":1790812800,"create_time_lt":1790899200}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;Response
Response fields (as returned by TikTok Shop)
| Name | Type | Sample | Description |
|---|---|---|---|
| code | int | 0 | 0 = thành công; khác 0 xem message (105001–105003 = token, 360 đã tự làm mới một lần). |
| message | string | Success | Thông điệp của TikTok. |
| request_id | string | DEMO_AFFILIATE_REQUEST | Mã request TikTok. |
| data | object | Dữ liệu. | |
| total_count | int | 1 | Tổng số DÒNG SKU (không phải số đơn) khớp bộ lọc. |
| next_page_token | string | Rỗng = hết. | |
| orders | object[] | Đơn, gom theo mã đơn từ các dòng SKU của trang này. | |
| id | string | 100000000000000101 | Mã đơn TikTok (khớp `id` của orders/search). |
| create_time | int | 1790812800 | Tạo lúc (Unix giây). |
| delivery_time | int | 1790812800 | Giao thành công lúc (Unix giây); `0` = chưa giao. |
| skus | object[] | Từng SKU của đơn được tính hoa hồng. | |
| sku_id | string | 100000000000000101 | Mã SKU TikTok. |
| seller_sku | string | SKU-DEMO-001 | SKU người bán. |
| sku_name | string | Phân loại minh họa | Tên phân loại. |
| product_id | string | 100000000000000101 | Mã sản phẩm. |
| quantity | int | 1 | Số lượng (gồm cả phần sau đó hoàn). |
| price | object | Giá bán {amount (chuỗi), currency}. | |
| amount | string | 10000 | Số tiền. |
| currency | string | VND | Mã tiền tệ. |
| settlement_status | string | To-SETTLE | `AWAITING PAYMENT` (chưa thanh toán) · `To-SETTLE` (chờ quyết toán — mới có số ước tính) · `SETTLED` (đã quyết toán) · `INELIGIBLE` (không được tính hoa hồng) · `Unknown`. |
| creator_username | string | creator_minh_hoa | Creator được ghi nhận đơn (rỗng với đơn chiến dịch đối tác). |
| content_type | string | VIDEO | Nội dung tạo đơn: `SHOP` · `VIDEO` · `LIVE` · `PRE_LIVE` · `PROMOTION_PAGE` · `LINKSHARE`. |
| content_id | string | 100000000000000101 | Mã video / LIVE. |
| open_collaboration_id | string | 100000000000000101 | Hợp tác mở chứa sản phẩm (rỗng nếu không qua hợp tác mở). |
| target_collaboration_id | string | 100000000000000101 | Hợp tác mục tiêu (rỗng nếu không có). |
| campaign_id | string | 100000000000000101 | Chiến dịch TAP. |
| commission_model | string | Fixed commission | `Fixed commission` · `Tiered commission`. |
| commission_tier_setting | string | - | Các bậc % khi hoa hồng bậc thang (vd "3.0 OR 5.0"); `-` = không áp dụng. |
| commission_rate | string | 1000 | Tỉ lệ hoa hồng creator, đơn vị 1/100 % (500 = 5%). Vắng khi đơn không có hoa hồng creator trực tiếp. |
| shop_ads_commission_rate | string | 1000 | Tỉ lệ hoa hồng đơn từ Shop Ads, 1/100 % (200 = 2%). |
| partner_commission_rate | string | 1000 | Tỉ lệ cho đối tác affiliate (đơn chiến dịch đối tác). |
| estimated_commission_base | object | Doanh số tính hoa hồng ƯỚC TÍNH = giá × số lượng {amount, currency}. | |
| amount | string | 10000 | Số tiền. |
| currency | string | VND | Mã tiền tệ. |
| estimated_paid_commission | object | Hoa hồng creator ước tính. | |
| amount | string | 10000 | Số tiền. |
| currency | string | VND | Mã tiền tệ. |
| estimated_paid_shop_ads_commission | object | Hoa hồng Shop Ads ước tính. | |
| estimated_paid_partner_commission | object | Hoa hồng đối tác ước tính. | |
| actual_commission_base | object | Doanh số tính hoa hồng THỰC TẾ (trừ hoàn) — chỉ có khi đã quyết toán. | |
| actual_paid_commission | object | Hoa hồng creator thực trả. | |
| actual_paid_shop_ads_commission | object | Hoa hồng Shop Ads thực trả. | |
| actual_paid_partner_commission | object | Hoa hồng đối tác thực trả. | |
| estimated_cofunded_creator_bonus_amount | object | Phần thưởng creator gian hàng đồng chi (ước tính); bản `actual_…` = thực tế. | |
| fully_return | string | No | `Yes` = hoàn / trả toàn bộ, không trả hoa hồng · `No`. |
| is_carousel | boolean | false | `true` = đơn từ nội dung ảnh trượt (có thể giảm tỉ lệ hoa hồng). |
| actual_cofunded_creator_bonus_amount | object | Tiền thưởng đồng tài trợ cho creator thực tế. |
Response sample
{
"code": 0,
"message": "Success",
"request_id": "DEMO_AFFILIATE_REQUEST",
"data": {
"total_count": 1,
"next_page_token": "",
"orders": [
{
"id": "100000000000000101",
"create_time": 1790812800,
"delivery_time": 1790812800,
"skus": [
{
"sku_id": "100000000000000101",
"seller_sku": "SKU-DEMO-001",
"sku_name": "Phân loại minh họa",
"product_id": "100000000000000101",
"quantity": 1,
"price": {
"amount": "10000",
"currency": "VND"
},
"settlement_status": "To-SETTLE",
"creator_username": "creator_minh_hoa",
"content_type": "VIDEO",
"content_id": "100000000000000101",
"open_collaboration_id": "100000000000000101",
"target_collaboration_id": "100000000000000101",
"campaign_id": "100000000000000101",
"commission_model": "Fixed commission",
"commission_tier_setting": "-",
"commission_rate": "1000",
"shop_ads_commission_rate": "1000",
"partner_commission_rate": "1000",
"estimated_commission_base": {
"amount": "10000",
"currency": "VND"
},
"estimated_paid_commission": {
"amount": "10000",
"currency": "VND"
},
"estimated_paid_shop_ads_commission": {},
"estimated_paid_partner_commission": {},
"actual_commission_base": {},
"actual_paid_commission": {},
"actual_paid_shop_ads_commission": {},
"actual_paid_partner_commission": {},
"estimated_cofunded_creator_bonus_amount": {},
"fully_return": "No",
"is_carousel": false,
"actual_cofunded_creator_bonus_amount": {}
}
]
}
]
}
}
Get started
- Sign up for Partner
- Enable a data type of the Affiliate group on the platform page
- Create an API key (tick the TikTok Shop channel)
- Call it as in the examples above