商品管理 - 印度尼西亚商家
分页和错误对象
分页对象
字段 | 类型 | 说明 | 是否必填 |
page_size | int64 | 页数, 从以下值开始 1, 最大值: 20 | 否 |
page_no | int64 | 页数, 从以下值开始 1 | 是 |
NextPagination 对象
字段 | 类型 | 说明 | 是否必填 |
current_page_sizegroup | int64 | 当前分页大小(每页条数) | 否 |
total | int64 | 总数 | 是 |
has_more | bool | 是否包含更多内容 | 是 |
ErrorStruct 对象
字段 | 类型 | 说明 | 是否必填 |
code | string | 状态码;非“0”表示发生异常。 | 是 |
message | string | 状态说明 | 是 |
logid | string | 日志 ID,用于问题排查 | 是 |
http_status_code | string | 状态码
| 是 |
更新/创建商品
完成商家入驻和门店匹配后上传商品。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/save/
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
third_product_id | string | 第三方商品 ID | 是 |
category_id | string | 商品类目,通过查询商品类目接口获得。 | 是 |
product_type | ProductType | 商品类型枚举;第一阶段仅支持团购券。
| 是 |
attr_key_value_map | map<string,string> | 商品详情;第一期仅支持团购券类型。
| 是 |
language | string | 语言 | 是 |
团购券属性
字段 | 类型 | 说明 | 示例 | 是否必填 |
mininum_purchase_num | int | 购买单位数量必须大于最小购买数量。 | "1" | 否 |
rec_person_num | int | 建议使用人数 | "5" | 是 |
rec_person_num_max | int | 最大使用人数 | "20" | 否 |
shop_id | LIST<string> | 与商品关联的线下门店 | "[\"222\"]" | 是 |
commodity_set | int | 商品原价的设置方式
| "2" | 是 |
commodity | ItemGroupStruct | 商品组合 (参阅“商品组合”章节) | "[{\"i18n_group_mame\":{\"default_text\":\"group name 1\"},\"total_count\":2,\"option_count\":\"2\",\"item_list\":[{\"i18n_name\":{\"default_text\":\"kfc\"},\"price\":\"200\",\"currency\":\"th\",\"count\":1},{\"i18n_name\":{\"default_text\":\"kfc\"},\"price\":\"300\",\"currency\":\"th\",\"count\":2}],\"allow_repeated_item\":true}]" | 是 |
product_name | I18nText | 商品名称 (参阅“商品名称”章节) | "{\"DefaultText\":\"product name\",\"translations\":{\"en\":\"product name-en\",\"id\":\"product name-id\"}}"
| 是 |
image_list | ImageStruct | 套餐方案 (参阅“套餐方案”章节) | "[{\"outer_url\":\"http://p5.itc.cn/images03/20200519/d6c0794d068e4967a8b16a16416413f7.jpeg\"}]"
| 是 |
origin_amount | int | 总价 | "3000" | 是 |
actual_amount | int | 客户实际需要支付的金额 | "2000" | 是 |
local_currency | int | 价格对应的币种 | "THB" | 是 |
stock_info | StockInfoStruct | 库存 (参阅“库存”章节) | "{\"stock_num\":1000,\"stock_qty_limit_type\":1}" | 是 |
sold_start_time | int | 商品开售时间
| "1720666722000" | 否 |
sold_end_time | int | 此字段仅影响商品展示,不影响商品状态。 商品停售时间
| "1752202732000" | 否 |
sold_time_type | int | 商品销售时间类型
| "1" | 是 |
use_type | int | 团购使用方式
| "1" | 是 |
limit_buy_rule | LimitBuyRuleStruct | 限购规则 (参阅“限购规则”章节) | "{\"enable_limit\":true,\"rule_list\":[{\"subject_type\":1,\"range_type\":3,\"limit_num\":10},{\"subject_type\":1,\"range_type\":2,\"limit_num\":1}]}"
| 否 |
use_date | UseDateStruct | 可用日期 (请参阅可用日期”章节) | "{\"use_date_type\":2,\"day_duration\":30}"
| 是 |
cannot_use_date | CannotUseDateStruct | 不可用日期 (请参阅不可用日期”章节) | "{\"enable\":true,\"days_of_week\":[1],\"date_list\":[\"2024-08-30\"]}" 使用商家所在国家/地区对应的时区。 | 否 |
use_time | UseTimeStruct | 使用时间 (请参阅使用时间”章节) | "{\"use_time_type\":2,\"time_period_list\":[{\"use_start_time\":\"20:00\",\"use_end_time\":\"02:00\",\"end_time_is_next_day\":true}]}" 使用商家所在国家/地区对应的时区。 | 是 |
appointment | AppointmentStruct | 预约信息 (请参阅预约信息”章节) | "{\"need_appointment\":true,\"ahead_time_type\":1,\"ahead_num\":20}" | 否 |
consumption_convention | COMSUMPTION_CONVENTION | 堂食和外带协议 (请参阅堂食和外带协议”章节) | "{\"consumption_method\":2}" | 是 |
description_rich_text | NoteStruct | 其他说明信息 (请参阅其他说明信息 ”章节) | "{\"content\":\"{\\\"default_text\\\":\\\"Other information\\\"}\"}"
| 否 |
现金券属性
字段 | 类型 | 说明 | 示例 | 是否必填 |
shop_id | LIST<string> | 与商品绑定的门店 | "[\"222\"]" | 是 |
product_name | I18nText | 商品名称 (请参阅商品名称”章节) | "{\"DefaultText\":\"product name\",\"translations\":{\"en\":\"product name-en\",\"id\":\"product name-id\"}}" default_text 为默认语言文本。如果查询传入 ID 但找不到对应翻译,则使用 default_text。 | 是 |
image | string | 套餐图片 | "http://p5.itc.cn/images03/20200519/d6c0794d068e4967a8b16a16416413f7.jpeg" 商家可以输入公网 URL,TT 会将其上传到内部存储。 建议上传 2–10 张图片,每张不超过 5MB;建议宽高比为 4:3,分辨率为 780 × 585。 建议将高分辨率图片作为首图,以吸引用户。 | 是 |
origin_amount | int | 总价 | "3000" | 是 |
actual_amount | int | 客户实际需要支付的金额 | "2000" | 是 |
local_currency | int | 价格对应的币种 | "THB" | 是 |
stock_info | StockInfoStruct | 库存 (请参阅库存”章节) | "{\"stock_num\":1000,\"stock_qty_limit_type\":1}" | 是 |
sold_start_time | int | 商品开售时间,毫秒级时间戳 | "1720666722000" | 否 |
sold_end_time | int | 商品停售时间,毫秒级时间戳。此字段仅影响商品展示,不影响商品状态。 | "1752202732000" | 否 |
sold_time_type | int | 商品销售时间类型:
| "1" | 是 |
use_type | int | 团购使用方式
| "1" | 是 |
limit_buy_rule | LimitBuyRuleStruct | 限购规则(请参阅限购规则”章节) | "{\"enable_limit\":true,\"rule_list\":[{\"subject_type\":1,\"range_type\":3,\"limit_num\":10},{\"subject_type\":1,\"range_type\":2,\"limit_num\":1}]}" 商品属性键 [limit_buy_rule] 中的 limitNum 必须为 1 到 99。 | 否 |
use_date | UseDateStruct | 可用日期 (请参阅可用日期 ”章节) | "{\"use_date_type\":2,\"day_duration\":30}" day_duration 的可选值为:[60,45,30]。 有效期按自然日计算。 例如,1 日 9:00 购买的团购券,有效期为 1 天,将于 2 日 9:01 过期。 | 是 |
cannot_use_date | CannotUseDateStruct | 不可用日期 (请参阅不可用日期”章节) | "{\"enable\":true,\"days_of_week\":[1],\"date_list\":[\"2024-08-30\"]}" 使用商家所在国家/地区对应的时区。 | 否 |
use_time | UseTimeStruct | 使用时间(请参阅使用时间”章节) | "{\"use_time_type\":2,\"time_period_list\":[{\"use_start_time\":\"20:00\",\"use_end_time\":\"02:00\",\"end_time_is_next_day\":true}]}" 使用商家所在国家/地区对应的时区。 | 是 |
appointment | AppointmentStruct | 预约信息 (请参阅预约信息”章节) | "{\"need_appointment\":true,\"ahead_time_type\":1,\"ahead_num\":20}" | 否 |
consumption_convention | COMSUMPTION_CONVENTION | 堂食和外带协议 (请参阅堂食和外带协议 ”章节) | "{\"consumption_method\":2}" | 是 |
description_rich_text | NoteStruct | 其他说明信息 (请参阅其他说明信息 ”章节) | "{\"content\":\"{\\\"default_text\\\":\\\"Other information\\\"}\"}" default_text 使用 I18N 文本。 | 否 |
商品名称
I18nText 对象
字段 | 类型 | 说明 | 是否必填 |
default_text | string | 默认本地语言文本 此字段的最大长度为 1000 | 是 |
translations | Map<string, string> | 多语言翻译
| 否 |
商品组合
ItemGroupStruct 对象
字段 | 类型 | 说明 | 是否必填 |
i18n_group_name | I18nText | I18n 商品组名称 | 是 |
group_name | string | 商品组名称 | 否 |
total_count | int32 | 总数 | 否 |
option_count | int32 | 选择数量 | 是 |
item_list | List<ItemStruct> | 服务项列表 | 是 |
allow_repeated_item | bool | 商品组内是否允许重复的服务项 | 否 |
ItemStruct 对象
字段 | 类型 | 说明 | 是否必填 |
i18n_name | I18nText | I18n 项目名称 | 是 |
name | string | 项目名称(改用 I18nText 对象) | 否 |
price | string | 价格, 例如: "2000" | 否 |
currency | string | Currency 例如: "IDR" | 否 |
count | int32 | 总数 | 是 |
image_list | List<ImageStruct> | 单个商品的图片列表 | 否 |
套餐方案
ImageStruct 对象
字段 | 类型 | 说明 | 是否必填 |
out_url | string | 外部图片 URL,商家可以传入此字段。 | 是 |
库存
StockInfoStruct 对象
字段 | 类型 | 说明 | 是否必填 |
stock_num | int64 | 库存数量 | 是 |
stock_qty_limit_type | StockQtyLimitTypeEnum
| 库存上限类型 没有库存限制时,stock_num 无效。 | 是 |
可用日期
UseDateStruct 对象
字段 | 类型 | 说明 | 是否必填 |
use_date_type | UseDateTypeEnum | 使用日期类型
| 是 |
day_duration | int32 | 购买日起多少天? | 否 |
使用时间
UseTimeStruct 对象
字段 | 类型 | 说明 | 是否必填 |
use_time_type | UseTimeTypeEnum | 使用时间 类型
| 是 |
time_period_list | List<TimePeriodStruct> | 时间段列表
| 否 |
TimePeriodStruct 对象
字段 | 类型 | 说明 | 是否必填 |
use_start_time | string | 开始时间
| 是 |
use_end_time | string | 结束时间
| 是 |
end_time_is_next_day | bool | 是否跨天 | 否 |
不可用日期
CannotUseDateStruct 对象
字段 | 类型 | 说明 | 是否必填 |
enable | bool | 开关 | 是 |
days_of_week | List<DayOfWeekEnum> | 指定星期几 not available
| 否 |
holidays | List<int64> | 指定的节假日不可使用 | 否 |
date_list | List<string> | 指定日期不可使用
| 否 |
date_period_list | List<CanNoAppointmentDatePeriod> | 不可用日期区间说明 | 否 |
CanNoAppointmentDatePeriod 对象
字段 | 类型 | 说明 | 是否必填 |
i18n_description | I18nText | I18n 说明 | 否 |
description | string | 说明 | 否 |
from_date | string | 开始日期
| 是 |
to_date | string | 截止时间
| 是 |
堂食和外带协议
ConsumptionConventionStruct 对象
字段 | 类型 | 说明 | 是否必填 |
consumption_method | ConsumptionMethod | 消费方式
| 是 |
预约信息 (可选)
AppointmentStruct 对象
字段 | 类型 | 说明 | 是否必填 |
need_appointment | bool | 是否启用 | 否 |
ahead_time_type | AheadTimeTypeEnum | 提前预约时间单位
| 否 |
ahead_num | int32 | 需要提前电话预约
| 否 |
其他说明信息 (可选)
NoteStruct 对象
字段 | 类型 | 说明 | 是否必填 |
note_type | OtherNoteTypeEnum | 备注 类型 TEXT = 1, (文本) TEXT = 1, (文本) | 否 |
content | string | Content
| 否 |
限购规则(可选)
LimitBuyRuleStruct 对象
字段 | 类型 | 说明 | 是否必填 |
enable_limit | bool | 是否启用限购 | 是 |
rule_list | list<LimitRuleItem> | 限购规则列表 | 否 |
LimitRuleItem 对象
字段 | 类型 | 说明 | 是否必填 |
subject_type | SubjectTypeEnum | 限购主体(例如 UID)
| 是 |
range_type | RangeTypeEnum | 限购范围(例如下单日期、终身等)
| 是 |
limit_num | i32 | 限购数量 | 是 |
dimension_type | DimensionTypeEnum | 生效维度(例如商品、SKU、日历等)
| 否 |
响应参数
仅表示提交成功;商品审核状态将通过 webhook 通知。
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
注意:
- 更新商品信息不会改变商品当前的上架状态;更新完成后,新信息立即生效。
- 更新/保存时必须在 `attr_key_value_map` 中传入全部键值,不支持部分更新。如需部分更新,请使用免审核更新接口。
- 更新流程不会更改 TT 商品 ID,仍沿用首次保存时生成的 ID。
- 强烈建议商家在保存商品前调用“product_opt_category/query/”,以确保目标门店当前有效。
商品更新(免审核)
商品上传并审核通过后,库存和价格信息可免审核更新,并立即生效。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/update_free_audit/
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
product_free_audit | ProductFreeAudit | 免审核更新详情对象 | 是 |
third_product_id | string | 第三方商品 ID | 是 |
language | string | 语言 | 否 |
ProductFreeAudit 对象
字段 | 类型 | 说明 | 是否必填 |
third_product_id | string | 第三方商品 ID | 是 |
local_currency | string | 商品 币种, 例如: IDR | 是 |
actual_amount | string | 商品 金额, 例如: 12.3456 | 是 |
stock_qty_limit_type | int | 库存类型
| 是 |
stock_num | int | 库存数量;库存类型为有限库存时必须填写。 | 是 |
响应参数
同步响应;请求成功即表示更新成功。
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
下架商品
商品上传并审核通过后,可将商品下架。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/offline
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
third_product_id | string | 第三方商品 ID | 是 |
language | string | 语言 | 是 |
响应参数
同步响应;请求成功即表示商品下架成功。
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
撤销商品审核
商品处于待审核状态时,可以撤销审核后重新提交。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/withdraw_audit
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
third_product_id | string | 第三方商品 ID | 是 |
language | string | 语言 | 是 |
响应参数
同步响应;请求成功即表示撤销审核成功。
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
商品列表查询
商品创建或更新后,检查其状态和详情。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/batch_query/
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
product_type_list | List<ProductType> | 商品 类型
| 是 |
list_tab | ListTabEnum | 商品状态 信息
| 是 |
product_name | string | 商品名称 | 否 |
third_shop_ids | List<string> | 第三方线下门店 ID 列表 | 否 |
shop_ids | List<string> | TT 线下门店 ID 列表 | 否 |
language | string | 语言 | 否 |
pagination | Pagination | 分页信息 | 是 |
响应参数
同步响应;请求成功即表示撤销审核成功。
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
data | MGetProductsResponseData | 实际数据 | 否 |
MGetProductsResponseData 对象
字段 | 类型 | 说明 | 是否必填 |
products | List<ProductListInfoStruct> | 商品列表信息 | 否 |
next_pagination | NextPagination | 分页信息 | 否 |
ProductListInfoStruct 对象
字段 | 类型 | 说明 | 是否必填 |
product_name | string | 商品名称 | 是 |
product_id | string | 商品 ID | 是 |
third_product_id | string | 第三方商品 ID | 是 |
reject_reason | string | 驳回原因 | 否 |
product_type | ProductType | 商品类型 | 是 |
product_status | ProductStatusEnum | 商品状态 | 是 |
origin_amount | string | 原价 | 是 |
actual_amount | string | 实际价格 | 是 |
image_url | string | 头图 | 是 |
category_id | string | POI 类目 | 是 |
category | CategoryStruct | 商品类目信息 | 是 |
sold | string | 已售数量 | 否 |
inventory | string | 库存 | 否 |
stock_qty_limit_type | StockQtyLimitTypeEnum | 库存上限类型 | 是 |
sold_start_time | int64 | 销售开始时间 | 是 |
sold_end_time | int64 | 销售结束时间 | 是 |
sold_time_type | SoldTimeTypeEnum | 销售时间类型
| 否 |
bond_shops | int64 | 已关联的线下门店数量 | 是 |
avaliable_shops | int64 | 可用的线下门店数量 | 是 |
create_at | int64 | 创建时间 | 是 |
CategoryStruct 对象
字段 | 类型 | 说明 | 是否必填 |
first_category_id | i64 | 一级类目 ID | 是 |
first_description | string | 一级类目说明 | 是 |
second_category_id | i64 | 二级类目 ID | 是 |
second_description | string | 二级类目说明 | 是 |
third_category_id | i64 | 3 级类目 ID | 是 |
third_description | string | 三级类目说明 | 是 |
NextPagination 对象
字段 | 类型 | 说明 | 是否必填 |
current_page_size | int64 | 当前 页数 | 是 |
has_more | bool | 是否还有更多数据 | 否 |
total | int64 | 总数 | 否 |
商品详情查询
获取商品列表后,可查看指定商品的线上版本和审核中版本详情。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/query/
请求参数
字段 | 类型 | 说明 | 是否必填 |
third_product_id | string | 第三方商品 ID | 是 |
merchant_id | string | 商家 ID | 否 |
online | bool | 是否 在线
| 是 |
language | string | 语言 | 否 |
响应参数
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
data | GetProductResponseData | 商品数据 | 否 |
GetProductResponseData 对象
字段 | 类型 | 说明 | 是否必填 |
product_detail | ProductDetailStruct | 商品详情 | 否 |
ProductDetailStruct 对象
字段 | 类型 | 说明 | 是否必填 |
product | ProductAndSkuStruct | 商品基本信息 | 是 |
audit_info | PlatformAuditStruct | 审核信息 | 否 |
operator | OperatorStruct | 操作发起方信息 | 否 |
product_operate_extra | ProductOperateExtra | 商品操作附加信息 | 否 |
ProductAndSkuStruct 对象
字段 | 类型 | 说明 | 是否必填 |
third_product_id | string | 第三方商品 ID | 否 |
product_id | string | 商品 ID | 否 |
category_id | string | 叶子类目 ID | 是 |
product_type | common.ProductType | 商品 类型 DISCOUNT_VOUCHER = 2, (团购券) | 是 |
category | CategoryStruct | 商品类目信息 | 否 |
product_status | ProductStatusEnum | 商品状态
| 否 |
holiday_list | list<HolidayStruct> | 节假日列表 | 否 |
sold | string | 已售数量 | 否 |
product_full_status | ProductStatusEnum | 详情页聚合的线上与草稿状态
| 否 |
attr_key_value_map | map<string, string> | 附加属性
| 否 |
CategoryStruct 对象
字段 | 类型 | 说明 | 是否必填 |
first_category_id | i64 | 一级类目 ID | 是 |
first_description | string | 一级类目说明 | 是 |
second_category_id | i64 | 二级类目 ID | 是 |
second_description | string | 二级类目说明 | 是 |
third_category_id | i64 | 3 级类目 ID | 是 |
third_description | string | 三级类目说明 | 是 |
HolidayStruct 对象
字段 | 类型 | 是否必填 | Decription |
holiday_name | string | 是 | 节假日名称 |
holiday_date | string | 否 | 节假日日期 |
holiday_id | i64 | 是 | 节假日唯一标识符 |
PlatformAuditStruct 对象
字段 | 类型 | 说明 | 是否必填 |
audit_msg | string | 审核信息 | 否 |
submit_time | i64 | 提交审核时间 | 否 |
audit_time | i64 | 批准/驳回时间 | 否 |
audit_id | string | 审核编号 | 否 |
audit_title | string | 审核标题 | 否 |
operator_role | OperatorRoleType | 操作人 角色
| 否 |
OperatorStruct 对象
字段 | 类型 | 说明 | 是否必填 |
operator_role | OperatorRoleType | 操作人 角色
| 是 |
operator_id | string | 操作人 ID | 否 |
operator_name | string | 操作人姓名 | 否 |
operator_email | string | 操作人邮箱 | 否 |
ProductOperateExtra 对象
字段 | 类型 | 说明 | 是否必填 |
operator | OperatorStruct | 操作人 信息 | 否 |
source | Source | 操作来源 | 否 |
reason | string | 操作原因 | 否 |
operate_time | i64 | 操作时间 | 否 |
商品类目查询
查看创建或更新商品时可使用的商家类目。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product_opt_category/query/
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
language | string | 显示语言, 例如 作为 EN | 是 |
响应参数
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
data | GetProductOptCategoryResponseData | Data | 否 |
GetProductOptCategoryResponseData 对象
字段 | 类型 | 说明 | 是否必填 |
category_tree_list | list<CategoryTreeStruct> | 可用 类目 | 是 |
CategoryTreeStruct 对象
字段 | 类型 | 说明 | 是否必填 |
category_id | string | 类目 ID | 是 |
description | string | 类目说明 | 是 |
sub_category_list | list<CategoryTreeStruct> | 子类目 | 是 |
parent_category_id | string | 父类目 ID | 是 |
查询门店可用商品
查看商家创建或更新商品时可使用的门店。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product_opt_shops/query/
请求参数
字段 | 类型 | 说明 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
language | string | 显示语言 例如, en | 是 |
pagination | Pagination | 分页信息 | 是 |
响应参数
字段 | 类型 | 说明 | 是否必填 |
error | 状态码 | 是 | |
data | GetProductOptShopsResponseData | 实际数据 | 否 |
GetProductOptShopsResponseData 对象
字段 | 类型 | 说明 | 是否必填 |
shops | list<ShopInfo> | 可用 类目 | 是 |
next_pagination | NextPagination | 分页信息 | 否 |
ShopInfo 对象
字段 | 类型 | 说明 | 是否必填 |
shop_base_info | SearchShopInfo | 线下门店基本信息 | 是 |
available | bool | 线下门店是否可用 | 是 |
unavailable_reason | list<int> | 线下门店不可用原因
| 是 |
SearchShopInfo 对象
字段 | 类型 | 说明 | 是否必填 |
shop_id | int64 | 门店 ID | 是 |
shop_name | string | 线下门店名称 | 是 |
third_shop_id | string | 第三方线下门店 ID | 是 |
location_en | string | 英文地址 | 否 |
merchant_id | int64 | 商家 ID | 否 |
国家/地区节假日查询
检查商家所在国家/地区的节假日,以确定是否应限制优惠券使用。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/holiday/batch_query/
请求参数
字段 | 类型 | 说明 | 是否必填 |
countries | list<string> | 请求的国家/地区代码列表 例如, ID | 是 |
language | string | 返回的节假日信息所用语言 | 否 |
响应参数
字段 | 类型 | 说明 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
data | MGetHolidayByCountryResponseData | 实际数据 | 否 |
MGetHolidayByCountryResponseData 对象
字段 | 类型 | 说明 | 是否必填 |
holiday_map | map<string, list<HolidayStruct>> | 国家/地区与节假日信息映射表
| 否 |
HolidayStruct 对象
字段 | 类型 | 说明 | 是否必填 |
holiday_id | i64 | 节假日的唯一标识符 | 是 |
holiday | string | 节假日名称 | 是 |
starling_text | string | 与节假日相关的 Starling 文本说明 | 否 |
临时停用商品
第三方系统实时向 TTLS 同步线下售罄/暂停供应状态,防止用户下单后履约失败。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/removal/batch_create
请求参数
字段 | 类型 | 备注 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
third_product_id | string | 第三方商品 ID,即商品在 SaaS 平台上的唯一 ID;系统通过 client_key + third_product_id 映射到 product_id。 | 是 |
shop_removals | list<ShopRemoval> | 需要下架商品的线下门店列表(同一商品 × N 个门店)。最多支持 1,000 个门店;超出限制将触发错误 ShopLimitExceeded(8000258)。 | 是 |
language | string | 错误消息的显示语言,例如 EN | 是 |
ShopRemoval 对象
字段 | 类型 | 备注 | 是否必填 |
third_shop_id | string | 第三方门店 ID | 是 |
remove_days | int32 | 距离下架的天数(自然日);有效范围:[1, 15]。例如:若在 1 月 1 日 23:50 执行“remove”操作并设置为 1 天,则标签将在当天 23:59:59 自动移除。超出范围的值会触发错误码 16。 | 是 |
响应参数
异步响应。响应成功表示 TTLS 已接受请求;实际下架完成结果通过 ttls.product.shop_removal.result webhook 传递。
字段 | 类型 | 备注 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
校验
校验项 | 错误码 / 错误键 | 说明 |
merchant_id 不能为空 | 40001 / ttls_openapi_param_invalid | 商家 ID 不能为空 |
third_product_id 不能为空,并且必须映射到内部 product_id | 8000254 / ttls_productFlowErrorCode_8000254 | 商品不存在或未上架 |
shop_removals 不能为空,长度 ≤ 1000 | 8000258 / ttls_productFlowErrorCode_8000258 | 门店 ID 数量不能超过 1,000。 |
third_shop_id 必须与商品存在关联 | 8000255 / ttls_productFlowErrorCode_8000255 | 商品与该线下门店没有关联关系 |
商品和门店尚未被 GNE(OVL)下架。 | 8000253 / ttls_productFlowErrorCode_8000253 | 如果商品已被 GNE 下架,则无需执行此操作。 |
线下门店未处于离线状态 | 8000256 / ttls_productFlowErrorCode_8000256 | 线下门店已离线,无法下架与离线门店关联的商品。 |
remove_days ∈ [1, 15] | ttlsMerchant_productActivationDeactivation_errorCode16 | 下架天数不正确。 |
商家已通过 TTOP 使用 client_key 完成授权。 | ttlsMerchant_productActivationDeactivation_errorCode20 | 你无权执行此操作。 |
商品门店状态查询
SaaS 主动同步商品在线下门店的实时销售状态,包括三种情况:已上架、已下架(含剩余天数和到期时间)以及未关联。
注意:每秒最大查询次数(QPS)限制为 50。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/shop_status/query
请求参数
字段 | 类型 | 备注 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
third_product_id | string | 第三方商品 ID | 是 |
third_shop_ids | list<string> | 第三方门店 ID 列表。若为空,则返回与商品绑定的所有门店的状态。最多 200 个。 | 否 |
language | string | 显示语言, 例如 作为 EN | 是 |
响应参数
同步响应
字段 | 类型 | 备注 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
data | <ProductShopStatusResponseData> | 实际数据 | 否 |
ProductShopStatusResponseData 对象
字段 | 类型 | 备注 | 是否必填 |
third_product_id | string | 第三方商品 ID | 是 |
product_id | string | TikTok 生活服务商品 ID | 是 |
shop_statuses | list<ShopProductStatus> | 各线下门店的状态信息 | 是 |
ShopProductStatus 对象
字段 | 类型 | 备注 | 是否必填 |
third_shop_id | string | 第三方门店 ID | 是 |
shop_id | string | TikTok 生活服务线下门店 ID | 是 |
status | ProductShopStatusEnum | 商品在线下门店的状态:
| 是 |
remove_info | RemoveInfo | 仅当 status = REMOVED 时存在。 | 否 |
expected_online_time | int64 | 预计上线时间,Unix 时间戳(秒)。等同于 GnE expected_online_time。仅当 status = REMOVED 时返回。 | 否 |
RemoveInfo 对象
字段 | 类型 | 备注 | 是否必填 |
remove_days_left | int32 | 剩余下架天数(按自然日向上取整) | 是 |
start_time | int64 | 下架 开始时间, Unix 秒 | 是 |
end_time | int64 | 下架结束时间,以 Unix 秒为单位。当多条记录重叠时,返回以下记录的 end_time: 当前生效的记录。 | 是 |
source | RemoveSourceEnum | 下架来源: merchant_platform = 1 shop_fulfill = 2 api = 3 governance_platform = 4(通过 GnE 系统下架,包括 OVL/OOS) | 是 |
removal_id | string | 当前生效的下架记录 ID(仅针对商家发起的下架返回)。 | 否 |
校验
校验项 | 错误码 / 错误键 | 说明 |
merchant_id 和 third_product_id 均不能为空 | 40001 / ttls_openapi_param_invalid | 商家 ID 和第三方商品 ID 均不能为空。 |
third_product_id 不能为空,并且必须映射到内部 product_id | 8000254 / ttls_productFlowErrorCode_8000254 | 商品不存在或未上架 |
third_shop_id 不能为空,长度 ≤ 200 | 40002 / ttls_openapi_shop_limit_exceeded_query | shop_id 的数量不能超过 200。 |
商家已通过 TTOP 使用 client_key 完成授权。 | ttlsMerchant_productActivationDeactivation_errorCode20 | 你无权执行此操作。 |
启用已停用商品
线下门店补货后,SaaS 调用此 API 可快速恢复商品上架销售,减少后台人工处理延迟并加快 GMV 恢复。
注意:每秒最大查询次数(QPS)限制为 20。
端点
POST https://open.tiktokapis.com/v2/localservice/saas/product/removal/cancel
请求参数
字段 | 类型 | 备注 | 是否必填 |
merchant_id | string | 商家 ID | 是 |
third_product_id | string | 第三方商品 ID | 是 |
third_shop_id | string | 第三方线下门店 ID。每次调用仅支持一个商品 × 一个门店。 | 是 |
language | string | 错误消息的显示语言,例如 EN | 是 |
响应参数
同步响应。请求成功即表示已成功取消下架。
字段 | 类型 | 备注 | 是否必填 |
error | ErrorStruct | 状态码 | 是 |
校验
校验项 | 错误码 / 错误键 | 说明 |
merchant_id / third_product_id / third_shop_id 均不能为空 | 40001 / ttls_openapi_param_invalid | 商家 ID、商品 ID 和线下门店 ID 均不能为空 |
商品处于已上架状态(ProductStatus = LISTED) | ttlsMerchant_productActivationDeactivation_errorCode17 | 此商品未上架,无法重新上架。 |
线下门店未处于离线状态 | ttlsMerchant_productActivationDeactivation_relistShopOffline | 线下门店未上线,因此无法重新上架此商品。 |
third_shop_id 必须与商品存在关联 | 8000255 / ttls_productFlowErrorCode_8000255 | 商品与该线下门店没有关联关系 |
商品尚未被 GNE 下架(source ≠ governance_platform)。 | 8000267 / ttls_productFlowErrorCode_8000267 | 此商品已被系统下架,无法重新上架。 |
当前下架记录未被其他下架记录覆盖。 | ttlsMerchant_productActivationDeactivation_errorCode18 | 此商品最近已由 {s_operatorName} 于 {s_timeStamp} 通过 {s_source} 下架,因此无法再次下架。 |
商家已通过 TTOP 使用 client_key 完成授权。 | ttlsMerchant_productActivationDeactivation_errorCode20 | 你无权执行此操作。 |
商品状态 Webhook
注意:商品创建或更新后,状态变化将通过 webhook 通知开发者。
字段 | 说明 |
client_key | 第三方开发者(SAAS 平台)在 TTOP 注册的 ID |
event product.status.doman_sync | 事件名称,命名约定通常为 aa.bb.cc。 例如:video.upload.failed 事件名称:ttls.product.status_update.result |
create_time | 时间戳,单位为 seconds 自 Unix 纪元起 |
user_id | 涉及的 TikTok 用户标识;若不涉及用户,则为 null。 |
content | 封送后的 JSON 字符串。TTOP 仅透传序列化后的 JSON 字符串,不解析也不感知其内容。 |
caller tiktok.local.solution_gateway | 这是 TT 提供的标签,仅用于调试跟踪。 |
Content
字段 | 类型 | 说明 | 是否必填 |
third_product_id | string | 第三方商品 ID | 是 |
product_id | string | 商品 ID | 是 |
product_type | ProductType | 商品类型
| 是 |
category_id | int64 | 类目 ID | 是 |
merchant_id | string | 商家 ID | 是 |
product_status | ProductStatusEnum | 商品状态
| 是 |
action_type | GoodsDomainContentActionType | 操作 类型
| 否 |