开发者发起下单
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/api/apps/trade/v2/order/create_order
使用限制
接口说明
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/api/apps/trade/v2/order/create_order' \
--header 'access-token: clt.xxx' \
--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
}
}
],
"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"
}'
响应示例响应示例
200 - 成功示例
{
"data": {
"error_code": 0,
"description": "success",
"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
}
]
}
]
},
"extra": {
"sub_error_code": 0,
"sub_description": "success",
"logid": "2022092115392201020812109511046",
"now": 1663745962686,
"error_code": 0,
"description": "success"
}
}
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/json
access-token
string
必需
示例值:
clt.xxx
Body 参数application/json