预下单 #

描述 #

使用此接口进行商品预下单,获取订单金额等信息。

接口说明 #

授权对象 APP

请求地址 POST /open/cps/prepareOrder

请求规则 请查阅开发必读

请求参数 #

参数名称 变量名称 参数类型[长度限制] 是否必填 描述
商品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列表,多个加料用逗号分隔

示例值:["3001,3002", "4532,3002"]

加料数量列表 attach_quantity_list string[] body与加料列表一一对应,多个加料数量用逗号分隔

示例值:["1,1", "2,1"]

商户ID id uint32 body

示例值:12345

订单类型 order_type int32 body0:打包 3:堂食

示例值:0

备注 remark string[500] body

示例值:不要辣

手机号 mobile string body

示例值:13800138000

请求示例 #

{
  "goods_ids": [1001, 1002],
  "quantity_list": [1, 2],
  "sku_list": [2001, 2002],
  "attach_list": ["3001,3002", "4532,3002"],
  "attach_quantity_list": ["1,1", "2,1"],
  "id": 12345,
  "order_type": 0,
  "remark": "不要辣",
  "mobile": "13800138000"
}

响应参数 #

参数名称 变量名称 参数类型 是否必填 描述
商品信息 goods object[] 商品信息列表

商品信息 goods #

参数名称 变量名称 参数类型 是否必填 描述
商品ID id uint32

示例值:1001

商品标题 title string

示例值:不二云微奶茶

商品图片 thumb string

示例值:https://bool.dev/images/products/milk-tea.jpg

商品数量 goods_count uint32

示例值:1

商品总价 total_price double

示例值:24

商品单价 price double

示例值:24

规格信息 standard string

示例值:大杯+乌龙茶

加料信息 attach string

示例值:珍珠,椰果

原价 original_price double

示例值:27

支付价格 pay_price double

示例值:24

进货价 purchase_price double

示例值:13

商品重量 weight double 单位:克

示例值:500

商户ID types uint32

示例值:1001

下单标识 enough_type int32 0:可以下单 1:不可下单

示例值:0

响应示例 #

{
  "code": 200,
  "msg": "success",
  "data": {
    "goods": [
      {
        "id": 1001,
        "title": "不二云微奶茶",
        "thumb": "https://bool.dev/images/products/milk-tea.jpg",
        "goods_count": 1,
        "total_price": 24,
        "price": 24,
        "standard": "大杯+乌龙茶",
        "attach": "珍珠,椰果",
        "original_price": 27,
        "pay_price": 24,
        "purchase_price": 13,
        "weight": 500,
        "types": 1001,
        "enough_type": 0
      }
    ]
  }
}
上次更新: 2/21/2025, 3:53:48 PM