创建提货券商品
收藏我的收藏
使用限制
无
接口说明
创建或更新提货券商品
基本信息
基本信息 | ||||
HTTP URL | https://open.douyin.com/goodlife/v1/goods/product/save/ | |||
HTTP Method | POST | |||
权限要求 | 提货券三方码交易 | |||
请求头Header
参数名称 | 参数类型 | 是否必传 | 参数描述 |
access-token | string | TRUE | 调用/oauth/client_token/生成的token,此token不需要用户授权。 |
请求参数
参数名称 | 参数类型 | 是否必传 | 参 数描述 |
product | ProductStruct | TRUE | 商品 |
- product_id | string | TRUE | 商品Id,创建时不必填写,更新时如有out_id可不填写 |
- out_id | string | TRUE | 外部商品id |
- product_name | string | TRUE | 商品名 |
- category_full_name | string | TRUE | 品类全名,保存时不必填写 |
- category_id | int | TRUE | 品类id |
- product_type | int | TRUE | 商品类型:28-零售品 |
- product_sub_type | int | FALSE | 商品二级类型:2801-提货券 |
- biz_line | int | TRUE | 业务线 1-闭环自研开发者 (更新时不可修改) |
- account_name | string | TRUE | 商家名(暂时无用) |
- telephone | list<string> | FALSE | 联系电话 |
- sold_start_time | int | TRUE | 售卖开始时间 单位s |
- sold_end_time | int | TRUE | 售卖结束时间 (到期自动下架) 单位s |
- out_url | string | FALSE | 第三方跳转链接,小程序商品必填 |
- pois | list<struct> | TRUE | 店铺列表 |
-- poi_id | string | FALSE | poiID,技术服务商保存商品填写该字段(在来客的门店管理列表中) |
-- supplier_ext_id | string | FALSE | 接入方店铺id, 代运营服务商保存商品选择poi_id或者supplier_ext_id其中一个字段填写 |
- attr_key_value_map | map<string,string> | TRUE | 商品属性KV,填写时查询“查询商品模板”接口,map的value中数据最后要转成String!提货券商品创建不传sku,sku维度的属性settle_type和code_source_type在此传递 |
- product_ext | struct | FALSE | 商品额外信息 |
-- auto_online | bool | FALSE | true / null - 审核通过自动上架 false - 审核通过不自动上架 |
-- test_extra | struct | FALSE | 测试商品信息 |
--- uids | list<string> | FALSE | 商品可见的用户UID列表,["123456"] ,最多10个 |
--- test_flag | bool | FALSE | |
account_id | string | TRUE | 商家ID,必传(来客后台右上角的账户ID); 传入时服务商须与该商家满足授权关系; 技术服务商必传 标准代运营服务商必传 ka自研开发者必传 |
attr_key_value_map模版中提 货券特殊属性解释
aftersale_rule
无需传入,保存商品时,系统根据商品类目设置是否支持“7天无理由退货”标识,设置的类目如下
7天无理由必开类目
商品一级类目id | 商品一级类目名称 | 商品二级类目id | 商品二级类目名称 | 商品三级类目id | 商品三级类目名称 | 商品类型 |
5000000 | 购物 | 5009000 | 配饰 | 5009003 | 钟表配件 | 提货券 |
5000000 | 购物 | 5009000 | 配饰 | 5009002 | 钟表 | 提货券 |
5000000 | 购物 | 5014000 | 运动户外 | 5014001 | 运动及户外用品 | 提货券 |
5000000 | 购物 | 5005000 | 眼镜店 | 5005001 | 眼镜店 | 提货券 |
5000000 | 购物 | 5010000 | 服饰鞋帽 | 5010003 | 鞋靴 | 提货券 |
5000000 | 购物 | 5010000 | 服饰鞋帽 | 5010002 | 箱包 | 提货券 |
5000000 | 购物 | 5021000 | 图书音像 | 5021001 | 图书期刊 | 提货券 |
5000000 | 购物 | 5011000 | 数码家电 | 5011001 | 数码3C | 提货券 |
5000000 | 购物 | 5012000 | 美妆个护 | 5012001 | 美妆 | 提货券 |
5000000 | 购物 | 5011000 | 数码家电 | 5011002 | 家用电器 | 提货券 |
5000000 | 购物 | 5008000 | 家居建材 | 5008001 | 家具装饰 | 提货券 |
5000000 | 购物 | 5008000 | 家居建材 | 5008002 | 建材五金 | 提货券 |
5000000 | 购物 | 5012000 | 美妆个护 | 5012002 | 个护家清 | 提货券 |
5000000 | 购物 | 5010000 | 服饰鞋帽 | 5010001 | 服装 | 提货券 |
5000000 | 购物 | 5010000 | 服饰鞋帽 | 5010005 | 服饰配件 | 提货券 |
5000000 | 购物 | 5013000 | 交通工具 | 5013003 | 二/三轮车配件 | 提货券 |
5000000 | 购物 | 5009000 | 配饰 | 5009001 | 穿戴饰品 | 提货券 |
5000000 | 购物 | 5020000 | 办公文化用品 | 5020001 | 办公用品/文具 | 提货券 |
product_spec
商品规格项的定义,比如尺码:L、XL,颜色:白色、红色、绿色,定义不能重复
只能在第一组规格传入描述图片
[ // 第一组规格可以传入描述图片 { "item_list": [ // 规格项不能重复 { "item_name": "L", "image":{ "uri":"xxx", "url":"xxx" } }, { "item_name": "XL", "image":{ "uri":"xxx", "url":"xxx" } }, { "item_name": "XXL", "image":{ "uri":"xxx", "url":"xxx" } } ], "group_name": "尺码" }, { "item_list": [ { "item_name": "白色" }, { "item_name": "红色" }, { "item_name": "绿色" } ], "group_name": "颜色" } ]
sku_spec_info
商品规格项的实际表达,为product_spec定义的全部组合,数量等于最终生成的多sku数量
如上,尺码:L、XL,颜色:白色、红色、绿色
- 1.需要传入的sku_spec_info为[L/白色, L/红色, L/绿色, XL/白色, XL/红色, XL/绿色];
- 2.示例product_spec在尺码设置了描述图片,sku_speck_info对应尺码的item需要传入product_spec中设置的图片;
- 3.需要为每种规格设置对应的价格,单位为分;(15元: 1500分)
- 4.如需要可以设置sku_merchant_code
[ // 一组规格(尺码*颜色),下面同理 { "price":1500, "sku_merchant_code":"123", "sku_spec":[ { "group_name":"尺码", "item_list":[ { "item_name":"L", // 尺码设置描述图片 "img":{ "uri":"xxx", "url":"xxx" } } ] }, { "group_name":"颜色", "item_list":[ { "item_name":"白色" } ] } ] }, { "price":1500, "sku_merchant_code":"124", "sku_spec":[ { "group_name":"尺码", "item_list":[ { "item_name":"XL", "img":{ "uri":"xxx", "url":"xxx" } } ] }, { "group_name":"颜色", "item_list":[ { "item_name":"白色" } ] } ] }, { "price":1500, "sku_merchant_code":"125", "sku_spec":[ { "group_name":"尺码", "item_list":[ { "item_name":"L", "img":{ "uri":"xxx", "url":"xxx" } } ] }, { "group_name":"颜色", "item_list":[ { "item_name":"红色" } ] } ] }, { "price":1500, "sku_merchant_code":"126", "sku_spec":[ { "group_name":"尺码", "item_list":[ { "item_name":"XL", "img":{ "uri":"xxx", "url":"xxx" } } ] }, { "group_name":"颜色", "item_list":[ { "item_name":"红色" } ] } ] }, { "price":1500, "sku_merchant_code":"127", "sku_spec":[ { "group_name":"尺码", "item_list":[ { "item_name":"L", "img":{ "uri":"xxx", "url":"xxx" } } ] }, { "group_name":"颜色", "item_list":[ { "item_name":"绿色" } ] } ] }, { "price":1500, "sku_merchant_code":"128", "sku_spec":[ { "group_name":"尺码", "item_list":[ { "item_name":"XL", "img":{ "uri":"xxx", "url":"xxx" } } ] }, { "group_name":"颜色", "item_list":[ { "item_name":"绿色" } ] } ] }, ]
请求示例
{ "account_id":"123", "product": { "account_name": "测试商家", "attr_key_value_map": { "auto_renew": "true", "customer_reserved_info": "{\"allow\":false}", "detail_image_list":"[{\"uri\":\"xxx\",\"url\":\"xxx\"},{\"uri\":\"xxx\",\"url\":\"xxx\"}]", "environment_image_list": "[{\"uri\":\"xxx\",\"url\":\"xxx\",\"sortableOnlyId\":\"12aeb4fa-c53f-4965-b699-06c359239918\"},{\"uri\":\"xxx\",\"url\":\"xxx\",\"sortableOnlyId\":\"f53a710c-018b-4c72-9c4c-8500ea39a2e8\"}]", "image_list": "[{\"uri\":\"xxx\",\"url\":\"xxx\",\"sortableOnlyId\":\"12aeb4fa-c53f-4965-b699-06c359239918\"},{\"uri\":\"xxx\",\"url\":\"xxx\",\"sortableOnlyId\":\"f53a710c-018b-4c72-9c4c-8500ea39a2e8\"}]", "code_source_type": "1", "show_channel": "1", "settle_type": "1", "use_date": "{\"use_date_type\":2,\"day_duration\":360,\"use_start_date\":\"2024-07-01\",\"use_end_date\":\"2025-06-25\"}", "use_time": "{\"use_time_type\":1,\"time_period_list\":[]}", "product_spec": "[{\"group_name\":\"尺码\",\"weight\":9,\"item_list\":[{\"item_name\":\"L\",\"img\":{\"uri\":\"xxx\",\"url\":\"xxx\"}},{\"item_name\":\"XL\",\"img\":{\"uri\":\"xxx\",\"url\":\"xxx\"}}]},{\"group_name\":\"颜色\",\"weight\":10,\"item_list\":[{\"item_name\":\"白色\"},{\"item_name\":\"红色\"}]}]", "sku_spec_info": "[{\"price\":1500,\"sku_merchant_code\":\"123\",\"sku_spec\":[{\"group_name\":\"尺码\",\"weight\":9,\"item_list\":[{\"item_name\":\"L\",\"img\":{\"uri\":\"xxx\",\"url\":\"xxx\"}}]},{\"group_name\":\"颜色\",\"weight\":10,\"item_list\":[{\"item_name\":\"白色\"}]}]},{\"price\":1500,\"sku_merchant_code\":\"124\",\"sku_spec\":[{\"group_name\":\"尺码\",\"weight\":9,\"item_list\":[{\"item_name\":\"XL\",\"img\":{\"uri\":\"xxx\",\"url\":\"xxx\"}}]},{\"group_name\":\"颜色\",\"weight\":10,\"item_list\":[{\"item_name\":\"白色\"}]}]},{\"price\":1500,\"sku_merchant_code\":\"124\",\"sku_spec\":[{\"group_name\":\"尺码\",\"weight\":9,\"item_list\":[{\"item_name\":\"L\",\"img\":{\"uri\":\"xxx\",\"url\":\"xxx\"}}]},{\"group_name\":\"颜色\",\"weight\":10,\"item_list\":[{\"item_name\":\"红色\"}]}]},{\"price\":1500,\"sku_merchant_code\":\"123\",\"sku_spec\":[{\"group_name\":\"尺码\",\"weight\":9,\"item_list\":[{\"item_name\":\"XL\",\"img\":{\"uri\":\"xxx\",\"url\":\"xxx\"}}]},{\"group_name\":\"颜色\",\"weight\":10,\"item_list\":[{\"item_name\":\"红色\"}]}]}]" }, "biz_line": 1, "category_id": 5010002, "out_id": "123", "pois": [ { "poi_id": "123" } ], "product_name": "123", "product_type": 28, "product_sub_type": 2801, "sold_end_time": 1750839800, "sold_start_time": 1719822200, "telephone": ["1234-4321"] } }
响应参数
参数名称 | 参数类型 | 是否必传 | 参数描述 |
data | struct | TRUE | 响应信息 |
- error_code | int | TRUE | 错误码 |
- description | string | TRUE | 错误描述 |
- product_id | string | TRUE | 创建/更新商品成功后产生 |
extra | struct | TRUE | 响应额外信息 |
- error_code | int | TRUE | 错误码 |
- description | string | TRUE | 错误描述 |
- sub_error_code | int | TRUE | 子错误码 |
- sub_description | string | TRUE | 子错误描述 |
- now | int | TRUE | 时间戳 |
- logid | string | TRUE | 请求日志ID |
响应示例
{ "data": { "error_code": 0, "description": "success", "product_id": "111" }, "extra": { "error_code": 0, "description": "success", "sub_error_code": 0, "sub_description": "", "logid": "xxx", "now": 1651113600 } }
错误码
HTTP 状态码 | 错误码 | 错误码描述 | 排查建议 |
200 | 2100001 | 未知错误 | 重试接口,重试3次仍报错联系抖音生活服务技术支持 |
200 | 2100004 | 系统繁忙,此时请开发者稍候再试 | 重试接口,重试3次仍报错联系抖音生活服务技术支持 |
200 | 2100005 | 参数不合法 | 更换参数 |
200 | 2190002 | access_token无效 | 调用接口重新生成access_token |
200 | 2190004 | | 应用申请接口权限 |
200 | 2190008 | access_token过期,请刷新或重新授权 | 规范token刷新机制,检查是否有测试环境在同步刷新token |
200 | 2119001 | 参数不合法 | 更换参数 |
200 | 2119002 | 系统繁忙,请稍候再试 | 重试 |
200 | 2119003 | 请求太过频繁,请稍后再试 | 重试 |
200 | 2119005 | 应用未获商家授权 | 联系合作商家在商家后台发起授权,并在服务商后台同意授权 |
200 | 3000001 | 根据实际业务错误返回 | 对照接口文档规范参数并重试 |
200 | 4000001 | 根据实际业务错误返回 | 补充参数 |
200 | 4000002 | 根据实际业务错误返回 | 对照接口文档规范参数并重试 |
200 | 5000001 | 根据实际业务错误返回 | 联系抖音处理 |
