tiktok.return_refund.202309.cancellations.search
POST/return_refund/202309/cancellations/searchGọi qua 360: POST https://partner.quantri360.com/v1/tiktok/return_refund/202309/cancellations/search
Mô tả API
Tìm yêu cầu hủy đơn (người mua / người bán / hệ thống).
- Gọi qua /v1/tiktok/return_refund/202309/cancellations/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.
- API chỉ đọc; code = 0 mới là thành công.
Request
Địa chỉ
POST https://partner.quantri360.com/v1/tiktok/return_refund/202309/cancellations/search
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ả |
|---|---|---|---|---|---|
| page_size | query | int | Có | 50 | 1–100. |
| page_token | query | string | Không | ||
| sort_field | query | string | Không | create_time | |
| sort_order | query | string | Không | DESC | |
| cancel_ids | body | string[] | Không | [] | |
| order_ids | body | string[] | Không | [] | |
| buyer_user_ids | body | string[] | Không | [] | |
| cancel_types | body | string[] | Không | ["BUYER_CANCEL"] | CANCEL · BUYER_CANCEL · SELLER_CANCEL. |
| cancel_status | body | string[] | Không | [] | CANCELLATION_REQUEST_PENDING · CANCELLATION_REQUEST_SUCCESS · CANCELLATION_REQUEST_CANCEL · CANCELLATION_REQUEST_COMPLETE. |
| create_time_ge | body | int | Không | 1760893200 | |
| create_time_lt | body | int | Không | 1760979600 | |
| update_time_ge | body | int | Không | ||
| update_time_lt | body | int | Không | ||
| locale | body | string | Không | vi-VN |
Phân trang
Lặp theo data.next_page_token.
Ví dụ request
curl -s -X POST "https://partner.quantri360.com/v1/tiktok/return_refund/202309/cancellations/search?page_size=50" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"create_time_ge":1760893200,"create_time_lt":1760979600}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/tiktok/return_refund/202309/cancellations/search",
params={
"page_size": 50
},
json={
"create_time_ge": 1760893200,
"create_time_lt": 1760979600
},
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/return_refund/202309/cancellations/search');
for (const [k, v] of Object.entries({"page_size":50})) 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":1760893200,"create_time_lt":1760979600}),
});
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/return_refund/202309/cancellations/search' . '?' . http_build_query(['page_size' => 50]);
$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":1760893200,"create_time_lt":1760979600}');
$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 | 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_REQUEST_0001 | Mã request TikTok. |
| data | object | Dữ liệu. | |
| next_page_token | string | ||
| cancellations | object[] | ||
| cancel_id | string | 100000000000000001 | |
| order_id | string | 100000000000000001 | |
| cancel_type | string | ||
| cancel_status | string | ||
| cancel_reason | string | ||
| refund_amount | object | ||
| create_time | number | 1792650000 | |
| update_time | number | 1792650000 | |
| cancel_line_items | object[] | Hủy dòng các mặt hàng. | |
| cancel_line_item_id | string | 100000000000000001 | Mã hủy dòng mặt hàng. |
| order_line_item_id | string | 100000000000000001 | Mã đơn dòng mặt hàng. |
| product_image | object | Sản phẩm ảnh. | |
| height | number | 1 | Cao. |
| url | string | https://example.com/tep-minh-hoa.pdf | Url. |
| width | number | 1 | Rộng. |
| product_name | string | Mẫu minh họa | Sản phẩm tên. |
| seller_sku | string | Người bán sku. | |
| sku_id | string | 100000000000000001 | Mã sku. |
| sku_name | string | Mẫu minh họa | Sku tên. |
| cancel_reason_text | string | Hủy lý do nội dung. | |
| role | string | Vai trò. | |
| should_replenish_stock | boolean | false | Nên bổ sung tồn kho. |
| total_count | number | 1 | Tổng số lượng. |
Mẫu phản hồi
{
"code": 0,
"message": "Success",
"request_id": "DEMO_REQUEST_0001",
"data": {
"next_page_token": "",
"cancellations": [
{
"cancel_id": "100000000000000001",
"order_id": "100000000000000001",
"cancel_type": "",
"cancel_status": "",
"cancel_reason": "",
"refund_amount": {},
"create_time": 1792650000,
"update_time": 1792650000,
"cancel_line_items": [
{
"cancel_line_item_id": "100000000000000001",
"order_line_item_id": "100000000000000001",
"product_image": {
"height": 1,
"url": "https://example.com/tep-minh-hoa.pdf",
"width": 1
},
"product_name": "Mẫu minh họa",
"seller_sku": "",
"sku_id": "100000000000000001",
"sku_name": "Mẫu minh họa"
}
],
"cancel_reason_text": "",
"role": "",
"should_replenish_stock": false
}
],
"total_count": 1
}
}
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