VI | EN
Nhắn Messenger
Dành cho developer

Search Cancellations — API TikTok Shop

tiktok.return_refund.202602.cancellations.search · gọi qua Quantri360 bằng một API key cho chính tài khoản / tài sản bạn đã kết nối và ủy quyền — 360 lo việc ký request và làm mới phiên đăng nhập bạn đã cấp.

tiktok.return_refund.202602.cancellations.search

POST/return_refund/202602/cancellations/searchGọi qua 360: POST https://partner.quantri360.com/v1/tiktok/return_refund/202602/cancellations/search
Mô tả API

Tìm yêu cầu hủy đơn hàng.

  • Gọi qua /v1/tiktok/return_refund/202602/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/202602/cancellations/search

Xác thực & gian hàng

TênVị tríKiểuMẫuMô tả
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.

Tham số request

TênVị tríKiểuBắt buộcMẫuMô tả
sort_fieldquerystringKhôngminh-hoaSắp xếp trường. Giá trị / trường liên quan: create_time, update_time.
sort_orderquerystringKhôngASCSắp xếp đơn. Giá trị / trường liên quan: ASC, DESC.
page_sizequerystringKhôngminh-hoaSố kết quả trên một trang.
page_tokenquerystringKhôngMã trang nhận từ next_page_token của phản hồi trước.
cancel_idsbodystring[]Không["100000000000000001"]Các mã hủy.
order_idsbodystring[]Không["100000000000000001"]Danh sách mã đơn hàng.
buyer_user_idsbodystring[]Không["100000000000000001"]Các mã người mua người dùng.
cancel_typesbodystring[]Không["CANCEL"]Hủy các loại. Giá trị / trường liên quan: CANCEL, BUYER_CANCEL.
cancel_statusbodystring[]Không["CANCELLATION_REQUEST_PENDING"]Hủy trạng thái. Giá trị / trường liên quan: CANCELLATION_REQUEST_PENDING, CANCELLATION_REQUEST_SUCCESS, CANCELLATION_REQUEST_CANCEL, CANCELLATION_REQUEST_COMPLETE.
create_time_gebodyintKhông1792650000Tạo thời gian từ bao gồm. Mốc Unix giây.
create_time_ltbodyintKhông1792650000Tạo thời gian trước không gồm. Mốc Unix giây.
update_time_gebodyintKhông1792650000Cập nhật thời gian từ bao gồm. Mốc Unix giây.
update_time_ltbodyintKhông1792650000Cập nhật thời gian trước không gồm. Mốc Unix giây.
localebodystringKhôngvi-VNNgôn ngữ.

Ví dụ request

curl -s -X POST "https://partner.quantri360.com/v1/tiktok/return_refund/202602/cancellations/search?page_size=minh-hoa" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/tiktok/return_refund/202602/cancellations/search",
    params={
        "page_size": "minh-hoa"
    },
    json={},
    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/202602/cancellations/search');
