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

Ship Package — API TikTok Shop

tiktok.fulfillment.202309.packages.package_id.ship · 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.202309.packages.package_id.ship

POST/fulfillment/202309/packages/{package_id}/shipGọi qua 360: POST https://partner.quantri360.com/v1/tiktok/fulfillment/202309/packages/{package_id}/ship
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

Xác nhận gửi một kiện hàng.

  • Gọi qua /v1/tiktok/fulfillment/202309/packages/{package_id}/ship 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. Xác nhận gửi một kiện hàng.
  • 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/202309/packages/{package_id}/ship

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ả
package_idpathstringCó100000000000000001Mã kiện hàng.
handover_methodbodystringKhôngPICKUPBàn giao phương thức. Giá trị / trường liên quan: PICKUP, DROP_OFF.
pickup_slotbodyobjectKhôngLấy hàng khung giờ.
pickup_slot.start_timebodyintKhông1792650000Bắt đầu thời gian. Mốc Unix giây.
pickup_slot.end_timebodyintKhông1792650000Kết thúc thời gian. Mốc Unix giây.
self_shipmentbodyobjectKhôngTự vận chuyển. Giá trị / trường liên quan: delivery_option, shipping_provider_id, tracking_number.
self_shipment.tracking_numberbodystringCóJX12345Mã vận đơn. Giá trị / trường liên quan: SEND_BY_SELLER, delivery_option, tracking_number.
self_shipment.shipping_provider_idbodystringCó100000000000000001Mã đơn vị vận chuyển. Giá trị / trường liên quan: SEND_BY_SELLER, delivery_option, shipping_provider_id.

Ví dụ request

curl -s -X POST "https://partner.quantri360.com/v1/tiktok/fulfillment/202309/packages/100000000000000001/ship" \
  -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/202309/packages/100000000000000001/ship",
    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/202309/packages/100000000000000001/ship');
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/202309/packages/100000000000000001/ship' . '?' . 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.

Mẫu phản hồi

{
  "code": 0,
  "message": "Success",
  "request_id": "DEMO_REQUEST_0001",
  "data": {}
}

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. 21011001 Package not found. If the error persists, please contact the platform for assistance. 21011003 fulfill_unit action not allowed 21011007 Package item has after-sale request, please process the after-sale request first. 21011008 Package is not complete. If the error persists, please contact the platform for assistance. 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 21011027 Package has already been delivered. 21011028 The package does not belong to the current shop. Please ensure you are providing the correct package ID and/or shop cipher. 21011030 fulfillment not allow update tracking no 21011040 Package has already been shipped. 21011041 Cannot complete the operation when order is cancelled. 21011050 The tracking number can only be updated within a certain number of hours. 21011051 The tracking number can only be updated once. 21011053 Fail to ship package because the shipment time is outside of the pick-up time slot. 21011054 No available shipping services for this request due to missing pick-up time slot. Please contact customer service for assistance. 21014009 Failed to ship. You may cancel the order without penalty by selecting the following reason: Unable to deliver to buyer address. 21021010 Failed to ship. You may cancel the order without penalty by selecting the following reason: Unable to deliver to buyer address. 21022029 System process error, please try again later. 21022032 match provider failed. 21034012 tracking no has been used 21042001 System process error, please try again later. 21042067 The logistics service provider couldn't process your order. 21042076 System process error, please try again later. 21042227 For pop 4pl(cross-border),the return warehouse for the shipping location has not been configured. 21042251 Abnormal order status, item cannot be shipped.

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