VI | EN
Message us on Messenger
Developer resources

Upload Shoppable Video File — TikTok Shop API

tiktok.affiliate_creator.202505.videos.video_files · 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_creator.202505.videos.video_files

POST/affiliate_creator/202505/videos/video_filesVia 360: POST https://partner.quantri360.com/v1/tiktok/affiliate_creator/202505/videos/video_files
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

DÀNH CHO CREATOR: Tải tệp video trước khi đăng video có gắn sản phẩm; lấy video_file.id làm video_info.file_id khi gửi yêu cầu đăng.

  • HIỆN CHƯA GỌI ĐƯỢC QUA 360: API này dùng kết nối của creator / đối tác, kết nối gian hàng trả code 36009005. Cần dùng → liên hệ 360.
  • 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. Tải tệp video trước khi đăng video có gắn sản phẩm; lấy video_file.id làm video_info.file_id khi gửi yêu cầu đăng.
  • HTTP 200 vẫn có thể có lỗi nghiệp vụ; kiểm code trước khi dùng kết quả.
  • Tham số data là tệp. 360 hiện chưa hỗ trợ nhận multipart cho API này; mẫu tải tệp minh họa định dạng, cần liên hệ 360 trước khi dùng.

Request

Endpoint

POST https://partner.quantri360.com/v1/tiktok/affiliate_creator/202505/videos/video_files

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
databodyfileYes/duong-dan/anh-minh-hoa.pngTệp video MP4, MOV, MKV, WMV, WEBM, AVI, 3GP, FLV hoặc MPEG; tối đa 10 MB, tỷ lệ 9:16 đến 16:9. Tệp lớn hơn 10 MB cần luồng tải tệp lớn. Khuyến nghị độ phân giải từ 720p, dài hơn 30 giây.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/tiktok/affiliate_creator/202505/videos/video_files" \
  -H "Authorization: Bearer $KEY" \
  -F "data=@/duong-dan/video-minh-hoa.mp4"
Python
import requests
from contextlib import ExitStack

KEY = "q360_live_..."
with ExitStack() as stack:
    files = [("data", stack.enter_context(open("/duong-dan/video-minh-hoa.mp4", "rb")))]
    r = requests.post("https://partner.quantri360.com/v1/tiktok/affiliate_creator/202505/videos/video_files", params={}, data={}, files=files, headers={"Authorization": f"Bearer {KEY}"}, timeout=60)
    print(r.status_code, r.json())
Node.js
import { readFile } from 'node:fs/promises';
const KEY = 'q360_live_...';
const url = new URL('https://partner.quantri360.com/v1/tiktok/affiliate_creator/202505/videos/video_files');
const form = new FormData();
form.append("data", new Blob([await readFile("/duong-dan/video-minh-hoa.mp4")]), "/duong-dan/video-minh-hoa.mp4");
const r = await fetch(url, { method: 'POST', headers: { Authorization: `Bearer ${KEY}` }, body: form });
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...';
$ch = curl_init('https://partner.quantri360.com/v1/tiktok/affiliate_creator/202505/videos/video_files');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['data' => new CURLFile('/duong-dan/video-minh-hoa.mp4')]);
echo curl_exec($ch);
curl_close($ch);

Response

Response fields (as returned by TikTok Shop)

NameTypeSampleDescription
codeint0Mã kết quả; 0 là thành công.
messagestringSuccessThông báo kết quả.
request_idstringDEMO_AFFILIATE_REQUESTMã truy vết yêu cầu.
dataobjectDữ liệu phản hồi.
video_fileobjectVideo tệp.
idstring100000000000000101Mã định danh. Giá trị bổ sung: SUCCEEDED, GET.
md5stringMinh họaMd5.

Response sample

{
  "code": 0,
  "message": "Success",
  "request_id": "DEMO_AFFILIATE_REQUEST",
  "data": {
    "video_file": {
      "id": "100000000000000101",
      "md5": "Minh họa"
    }
  }
}

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