tiktok.fbt.202607.goods.create_goods
POST/fbt/202607/goods/create_goodsGọi qua 360: POST https://partner.quantri360.com/v1/tiktok/fbt/202607/goods/create_goods
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
KHO TIKTOK (FBT): Tạo bản ghi hàng hóa FBT và liên kết từng bản ghi với một SKU TikTok Shop.
- HIỆN CHƯA GỌI ĐƯỢC QUA 360: ứng dụng 360 chưa được cấp quyền cho nhóm API kho TikTok (FBT). 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 Đơn hàng. Tạo hàng hóa và liên kết với SKU.
- HTTP 200 vẫn có thể có lỗi nghiệp vụ; kiểm code trước khi dùng kết quả.
- Lỗi cấp yêu cầu có thể xảy ra trước khi có kết quả từng hàng. Nếu có create_result_info.create_result_list, đối chiếu theo tts_sku_id, kiểm is_success từng hàng; lỗi đọc fail_reason, thành công dùng tts_goods_id.
Request
Địa chỉ
POST https://partner.quantri360.com/v1/tiktok/fbt/202607/goods/create_goods
Xác thực & gian hàng
| Tên | Vị trí | Kiểu | Mẫu | Mô tả |
|---|---|---|---|---|
| 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. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| create_goods_dto_list | body | object[] | Có | Các bản ghi hàng hóa cần tạo. | |
| create_goods_dto_list[].tts_sku_id | body | string | Có | 100000000000000101 | Mã SKU TikTok Shop. |
| create_goods_dto_list[].create_goods_type | body | string | Có | CREATE_AND_BIND | Loại thao tác tạo và liên kết, hiện chỉ CREATE_AND_BIND. |
| create_goods_dto_list[].goods_name | body | string | Có | Hộp đựng minh họa | Tên hàng hóa, tối đa 255 ký tự. |
| create_goods_dto_list[].goods_image_url | body | string | Có | https://example.com/minh-hoa/anh.png | Đường dẫn ảnh hàng hóa. |
| create_goods_dto_list[].reference_code | body | string | Không | HANG-MAU-01 | Mã tham chiếu hàng hóa do người bán đặt. |
| create_goods_dto_list[].barcode_infos | body | object[] | Không | Mỗi hàng tối đa một mã trong nhóm UPC/EAN/GTIN, năm mã ASIN_OR_FNSKU và năm mã MERCHANT_SKU_ID. | |
| create_goods_dto_list[].barcode_infos[].barcode_type | body | string | Không | MERCHANT_SKU_ID | Loại mã vạch. |
| create_goods_dto_list[].barcode_infos[].barcode_value | body | string | Không | SKU-MAU-01 | UPC 8/12 chữ số, EAN 8/13, GTIN 8/12/13/14 và phải đúng số kiểm tra; ASIN_OR_FNSKU gồm 10 chữ hoa hoặc số, bắt đầu B/X; MERCHANT_SKU_ID 1–32 ký tự ASCII in được, không khoảng trắng. |
| create_goods_dto_list[].return_handling_method | body | string | Có | RESTOCK_SELLABLE_DISPOSE_UNSELLABLE | Cách xử lý hàng trả; mặc định nhập lại hàng bán được, tiêu hủy hàng không bán được; giá trị: COLLECT_RETURN_UNITS, RESTOCK_SELLABLE_COLLECT_UNSELLABLE, RESTOCK_SELLABLE_DISPOSE_UNSELLABLE, DISPOSAL_WITHOUT_INSPECTION, RETURN_WITHOUT_INSPECTION, RESTOCK_SELLABLE_RETURN_UNSELLABLE. |
| create_goods_dto_list[].dimension_and_weight_base_info | body | object | Có | Kích thước và khối lượng; các giá trị là chuỗi số lớn hơn 0. | |
| create_goods_dto_list[].dimension_and_weight_base_info.weight_value | body | string | Có | 350 | Khối lượng theo weight_unit. |
| create_goods_dto_list[].dimension_and_weight_base_info.length_value | body | string | Có | 25 | Chiều dài theo dimension_unit. |
| create_goods_dto_list[].dimension_and_weight_base_info.width_value | body | string | Có | 15 | Chiều rộng theo dimension_unit. |
| create_goods_dto_list[].dimension_and_weight_base_info.height_value | body | string | Có | 10 | Chiều cao theo dimension_unit. |
| create_goods_dto_list[].dimension_and_weight_base_info.weight_unit | body | string | Có | GRAM | Đơn vị khối lượng; giá trị: MILLIGRAM, GRAM, KILOGRAM, POUND, OUNCE. |
| create_goods_dto_list[].dimension_and_weight_base_info.dimension_unit | body | string | Có | CENTIMETER | Đơn vị kích thước; giá trị: MILLIMETER, CENTIMETER, METER, FOOT, INCH. |
| create_goods_dto_list[].is_hazmat | body | bool | Có | false | Có phải hàng nguy hiểm; true cần khai thông tin nguy hiểm. |
| create_goods_dto_list[].hazmat_info | body | object | Không | Thông tin hàng nguy hiểm; có khi is_hazmat = true; BATTERY dùng battery_extra_info, FLAMMABLE_LIQUID dùng flammable_liquids_extra_info, AEROSOLS dùng aerosol_extra_info. | |
| create_goods_dto_list[].hazmat_info.hazmat_type | body | string | Có | MAGNETIZED | Loại hàng nguy hiểm; giá trị: MAGNETIZED, BATTERY, FLAMMABLE_LIQUID, AEROSOLS. |
| create_goods_dto_list[].hazmat_info.battery_extra_info | body | object | Không | Thông tin pin; bắt buộc khi loại BATTERY, khối lượng phải lớn hơn 0; STANDALONE cần số pin mỗi kiện lớn hơn 0. | |
| create_goods_dto_list[].hazmat_info.battery_extra_info.battery_type | body | string | Có | LITHIUM_ION | Loại pin; giá trị: LITHIUM_ION, LITHIUM_METAL, OTHER. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.battery_packaging_type | body | string | Có | STANDALONE | Cách đóng gói pin; giá trị: STANDALONE, IN_EQUIPMENT, WITH_EQUIPMENT, OTHER. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.total_battery_weight | body | string | Có | 50 | Tổng khối lượng pin theo total_battery_weight_unit. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.total_battery_weight_unit | body | string | Có | GRAM | Đơn vị tổng khối lượng pin. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.total_battery_capacity | body | string | Có | 10 | Tổng năng lượng pin theo total_battery_capacity_unit. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.total_battery_capacity_unit | body | string | Có | WATTHOUR | Đơn vị năng lượng pin. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.is_need_un_38_3_test | body | bool | Có | false | Có cần kiểm định UN38.3; gửi báo cáo nếu chưa có trong MSDS. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.un_38_3_test_file_url | body | string | Không | https://example.com/minh-hoa/tep.pdf | Đường dẫn báo cáo kiểm định UN38.3. |
| create_goods_dto_list[].hazmat_info.battery_extra_info.battery_count_per_package | body | string | Không | 1 | Số pin trong mỗi kiện. |
| create_goods_dto_list[].hazmat_info.flammable_liquids_extra_info | body | object | Không | Thông tin chất lỏng dễ cháy; bắt buộc với FLAMMABLE_LIQUID, thể tích phải lớn hơn 0. | |
| create_goods_dto_list[].hazmat_info.flammable_liquids_extra_info.flammable_liquids_type | body | string | Có | PAINT | Loại chất lỏng dễ cháy; giá trị: PAINT, PERFUMERY, ALCOHOLIC, OTHER. |
| create_goods_dto_list[].hazmat_info.flammable_liquids_extra_info.flammable_liquids_volume | body | string | Có | 100 | Thể tích chất lỏng dễ cháy theo volume_unit. |
| create_goods_dto_list[].hazmat_info.flammable_liquids_extra_info.volume_unit | body | string | Không | MILLILITERS | Đơn vị thể tích. |
| create_goods_dto_list[].hazmat_info.dg_class | body | string | Có | CLASS_2 | Nhóm hàng nguy hiểm; giá trị: CLASS_2, CLASS_3, CLASS_9. |
| create_goods_dto_list[].hazmat_info.dg_uncode | body | string | Có | UN2807 | Mã chất nguy hiểm, dạng UN và bốn chữ số hoặc OTHER; giá trị: UN2807, UN3480, UN3090, UN3481, UN3091, UN1263, UN1266, UN3065, OTHER. |
| create_goods_dto_list[].hazmat_info.msds_file_url | body | string | Có | https://example.com/minh-hoa/tep.pdf | Đường dẫn phiếu an toàn hóa chất để duyệt hàng nguy hiểm FBT. |
| create_goods_dto_list[].hazmat_info.aerosol_extra_info | body | object | Không | Thông tin bình xịt; bắt buộc với AEROSOLS, volume phải lớn hơn 0. | |
| create_goods_dto_list[].hazmat_info.aerosol_extra_info.volume | body | string | Không | 100 | Thể tích. |
| create_goods_dto_list[].hazmat_info.aerosol_extra_info.volume_unit | body | string | Không | MILLILITERS | Đơn vị thể tích. |
| create_goods_dto_list[].is_lot_code | body | bool | Có | false | Có quản lý mã lô theo quy tắc ngành hàng FBT. |
| create_goods_dto_list[].is_expiration_management | body | bool | Có | false | Có quản lý hạn dùng; true cần thông tin hạn dùng. |
| create_goods_dto_list[].shelf_life_attribute_info | body | object | Không | Thông tin hạn dùng; khi tạo phải có nếu quản lý hạn dùng; các ngưỡng không âm và sales_cutoff_days < expiration_alert_days < inbound_cutoff_days; shelf_life nếu gửi phải dưới 3650 ngày. | |
| create_goods_dto_list[].shelf_life_attribute_info.shelf_life | body | int | Không | 365 | Hạn sử dụng tính bằng ngày. |
| create_goods_dto_list[].shelf_life_attribute_info.inbound_cutoff_days | body | int | Có | 90 | Số ngày trước hạn dùng mà kho ngừng nhận hàng. |
| create_goods_dto_list[].shelf_life_attribute_info.expiration_alert_days | body | int | Có | 60 | Số ngày trước hạn dùng để gửi cảnh báo. |
| create_goods_dto_list[].shelf_life_attribute_info.sales_cutoff_days | body | int | Có | 30 | Số ngày trước hạn dùng mà hàng ngừng bán. |
| create_goods_dto_list[].shelf_life_attribute_info.handling_method_expired_goods | body | string | Không | STORE_UNITS | Xử lý hàng hết hạn: STORE_UNITS chuyển tồn lỗi; RETURN_TO_SELLER trả người bán; DISPOSE tiêu hủy; giá trị: STORE_UNITS, RETURN_TO_SELLER, DISPOSE. |
| create_goods_dto_list[].is_sioc | body | bool | Không | false | Hàng được giao trong bao bì riêng SIOC. |
| create_goods_dto_list[].sioc_attribute | body | object | Không | Thông tin SIOC. | |
| create_goods_dto_list[].sioc_attribute.sioc_files | body | object[] | Không | Các tệp chứng minh SIOC. | |
| create_goods_dto_list[].sioc_attribute.sioc_files[].sioc_certification_url | body | string | Không | https://example.com/minh-hoa/tep.pdf | Đường dẫn tệp chứng nhận SIOC. |
| create_goods_dto_list[].sioc_attribute.sioc_files[].sioc_file_type | body | string | Không | DOCUMENT | Loại tệp SIOC: PHOTO ảnh, DOCUMENT tài liệu, DROP_TEST_VIDEO video thử rơi. |
| create_goods_dto_list[].bulky_item_attribute | body | object | Không | Thuộc tính hàng cồng kềnh. | |
| create_goods_dto_list[].bulky_item_attribute.is_bulky_item_accessories | body | bool | Không | false | Có phải phụ kiện hàng cồng kềnh. |
| create_goods_dto_list[].goods_safety_attributes | body | object | Không | Thuộc tính an toàn hàng hóa. | |
| create_goods_dto_list[].goods_safety_attributes.is_fragile | body | bool | Không | false | Hàng dễ vỡ. |
| create_goods_dto_list[].goods_safety_attributes.is_liquid | body | bool | Không | false | Hàng dạng lỏng. |
| create_goods_dto_list[].goods_safety_attributes.is_sharp | body | bool | Không | false | Hàng sắc nhọn. |
Ví dụ request
curl -s -X POST "https://partner.quantri360.com/v1/tiktok/fbt/202607/goods/create_goods" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"create_goods_dto_list":[{"tts_sku_id":"100000000000000101","create_goods_type":"CREATE_AND_BIND","goods_name":"Hộp đựng minh họa","goods_image_url":"https://example.com/minh-hoa/anh.png","return_handling_method":"RESTOCK_SELLABLE_DISPOSE_UNSELLABLE","dimension_and_weight_base_info":{"weight_value":"350","length_value":"25","width_value":"15","height_value":"10","weight_unit":"GRAM","dimension_unit":"CENTIMETER"},"is_hazmat":false,"is_lot_code":false,"is_expiration_management":false}]}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/tiktok/fbt/202607/goods/create_goods",
params={},
json={
"create_goods_dto_list": [
{
"tts_sku_id": "100000000000000101",
"create_goods_type": "CREATE_AND_BIND",
"goods_name": "Hộp đựng minh họa",
"goods_image_url": "https://example.com/minh-hoa/anh.png",
"return_handling_method": "RESTOCK_SELLABLE_DISPOSE_UNSELLABLE",
"dimension_and_weight_base_info": {
"weight_value": "350",
"length_value": "25",
"width_value": "15",
"height_value": "10",
"weight_unit": "GRAM",
"dimension_unit": "CENTIMETER"
},
"is_hazmat": False,
"is_lot_code": False,
"is_expiration_management": False
}
]
},
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/fbt/202607/goods/create_goods');
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({"create_goods_dto_list":[{"tts_sku_id":"100000000000000101","create_goods_type":"CREATE_AND_BIND","goods_name":"Hộp đựng minh họa","goods_image_url":"https://example.com/minh-hoa/anh.png","return_handling_method":"RESTOCK_SELLABLE_DISPOSE_UNSELLABLE","dimension_and_weight_base_info":{"weight_value":"350","length_value":"25","width_value":"15","height_value":"10","weight_unit":"GRAM","dimension_unit":"CENTIMETER"},"is_hazmat":false,"is_lot_code":false,"is_expiration_management":false}]}),
});
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/fbt/202607/goods/create_goods' . '?' . 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, '{"create_goods_dto_list":[{"tts_sku_id":"100000000000000101","create_goods_type":"CREATE_AND_BIND","goods_name":"Hộp đựng minh họa","goods_image_url":"https://example.com/minh-hoa/anh.png","return_handling_method":"RESTOCK_SELLABLE_DISPOSE_UNSELLABLE","dimension_and_weight_base_info":{"weight_value":"350","length_value":"25","width_value":"15","height_value":"10","weight_unit":"GRAM","dimension_unit":"CENTIMETER"},"is_hazmat":false,"is_lot_code":false,"is_expiration_management":false}]}');
$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ên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| code | int | 0 | Mã kết quả; 0 là thành công. |
| message | string | Success | Thông báo kết quả. |
| request_id | string | DEMO_REQUEST_FBT_01 | Mã truy vết yêu cầu. |
| data | object | Dữ liệu phản hồi. | |
| create_result_info | object | Kết quả tạo hàng hóa. | |
| create_result_list | object[] | Kết quả từng hàng; đối chiếu tts_sku_id, kiểm is_success, fail_reason; thành công dùng tts_goods_id. | |
| tts_sku_id | string | 100000000000000101 | Mã SKU TikTok Shop. |
| is_success | bool | true | Thao tác với phần tử này thành công hay không. |
| tts_goods_id | string | 100000000000000101 | Mã hàng hóa FBT. |
| fail_reason | string | Lý do thao tác thất bại. |
Mẫu phản hồi
{
"code": 0,
"message": "Success",
"request_id": "DEMO_REQUEST_FBT_01",
"data": {
"create_result_info": {
"create_result_list": [
{
"tts_sku_id": "100000000000000101",
"is_success": true,
"tts_goods_id": "100000000000000101",
"fail_reason": ""
}
]
}
}
}
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Đơn hàng ở trang nền tảng
- Tạo API key (tick kênh TikTok Shop)
- Gọi theo ví dụ ở trên