如果用户抖音版本过低,无法使用前端 JSAPI 下单,开发者可用该接口替用户发起下单。
预下单 OpenAPI 只针对低版本(低于抖音 19.7.0,基础库 20.43.0.3 版本)使用,我们会统计此类订单占比,如果发现违规使用,会进行惩处。当低版本减少后,会下掉该接口,请不要应用于其它场景,否则会影响业务。
该接口发起的下单流程中不会有预下单回调。前端 JSAPI 下单与服务端 OpenAPI 下单的流程区别如下:
‘goods_discount_detail 字段
名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
goods_id | string | 是 | 商品 id,此处为课程 id,注意这里是 string 类型 | goods_1 |
quantity | number | 是 | 购买数量 | 1 |
total_amount | number | 是 | 商品总价,单位分 | 100 |
total_discount_amount | number | 是 | 该商品总优惠金额,该商品的实付金额 = total_amount - total_discount_amount | 20 |
marketing_detail_info | Array | 否 | 营销明细,详情见 [marketing_detail_info 字段](#_marketing_detail_info 字段) |
名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
order_total_discount_amount | number | 是 | 订单维度总优惠金额,单位分 | 10 |
goods_total_discount_amount | number | 是 | 商品(SKU)维度总优惠金额,单位分 | 10 |
marketing_detail_info | Array | 否 | 营销明细,详情见 [marketing_detail_info 字段](#_marketing_detail_info 字段) |
名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
goods_id | string | 是 | 商品 id | goods_1 |
total_amount | number | 是 | 商品总价,单位分 | 100 |
total_discount_amount | number | 是 | 该商品总优惠金额 该商品的实付金额 = total_amount - total_discount_amount | 20 |
marketing_detail_info | Array | 否 | 营销明细,详情见 [marketing_detail_info 字段](#_marketing_detail_info 字段) |
名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
id | string | 是 | 营销 id(用户身份 id、优惠券 id、积分 id 或者活动 id) | activity_id_12 |
type | number | 是 | 营销类型: 1:用户身份 2:优惠券 3: 积分 4:活动 | 4 |
discount_amount | number | 是 | 该营销策略优惠金额,单位分 | 10 |
title | string | 是 | 营销名称 | [活动] 满 10.00 减 7.00 元 |
note | string | 否 | 营销备注 | 活动优惠 |
discount_range | number | 是 | 优惠范围 | 1 |
subtype | string | 否 | 营销子类型 | 商家侧子营销类型 |
value | i64 | 否 | 不同 type 含义不同,若 type = 3,value 则为积分值 |
名称 | 类型 | 是否必填 | 描述 | 示例值 |
---|---|---|---|---|
book_type | int32 | 是 | 预约类型, 1:不需要预约 2:在线预约 | 2 |
cancel_policy | int32 | 否 | 取消政策, 1:预约后不可取消 2:预约后可取消 3:预约中可取消,预约成功须提前x小时取消 | 1 |
cancel_advance_hour | int64 | 否 | 提前取消的小时限制 | 1 |
curl --location --request POST 'http://dev-cn.your-api-server.com' \
--header 'Content-Type: application/json' \
--data-raw '{
"goods_list": [
{
"quantity": 1,
"price": 100,
"goods_title": "火锅团购",
"goods_image": "https://xxx",
"labels": "随时退|免预约",
"goods_id": "goods_1",
"goods_id_type": 2,
"discount_amount": xxx,
"date_rule": "周一至周日可用",
"goods_page": {
"path": "goods/infoxxxx",
"params":"{\"id\":\"xxxxxx\"}"
},
"order_valid_time": {
"valid_duration": 100000
},
"goods_book_info": {
"book_type": 2,
"cancel_policy": 1
},
"merchant_uid":"商户号xxx"
}
],
"total_amount": 100,
"discount_amount": 20,
"app_id": "tt07e3715e98c9aac0",
"phone_num": "19273654356",
"contact_name": "张三",
"extra": "xxx",
"open_id": "xxx",
"out_order_no": "132324",
"pay_notify_url":"https://xxxx",
"pay_expire_seconds": 500,
"order_entry_schema": {
"path":"pages/xxxindexxxx",
"params":"{\"id\":\"xxxxxx\"}"
},
"cp_extra": "xxxxx",
"price_calculation_detail": {
"calculation_type": 1,
"order_discount_detail": {
"goods_total_discount_amount": 1,
"marketing_detail_info": [
{
"discount_amount": 10,
"discount_range": 1,
"id": "activity_id_xxxxxxx",
"note": "活动优惠",
"subtype": "商家侧子营销类型",
"title": "[活动] 满 10.00 减 7.00 元",
"type": 4
},
{
"discount_amount": 10,
"discount_range": 2,
"id": "coupon_id_xxxxxxx",
"note": "用券优惠",
"subtype": "商家侧子营销类型默认值",
"title": "[券] 减 0.01 元",
"type": 2
}
],
"order_total_discount_amount": 20
},
"goods_discount_detail": [
{
"goods_id": "goods_1",
"marketing_detail_info": [
{
"discount_amount": 10,
"discount_range": 1,
"id": "activity_id_xxxxxxx",
"note": "活动优惠",
"subtype": "商家侧子营销类型默认值",
"title": "[活动] 满 10.00 减 7.00 元",
"type": 4
},
{
"discount_amount": 10,
"discount_range": 2,
"id": "coupon_id_xxxxxxx",
"note": "用券优惠",
"subtype": "商家侧子营销类型默认值",
"title": "[券] 减 0.01 元",
"type": 2
}
],
"quantity": 1,
"total_amount": 100,
"total_discount_amount": 20
}
],
"item_discount_detail": [
{
"goods_id": "goods_1",
"marketing_detail_info": [
{
"discount_amount": 10,
"discount_range": 1,
"id": "activity_id_xxxxxxx",
"note": "活动优惠",
"subtype": "商家侧子营销类型默认值",
"title": "[活动] 满 10.00 减 7.00 元",
"type": 4
},
{
"discount_amount": 10,
"discount_range": 2,
"id": "coupon_id_xxxxxxx",
"note": "用券优惠",
"subtype": "商家侧子营销类型默认值",
"title": "[券] 减 0.01 元",
"type": 2
}
],
"total_amount": 100,
"total_discount_amount": 20
}
]
}
}'\'''
{
"data": {
"order_id": "ot7072366682238",
"out_order_no": "121321432",
"pay_order_id": "12423414234",
"pay_order_token": "544352343",
"item_order_info_list": [
{
"item_order_id_list": ["ot70939408076069"],
"goods_id": "700843652",
"item_order_detail": [
{
"item_order_id": "ot70939408076069",
"price": 80
}
]
}
]
},
"err_tips": "success",
"err_no": 0
}