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

Mark Package As Shipped — API TikTok Shop

tiktok.fulfillment.202610.orders.order_id.packages · 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.fulfillment.202610.orders.order_id.packages

POST/fulfillment/202610/orders/{order_id}/packagesGọi qua 360: POST https://partner.quantri360.com/v1/tiktok/fulfillment/202610/orders/{order_id}/packages
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

Đánh dấu kiện của đơn đã gửi.

  • Gọi qua /v1/tiktok/fulfillment/202610/orders/{order_id}/packages 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. Đánh dấu kiện của đơn đã gửi.
  • 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/202610/orders/{order_id}/packages

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ả
order_idpathstringCó100000000000000001Mã đơn hàng.
order_line_listbodyobject[]KhôngĐơn dòng danh sách.
order_line_list[].order_line_idbodystringKhông100000000000000001Mã dòng hàng.
order_line_list[].sub_item_idbodystringKhông100000000000000001Mã con mặt hàng. Bắt buộc với sản phẩm dạng gói; không bắt buộc với sản phẩm thường.
shipping_info_listbodyobject[]KhôngVận chuyển thông tin danh sách.
shipping_info_list[].tracking_numberbodystringKhôngVNDEMO0001Mã vận đơn.
shipping_info_list[].shipping_provider_idbodystringKhông100000000000000001Mã đơn vị vận chuyển.
shipping_info_list[].notebodystringKhôngminh-hoaGhi chú.

Ví dụ request

curl -s -X POST "https://partner.quantri360.com/v1/tiktok/fulfillment/202610/orders/100000000000000001/packages" \
  -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/fulfillment/202610/orders/100000000000000001/packages",
    params={},
    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/fulfillment/202610/orders/100000000000000001/packages');
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({}),
});
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/202610/orders/100000000000000001/packages' . '?' . 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, '{}');
$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.
order_idstring100000000000000001Mã đơn hàng.
order_line_item_idsstring[]Các mã đơn dòng mặt hàng.
package_idstring100000000000000001Mã kiện hàng.
warningobjectCảnh báo.
messagestringSuccessThông báo kết quả; khi lỗi, đọc nội dung để xử lý.

Mẫu phản hồi

{
  "code": 0,
  "message": "Success",
  "request_id": "DEMO_REQUEST_0001",
  "data": {
    "order_id": "100000000000000001",
    "order_line_item_ids": [
      "100000000000000001"
    ],
    "package_id": "100000000000000001",
    "warning": {
      "message": "Success"
    }
  }
}

Mã lỗi của TikTok Shop (1)

Bấm để xem
MãÝ nghĩa
SellerFulfillUnitInReverseCannotOperate21008099 Package has been shipped. Please not ship the package again. 21008106 This interface cannot be used in this region. 21008300 System process error, please try again later. 21011001 Package not found. If the error persists, please contact the platform for assistance. 21011003 fulfill_unit action not allowed 21011004 This API cannot be used to update package shipping information for packages that are not shipped by sellers. 21011006 These orders are already shipped. 21011007 Package item has after-sale request, please process the after-sale request first. 21011012 not match trade rule 21011013 not match logistics rule 21011020 These orders are already shipped. 21011022 Invalid tracking number or provider ID. Please double check and try again. 21011025 Duplicate tracking number. 21011026 fulfillment tracking no used times over limit 21011029 order does not belong to fulfill unit 21011030 fulfillment not allow update tracking no 21011033 order already combined 21011036 split same sku in Multi Package not allow. 21011046 Order has combine, not allow split order 21011048 There are multiple packages that can be shipped, please specify the order line that needs to be shipped. 21011050 The tracking number can only be updated within a certain number of hours. 21011051 The tracking number can only be updated once. 21021010 Failed to ship. You may cancel the order without penalty by selecting the following reason: Unable to deliver to buyer address. 21022025 A shipping label has already been purchased. 21022026 Cannot purchase shipping label, please try again later. 21022028 split pkg fail. 21022029 System process error, please try again later. 21022030 System process error, please try again later. 21032001 fulfill unit status not allow to update pkg attr 21034006 decision route occurs error 21034012 tracking no has been used 21042056 These orders are already shipped. 21042057 These orders are not in the Awaiting shipment status. Couldn't create labels for them.

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