下单 #
描述 #
使用此接口提交订单。
接口说明 #
授权对象 APP
请求地址 POST /open/cps/order
请求规则 请查阅开发必读
请求参数 #
参数名称 | 变量名称 | 参数类型[长度限制] | 是否必填 | 描述 |
---|---|---|---|---|
商品ID列表 | goods_ids | uint32[] | 是 | body 示例值:[1001, 1002] |
商品数量列表 | quantity_list | uint32[] | 是 | body与商品ID列表一一对应 示例值:[1, 2] |
SKU列表 | sku_list | uint32[] | 否 | body与商品ID列表一一对应 示例值:[2001, 2002] |
加料列表 | attach_list | string[] | 否 | body加料ID列表,格式:商品索引_加料ID 示例值:["0_3001", "1_3002"] |
加料数量列表 | attach_quantity_list | string[] | 否 | body与加料列表一一对应 示例值:["1", "2"] |
商户ID | id | uint32 | 是 | body 示例值:12345 |
订单类型 | order_type | int32 | 否 | body0:打包 3:堂食 示例值:0 |
备注 | remark | string[500] | 否 | body 示例值:不要辣 |
手机号 | mobile | string | 否 | body 示例值:13800138000 |
订单号 | order_number | string | 是 | body预下单返回的订单号 示例值:CPS202501190001 |
请求示例 #
{
"goods_ids": [1001, 1002],
"quantity_list": [1, 2],
"sku_list": [2001, 2002],
"attach_list": ["0_3001", "1_3002"],
"attach_quantity_list": ["1", "2"],
"id": 12345,
"order_type": 0,
"remark": "不要辣",
"mobile": "13800138000",
"order_number": "CPS202501190001"
}
响应参数 #
参数名称 | 变量名称 | 参数类型 | 是否必填 | 描述 |
---|---|---|---|---|
订单号 | order_number | string | 是 | 示例值:CPS202501190001 |
交易号 | transaction_id | string | 是 | 示例值:4200001234202501195382031234 |
订单金额 | amount | double | 是 | 单位:元 示例值:99.9 |
支付链接 | pay_url | string | 是 | 示例值:https://wx.tenpay.com/pay.html |
响应示例 #
{
"order_number": "CPS202501190001",
"transaction_id": "4200001234202501195382031234",
"amount": 99.9,
"pay_url": "https://wx.tenpay.com/pay.html"
}