VI | EN
Message us on Messenger
Developer resources

Update Target Collaboration — TikTok Shop API

tiktok.affiliate_seller.202508.target_collaborations.target_collaboration_id · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

tiktok.affiliate_seller.202508.target_collaborations.target_collaboration_id

PUT/affiliate_seller/202508/target_collaborations/{target_collaboration_id}Via 360: PUT https://partner.quantri360.com/v1/tiktok/affiliate_seller/202508/target_collaborations/{target_collaboration_id}
Write endpoint — changes data on TikTok Shop. The key must be created with "Allow write API calls" ticked, otherwise you get 403 write_not_allowed. Every call is logged.
Description

Sửa một hợp tác mục tiêu loại STANDARD: đổi tên, ngày kết thúc, danh sách sản phẩm + hoa hồng, danh sách creator, liên hệ, chính sách mẫu. Gửi TOÀN BỘ trạng thái mong muốn (sản phẩm / creator không có trong danh sách sẽ bị gỡ).

  • Gọi qua /v1/tiktok/affiliate_seller/202508/target_collaborations/{target_collaboration_id} 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.
  • Là API GHI — thay đổi dữ liệu thật trên TikTok Shop; key cần quyền ghi.
  • code = 0 vẫn có thể cập nhật không trọn — luôn kiểm update_failed và target_collaboration_conflicts.
  • TĂNG hoa hồng có hiệu lực ngay; GIẢM hoa hồng (hoặc gỡ sản phẩm) mà creator đã thêm sản phẩm vào showcase thì hiệu lực từ 00:00 hôm sau, chưa thêm thì ngay.
  • Chỉ sửa được hợp tác loại STANDARD.
  • 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 affiliate. Sửa sản phẩm, creator và điều kiện hợp tác mục tiêu.
  • HTTP 200 vẫn có thể có lỗi nghiệp vụ; kiểm code trước khi dùng kết quả.

Request

Endpoint

PUT https://partner.quantri360.com/v1/tiktok/affiliate_seller/202508/target_collaborations/{target_collaboration_id}

Authentication & shop

NameInTypeSampleDescription
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.

Request parameters

NameInTypeRequiredSampleDescription
target_collaboration_idpathstringYes7642000000000000001Mã hợp tác.
namebodystringYesCửa hàng mẫuTên.
end_timebodystringYes1795000000Kết thúc lúc (Unix giây, dạng chuỗi).
productsbodyobject[]Yes[{"id":"1735000000000000001","commission_rate":1000}]Tối đa 100. Mỗi phần tử: id, commission_rate (bắt buộc, 1/100 %, khoảng 100–8000), target_ad_commission_rate (tỉ lệ cho đơn từ quảng cáo). Lưu ý tên trường KHÁC API tạo (target_commission_rate / shop_ads_commission_rate).
creator_user_open_idsbodystring[]Yes["Ab1CdAAAAAA2xYza…"]Tối đa 50 creator.
seller_contact_infobodyobjectYes{"email":"cskh@example.com"}Liên hệ; email bắt buộc trong object.
free_sample_rulebodyobjectYes{"has_free_sample":false,"is_sample_approval_exempt":false}Như API tạo.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok/affiliate_seller/202508/target_collaborations/7642000000000000001?platform_shop_id=7494000000000000000" \
  -H "Authorization: Bearer $KEY"
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.get(
    "https://partner.quantri360.com/v1/tiktok/affiliate_seller/202508/target_collaborations/7642000000000000001",
    params={
        "platform_shop_id": "7494000000000000000"
    },
    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/202508/target_collaborations/7642000000000000001');
for (const [k, v] of Object.entries({"platform_shop_id":"7494000000000000000"})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'PUT',
  headers: { Authorization: `Bearer ${KEY}` },
});
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/202508/target_collaborations/7642000000000000001' . '?' . http_build_query(['platform_shop_id' => '7494000000000000000']);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
$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)

NameTypeSampleDescription
codeint00 = thành công; khác 0 xem message (105001–105003 = token, 360 đã tự làm mới một lần).
messagestringSuccessThông điệp của TikTok.
request_idstring2025101900000000000000000000Mã request TikTok.
dataobjectDữ liệu.
target_collaboration_conflictsobject[]Cặp creator × sản phẩm xung đột: [{creator_user_open_id, product_id}].
update_failedobjectPhần KHÔNG cập nhật được.
add_creator_open_idsstring[]Creator thêm không được.
remove_creator_open_idsstring[]Creator gỡ không được.
add_productsobject{id, commission_rate} thêm không được.
remove_product_idsstring[]
change_commissionsobject{product_id, commission_rate} đổi không được.
namestring
end_timeint
seller_contact_infoobject
invalid_product_id_liststring[]
invalid_open_id_liststring[]

Response sample

{
  "code": 0,
  "message": "Success",
  "request_id": "202203070749000101…",
  "data": {
    "target_collaboration_conflicts": [],
    "update_failed": {
      "add_creator_open_ids": [],
      "remove_creator_open_ids": [],
      "remove_product_ids": [],
      "invalid_product_id_list": [],
      "invalid_open_id_list": []
    }
  }
}

Get started

  1. Sign up for Partner
  2. Enable a data type of the Affiliate group on the platform page
  3. Create an API key (tick the TikTok Shop channel)
  4. Call it as in the examples above