(下行接口)第三方合作方调用此接口,创建点餐订单
HTTP请求方式:POST
HTTP请求头类型:Content-Type=application/json
URI: /open/v1/dinner/order/create
详情可查看【公共说明】中的公共参数模块
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| shopIdenty | Long | 是 | 客如云门店ID |
| shopName | String | 是 | 客如云门店名称 |
| tpOrderId | String | 是 | 第三方订单号 |
| status | Int | 是 | 订单状态,订单状态为“已确认”则无需pos同意/拒绝,且会触发打印;否则需要pos进行同意/拒绝操作 1:未处理 2:已确认 默认1 |
| productCategorySize | Int | 是 | 商品种数 |
| totalPrice | Int | 是 | 菜品总额 单位:分 |
| discountAmount | Int | 是 | 优惠总额 无优惠传0,有优惠时为正数 单位:分 |
| userFee | Int | 是 | 顾客实付=销售金额-优惠金额 单位:分 |
| remark | String | 否 | 订单备注,不支持emoji |
| createTime | Long | 是 | 订单创建时间 |
| peopleCount | Int | 是 | 就餐人数 |
| Int | 否 | 是否打印 1:打印 0:不打印 默认1 | |
| products | List<DinnerDishProduct> | 是 | 商品信息 |
| tables | List<TableInfo > | 是 | 桌台信息 |
| customers | List<DinnerOrderMember> | 是 | 顾客信息 |
| discountDetails | List<DiscountDetail> | 是 | 优惠明细 |
| surcharges | List<Surcharge> | 是 | 附加费信息 |
DinnerDishProduct
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| tpId | String | 是 | 合作方菜品ID(第三方自定义) |
| id | Long | 是 | 客如云菜品ID |
| parentUuid | String | 否 | 套餐的子菜或单菜加料的父级uuid(即开发者自定义的订单中菜品唯一标识),如果是套餐子菜或单菜加料才有此值,单菜此字段不传 |
| uuid | String | 否 | 订单中菜品的唯一标识,开发者自定义。如果菜品有加料或子菜,才需要传入此值,单菜无加料此值不传 |
| type | Integer | 是 | 菜品类型 : 菜品种类 0:单菜 1:套餐 2:加料。不填默认唯0,套餐子菜请填0 |
| name | String | 是 | 菜品名称 |
| unit | String | 是 | 菜品单位 |
| properties | List<ProductProperty> | 是 | 商品信息 |
| price | int | 是 | 菜品价格 单位:分 |
| quantity | int | 是 | 份数 |
| totalFee | int | 是 | 菜品总价==(菜品单价 + 变价) * 菜品数量,单位:分 |
| remark | string | 否 | 菜品备注 |
ProductProperty
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| name | string | 是 | 菜品属性名称 |
| id | long | 否 | 菜品属性ID, 为空就匹配名字,名字也无法匹配则放到备注 |
| type | int | 是 | 属性类型1:做法 2:标签 3:备注 4:规格 |
| reprice | int | 是 | 变价, 单位:分,正数加价,负数减价,type为做法此字段必填 |
TableInfo
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| tableId | long | 是 | 桌台id,通过查询桌台信息接口获取 |
| tableName | string | 是 | 桌台名称 |
| remark | string | 否 | 备注 |
DinnerOrderMember
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| id | string | 否 | 会员customerId |
| phoneNumber | string | 是 | 会员电话 |
| name | string | 是 | 会员姓名 |
| gender | int | 是 | 会员性别 |
DiscountDetail
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| discountType | int | 是 | 优惠类型 1:客如云优惠券 2:平台优惠 3:商户优惠 4:会员特价 |
| discountFee | int | 是 | 优惠金额 |
| promotionId | long | 否 | 优惠活动或者优惠券id,如果优惠类型是优惠券必传,通过券模版获取 |
| couponId | long | 否 | 优惠券模板id, 如果优惠类型是优惠券必传 |
| customerId | long | 否 | 会员customerId, 如果优惠类型是优惠券必传,而且必须和customers 中至少一个id一致 |
| description | string | 否 | 优惠描述 |
Surcharge 附加费
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| surchargeId | Long | 是 | 附加费ID |
| surchargeType | Integer | 是 | 附加费类型,1:服务费,2:桌台费,3:餐具费,9:餐盒费 |
| amount | Integer | 是 | 附加费金额,分 |
| surchargeName | String | 是 | 附加费名称 |
场景一:无加料无子菜的情况
{
"createTime":1567477463000,
"customers":[
{
"gender":0,
"id":37950727842270123,
"name":"张三",
"phoneNumber":13239373760
}
],
"discountAmount":0,
"discountDetails":[
{
"couponId":80977362259301376,
"customerId":1573,
"description":"我是优惠券描述",
"discountFee":0,
"discountType":3
}
],
"peopleCount":1,
"print":1,
"productCategorySize":2,
"products":[
{
"id":40740829341443072,
"name":"水煮牛肉",
"price":2500,
"properties":[
{
"id":40740829341443072,
"name":"水煮牛肉",
"reprice":0,
"type":1
}
],
"quantity":1,
"remark":"菜品备注",
"totalFee":2500,
"tpId":"40740829341443072",
"unit":"份"
},
{
"id":248921597135188992,
"name":"大波浪薯片2",
"price":2500,
"quantity":1,
"remark":"菜品备注哈哈",
"totalFee":2500,
"tpId":"23245",
"unit":"份"
}
],
"remark":"备注信息",
"shopIdenty":810094162,
"shopName":"体验区测试品牌01体验区测试品牌01store品牌1门店3",
"status":2,
"tables":[
{
"remark":"我是桌台备注",
"tableId":114430334904879104,
"tableName":"桌台009"
}
],
"totalPrice":5000,
"tpOrderId":"40712345678123456342315ui67890",
"userFee":5000
}
场景二:有加料的情况(如:点两份相同的奶茶,加料不同,那么两份奶茶的uuid需定义成不相同的,加料的商品中parentUuid分别填写需要加的奶茶的uuid)
{
"createTime":1567477463000,
"customers":[
{
"gender":0,
"id":37950727842270123,
"name":"张三",
"phoneNumber":13239373760
}
],
"discountAmount":0,
"discountDetails":[
{
"couponId":80977362259301376,
"customerId":1573,
"description":"我是优惠券描述",
"discountFee":0,
"discountType":3
}
],
"peopleCount":1,
"print":1,
"productCategorySize":2,
"products":[
{
"name": "满满鲜奶茶",
"id": 218063455586880512,
"tpId":"24242",
"uuid":12345,
"quantity":1,
"price":200,
"type":0,
"packagePrice":0,
"packageQuantity":0,
"totalFee":200,
"properties":[
{
"name":"五分甜",
"type":1,
"reprice":0
}, {
"name":"常温 ",
"type":1,
"reprice":0
}
]
},
{
"name": "满满鲜奶茶",
"id": 218063455586880512,
"tpId":"24242",
"uuid":123456,
"quantity":1,
"price":200,
"type":0,
"packagePrice":0,
"packageQuantity":0,
"totalFee":200,
"properties":[
{
"name":"五分甜",
"type":1,
"reprice":0
}, {
"name":"常温",
"type":1,
"reprice":0
}
]
},
{ "name": "加料1",
"id": "",
"tpId":"24242",
"parentUuid":123456,
"quantity":1,
"price":0,
"type":2,
"packagePrice":0,
"packageQuantity":0,
"totalFee":0},
{ "name": "配料1",
"id": "",
"tpId":"24242",
"parentUuid":12345,
"quantity":1,
"price":0,
"type":2,
"packagePrice":0,
"packageQuantity":0,
"totalFee":0}
],
"remark":"备注信息",
"shopIdenty":810094162,
"shopName":"体验区测试品牌01体验区测试品牌01store品牌1门店3",
"status":2,
"tables":[
{
"remark":"我是桌台备注",
"tableId":114430334904879104,
"tableName":"桌台009"
}
],
"totalPrice":400,
"tpOrderId":"40712345678123456342315ui67890",
"userFee":400
}
场景三:套餐有子菜的情况
{
"createTime":1567477463000,
"customers":[
{
"gender":0,
"id":37950727842270123,
"name":"张三",
"phoneNumber":13239373760
}
],
"discountAmount":0,
"discountDetails":[
{
"couponId":80977362259301376,
"customerId":1573,
"description":"我是优惠券描述",
"discountFee":0,
"discountType":3
}
],
"peopleCount":1,
"print":1,
"productCategorySize":2,
"products":[
{
"name": "满满鲜奶茶",
"id": 218063455586880512,
"tpId":"24242",
"uuid":12345,
"quantity":1,
"price":200,
"type":1,
"packagePrice":0,
"packageQuantity":0,
"totalFee":200,
"properties":[
{
"name":"五分甜",
"type":1,
"reprice":0
}, {
"name":"常温 ",
"type":1,
"reprice":0
}
]
},
{
"name": "满满鲜奶茶",
"id": 218063455586880512,
"tpId":"24242",
"uuid":123456,
"quantity":1,
"price":200,
"type":1,
"packagePrice":0,
"packageQuantity":0,
"totalFee":200,
"properties":[
{
"name":"五分甜",
"type":1,
"reprice":0
}, {
"name":"常温",
"type":1,
"reprice":0
}
]
},
{ "name": "加料1",
"id": "",
"tpId":"24242",
"parentUuid":123456,
"quantity":1,
"price":0,
"type":0,
"packagePrice":0,
"packageQuantity":0,
"totalFee":0},
{ "name": "配料1",
"id": "",
"tpId":"24242",
"parentUuid":12345,
"quantity":1,
"price":0,
"type":0,
"packagePrice":0,
"packageQuantity":0,
"totalFee":0}
],
"remark":"备注信息",
"shopIdenty":810094162,
"shopName":"体验区测试品牌01体验区测试品牌01store品牌1门店3",
"status":2,
"tables":[
{
"remark":"我是桌台备注",
"tableId":114430334904879104,
"tableName":"桌台009"
}
],
"totalPrice":400,
"tpOrderId":"40712345678123456342315ui67890",
"userFee":400
}
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| code | int | 是 | 错误码;0:成功;其他详见错误码 |
| message | string | 是 | 错误说明 |
| messageUuid | string | 是 | 消息uuid |
| result | object | 否 | 返回业务参数 code !=0的情况下不返回业务参数 |
result
| 参数名 | 类型 | 是否必填 | 参数描述 |
|---|---|---|---|
| orderId | string | 是 | 开放平台订单id |
| tradeId | String | 是 | 订单ID |
| serialNumber | String | 是 | 序号 |
{
"result": {
"orderId": "c57d5f80e847490baa70c9f9db0860c1",
"tradeId": 268700047959992320,
"serialNumber": "30"
},
"code": 0,
"message": "成功[OK]",
"messageUuid": "9cf9adc0ed2746b9865fb3edf31ba423",
"apiMessage": null
}