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 = 0vẫn có thể cập nhật không trọn — luôn kiểmupdate_failedvà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
| Name | In | Type | Sample | Description |
|---|---|---|---|---|
| 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. |
Request parameters
| Name | In | Type | Required | Sample | Description |
|---|---|---|---|---|---|
| target_collaboration_id | path | string | Yes | 7642000000000000001 | Mã hợp tác. |
| name | body | string | Yes | Cửa hàng mẫu | Tên. |
| end_time | body | string | Yes | 1795000000 | Kết thúc lúc (Unix giây, dạng chuỗi). |
| products | body | object[] | 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_ids | body | string[] | Yes | ["Ab1CdAAAAAA2xYza…"] | Tối đa 50 creator. |
| seller_contact_info | body | object | Yes | {"email":"cskh@example.com"} | Liên hệ; email bắt buộc trong object. |
| free_sample_rule | body | object | Yes | {"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)
| Name | Type | Sample | Description |
|---|---|---|---|
| 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 | 2025101900000000000000000000 | Mã request TikTok. |
| data | object | Dữ liệu. | |
| target_collaboration_conflicts | object[] | Cặp creator × sản phẩm xung đột: [{creator_user_open_id, product_id}]. | |
| update_failed | object | Phần KHÔNG cập nhật được. | |
| add_creator_open_ids | string[] | Creator thêm không được. | |
| remove_creator_open_ids | string[] | Creator gỡ không được. | |
| add_products | object | {id, commission_rate} thêm không được. | |
| remove_product_ids | string[] | ||
| change_commissions | object | {product_id, commission_rate} đổi không được. | |
| name | string | ||
| end_time | int | ||
| seller_contact_info | object | ||
| invalid_product_id_list | string[] | ||
| invalid_open_id_list | string[] |
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
- Sign up for Partner
- Enable a data type of the Affiliate group on the platform page
- Create an API key (tick the TikTok Shop channel)
- Call it as in the examples above