通知外部商家创单
收藏
我的收藏接口说明
抖音侧通知第三方创建点单订单。仅支持 支付前 通知第三方创单。
基本信息
Scope | life.trade.meal_retail_spi_create_order_notify | |||
权限要求 | | |||
回调场景 | |
请求头
- •Content-Type:
application/json
- •X-Bytedance-Logid: 请求 logid, 用于问题排查用
- •x-life-clientkey: 服务商应用的 client_key
- •X-life-sign: 请求签名,签名规则
请求参数
请求示例
暂时无法在飞书文档外展示此内容
{ "amount": { "pay_amount": 400, "origin_amount": 3700, "discount_amount": 3300 }, "poi_id": "7309443067524679724", "open_id": "abcde", "order_id": "1000041821083847671", "order_type": 1, "sku_list": [ { "count": 3, "sku_id": "1804571675007028", "product_id": "1804571674557450", "sku_out_id": "123412345", "item_orders": [ { "sku_specs": [ { "attr_key": "cup", "item_key": "mid_cup", "item_name": "中杯" }, { "attr_key": "sugar", "item_key": "seven", "item_name": "七分糖" }, { "attr_key": "temperature", "item_key": "cold", "item_name": "冷" } ], "item_order_id": "800000084000368998413497671", "item_relations": [ { "relate_to_id": "800000084000368896013817671", "relate_id_type": 1, "relate_to_level": 4, "relate_reason_type": 3 // 关联到团购券Item单 } ] }, { "sku_specs": [ { "attr_key": "cup", "item_key": "mid_cup", "item_name": "中杯" }, { "attr_key": "sugar", "item_key": "seven", "item_name": "七分糖" }, { "attr_key": "temperature", "item_key": "warm", "item_name": "温" } ], "item_order_id": "800000084000369024013007671", "item_relations": [ { "relate_to_id": "800000084000369075213057671", "relate_id_type": 2, "relate_to_level": 4, "relate_reason_type": 2 // 关联到小料品Item单 }, { "relate_to_id": "800000083617023385613887671", "relate_id_type": 1, "relate_to_level": 4, "relate_reason_type": 3 // 关联到团购券Item单 } ] }, { "sku_specs": [ { "attr_key": "cup", "item_key": "mid_cup", "item_name": "中杯" }, { "attr_key": "sugar", "item_key": "seven", "item_name": "七分糖" }, { "attr_key": "temperature", "item_key": "hot", "item_name": "热" } ], "item_order_id": "800000084000369049613577671", "item_relations": [ { "relate_to_id": "800000084000369126413317671", "relate_id_type": 2, "relate_to_level": 4, "relate_reason_type": 2 // 关联到小料品Item单 }, { "relate_to_id": "800000084000369100813097671", "relate_id_type": 2, "relate_to_level": 4, "relate_reason_type": 2 // 关联到小料品Item单 }, { "relate_to_id": "800000083617021977613377671", "relate_id_type": 1, "relate_to_level": 4, "relate_reason_type": 3 // 关联到团购券Item单 } ] } ], "unit_amount": 1100, "product_out_id": "zhizhiputao" }, { "count": 2, "sku_id": "1804571674714202", "product_id": "1804571674714202", "sku_out_id": null, "item_orders": [ { "sku_specs": [], "item_order_id": "800000084000369075213057671", "item_relations": [ { "relate_to_id": "800000084000369024013007671", "relate_id_type": 2, "relate_to_level": 4, "relate_reason_type": 1 // 关联到点单品Item单 } ] }, { "sku_specs": [], "item_order_id": "800000084000369100813097671", "item_relations": [ { "relate_to_id": "800000084000369049613577671", "relate_id_type": 2, "relate_to_level": 4, "relate_reason_type": 1 // 关联到点单品Item单 } ] } ], "unit_amount": 100, "product_out_id": "zzxTest09" }, { "count": 1, "sku_id": "1805349780050954", "product_id": "1805349780050954", "sku_out_id": null, "item_orders": [ { "sku_specs": [], "item_order_id": "800000084000369126413317671", "item_relations": [ { "relate_to_id": "800000084000369049613577671", "relate_id_type": 2, "relate_to_level": 4, "relate_reason_type": 1 // 关联到点单品Item单 } ] } ], "unit_amount": 200, "product_out_id": "zzx_31" } ], "account_id": "7267130009242847276", "source_order_ids": [ "1000041818479367671", "1000041710358407671", "1000041706797447671" ] }
响应参数
名称 | 类型 | 是否必填 | 描述 | 示例值 |
data | struct | 是 | | |
- error_code | int | 是 | 错误码,合法范围为 [0,999999]
| 0 |
- description | string | 是 | 错误信息 | |
- order_id | string | 是 | 抖音订单ID | "10011123" |
- order_out_id | string | 否 | 外部订单ID;创单成功时,需要返回 | "1233" |
响应示例
错误码
- •重试-最多12次
- ◦创建订单失败时,若请求未触达商家(如网络错误)或商家返回明确错误码(error_code=100)抖音会进行重试
- ◦重试策略:采用退避策略第一次间隔 5s,之后每次之间间隔 10s, 20s, 40, 60s, 60s, 60s 最多重试12次
- •幂等
- ◦为防止重试导致的重复下单,服务商可根据抖音订单 ID 做幂等处理