for (const [k, v] of Object.entries({"page_size":"minh-hoa"})) 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({}),
});
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/202602/cancellations/search' . '?' . http_build_query(['page_size' => 'minh-hoa']);
$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, '{}');
$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ênKiểuMẫuMô tả
codeint0Mã kết quả; 0 là thành công.
messagestringSuccessThông báo kết quả; khi lỗi, đọc nội dung để xử lý.
request_idstringDEMO_REQUEST_0001Mã truy vết yêu cầu.
dataobjectDữ liệu.
cancellationsobject[]Các yêu cầu hủy.
order_idstring100000000000000001Mã đơn hàng.
cancel_typestringHủy loại. Giá trị / trường liên quan: CANCEL, BUYER_CANCEL.
cancel_statusstringHủy trạng thái. Giá trị / trường liên quan: CANCELLATION_REQUEST_PENDING, CANCELLATION_REQUEST_SUCCESS, CANCELLATION_REQUEST_CANCEL, CANCELLATION_REQUEST_COMPLETE.
rolestringVai trò. Giá trị / trường liên quan: BUYER, SELLER, OPERATOR, SYSTEM.
cancel_reasonstringHủy lý do.
cancel_reason_textstringHủy lý do nội dung.
create_timenumber1792650000Tạo thời gian. Mốc Unix giây.
update_timenumber1792650000Cập nhật thời gian. Mốc Unix giây.
seller_next_action_responseobject[]Người bán tiếp theo hành động phản hồi.
actionstringHành động. Giá trị / trường liên quan: SELLER_RESPOND_BUYER_CANCEL.
deadlineint1Hạn chót. Mốc Unix giây.
refund_amountobjectHoàn tiền số tiền.
currencystringVNDMã tiền tệ.
refund_totalstring10000Hoàn tiền tổng.
refund_subtotalstring10000Hoàn tiền tạm tính.
refund_shipping_feestring10000Hoàn tiền vận chuyển phí.
refund_taxstring10000Hoàn tiền thuế.
retail_delivery_feestring10000Bán lẻ giao hàng phí.
buyer_service_feestring10000Người mua dịch vụ phí.
cancel_line_itemsobject[]Hủy dòng các mặt hàng.
cancel_line_item_idstring100000000000000001Mã hủy dòng mặt hàng.
order_line_item_idstring100000000000000001Mã dòng hàng trong đơn.
sku_idstring100000000000000001Mã SKU.
sku_namestringMẫu minh họaSku tên.
product_imageobjectSản phẩm ảnh.
urlstringhttps://example.com/tep-minh-hoa.pdfUrl.
widthnumber1Rộng.
heightnumber1Cao.
product_namestringMẫu minh họaSản phẩm tên.
seller_skustringNgười bán sku.
refund_amountobjectHoàn tiền số tiền.
currencystringVNDMã tiền tệ.
refund_totalstring10000Hoàn tiền tổng.
refund_subtotalstring10000Hoàn tiền tạm tính.
refund_shipping_feestring10000Hoàn tiền vận chuyển phí.
refund_taxstring10000Hoàn tiền thuế.
retail_delivery_feestring10000Bán lẻ giao hàng phí.
buyer_service_feestring10000Người mua dịch vụ phí.
cancel_sub_line_itemsobject[]Hủy con dòng các mặt hàng.
cancel_sub_line_item_idstring100000000000000001Mã hủy con dòng mặt hàng.
cancel_line_item_idstring100000000000000001Mã hủy dòng mặt hàng.
sub_order_line_item_idstring100000000000000001Mã con đơn dòng mặt hàng.
order_line_item_idstring100000000000000001Mã dòng hàng trong đơn.
sku_idstring100000000000000001Mã SKU.
sku_namestringMẫu minh họaSku tên.
product_imageobjectSản phẩm ảnh.
urlstringhttps://example.com/tep-minh-hoa.pdfUrl.
widthint1Rộng.
heightint1Cao.
product_namestringMẫu minh họaSản phẩm tên.
seller_skustringNgười bán sku.
refund_amountobjectHoàn tiền số tiền.
currencystringVNDMã tiền tệ.
refund_totalstring10000Hoàn tiền tổng.
refund_subtotalstring10000Hoàn tiền tạm tính.
refund_shipping_feestring10000Hoàn tiền vận chuyển phí.
refund_taxstring10000Hoàn tiền thuế.
retail_delivery_feestring10000Bán lẻ giao hàng phí.
buyer_service_feestring10000Người mua dịch vụ phí.
cancel_idstring100000000000000001Mã yêu cầu hủy.
should_replenish_stockbooleanfalseNên bổ sung tồn kho.
total_countnumber1Tổng số kết quả khớp bộ lọc.
next_page_tokenstringMã trang tiếp theo; rỗng khi hết kết quả. Giá trị / trường liên quan: page_token.

Mẫu phản hồi

{
  "code": 0,
  "message": "Success",
  "request_id": "DEMO_REQUEST_0001",
  "data": {
    "cancellations": [
      {
        "order_id": "100000000000000001",
        "cancel_type": "",
        "cancel_status": "",
        "role": "",
        "cancel_reason": "",
        "cancel_reason_text": "",
        "create_time": 1792650000,
        "update_time": 1792650000,
        "seller_next_action_response": [
          {
            "action": "",
            "deadline": 1
          }
        ],
        "refund_amount": {
          "currency": "VND",
          "refund_total": "10000",
          "refund_subtotal": "10000",
          "refund_shipping_fee": "10000",
          "refund_tax": "10000",
          "retail_delivery_fee": "10000",
          "buyer_service_fee": "10000"
        },
        "cancel_line_items": [
          {
            "cancel_line_item_id": "100000000000000001",
            "order_line_item_id": "100000000000000001",
            "sku_id": "100000000000000001",
            "sku_name": "Mẫu minh họa",
            "product_image": {
              "url": "https://example.com/tep-minh-hoa.pdf",
              "width": 1,
              "height": 1
            },
            "product_name": "Mẫu minh họa",
            "seller_sku": "",
            "refund_amount": {
              "currency": "VND",
              "refund_total": "10000",
              "refund_subtotal": "10000",
              "refund_shipping_fee": "10000",
              "refund_tax": "10000",
              "retail_delivery_fee": "10000",
              "buyer_service_fee": "10000"
            },
            "cancel_sub_line_items": [
              {
                "cancel_sub_line_item_id": "100000000000000001",
                "cancel_line_item_id": "100000000000000001",
                "sub_order_line_item_id": "100000000000000001",
                "order_line_item_id": "100000000000000001",
                "sku_id": "100000000000000001",
                "sku_name": "Mẫu minh họa",
                "product_image": {
                  "url": "https://example.com/tep-minh-hoa.pdf",
                  "width": 1,
                  "height": 1
                },
                "product_name": "Mẫu minh họa",
                "seller_sku": "",
                "refund_amount": {
                  "currency": "VND",
                  "refund_total": "10000",
                  "refund_subtotal": "10000",
                  "refund_shipping_fee": "10000",
                  "refund_tax": "10000",
                  "retail_delivery_fee": "10000",
                  "buyer_service_fee": "10000"
                }
              }
            ]
          }
        ],
        "cancel_id": "100000000000000001",
        "should_replenish_stock": false
      }
    ],
    "total_count": 1,
    "next_page_token": ""
  }
}

Bắt đầu dùng

  1. Đăng ký tài khoản Partner
  2. Mở loại dữ liệu thuộc nhóm Đơn hàng ở trang nền tảng
  3. Tạo API key (tick kênh TikTok Shop)
  4. Gọi theo ví dụ ở trên