• 开发者平台
  • >
  • 餐饮文档中心

快餐下单收费

(下行接口)第三方合作方调用此接口,创建点餐订单(接口中的金额都是以分为单位)

请求描述

HTTP请求方式:POST
HTTP请求头类型:Content-Type=application/json
URI:   /open/v1/snack/order/create

请求参数

1.公共参数

详情可查看【公共说明】中的公共参数模块

2.业务参数

参数名 类型 是否必填 参数描述
tpOrderId String 第三方订单号
tpSerialNumber String 第三方流水号需要小于14位,最长13位
createTime Long 订单创建时间
updateTime Long 订单更新时间
needInvoice Int 是否需要发票, 1: 需要发票, 0:不需要发票,默认0
invoiceTitle String 发票抬头,需要发票时必传
taxpayerId String 纳税人识别号,需要发票时必传
invoiceAmount Int 发票金额,若选择了开票,则发票金额必填 单位:分
shopIdenty Long 客如云门店ID
shopName String 客如云门店名称
remark String 订单备注,不支持微信特殊表情
peopleCount Int 就餐人数
totalPrice Int 总价
status Int 订单状态,1:未处理 2:已确认 目前只支持’已确认’
print Int 是否打印 1:打印 0:不打印 默认1
tables List<TableInfo > 桌台集合 (根据场景需要传桌台信息,到店自取无需传此参数)
products List<DishProduct> 菜品信息
payment SnackPayment 支付信息
customers List<Customer> 顾客信息
discountDetails List<DiscountDetail> 优惠明细

DishProduct

参数名 类型 是否必填 参数描述
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为做法此字段必填

SnackPayment

参数名 类型 是否必填 参数描述
memberId Long 会员customerId,对应登录会员与会员详情接口中的customerId(会员卡余额支付时,必填
promotionId String 券id,只能支付方式是优惠券支付的时候,才填写
memberCardNumber Int 卡号
memberPassword Int 密码,md5加密(会员卡余额支付时,必填)
totalDiscountFee Int 优惠总金额 优惠总金额=平台优惠总金额+商家优惠总金额,单位:分
totalFee Int 订单总价=商品总额,单位是分,单位:分
platformDiscountFee Int 平台优惠总金额,单位:分
shopDiscountFee Int 传discountDetails时:商家优惠总金额=商家优惠+客如云优惠券总额 单位:分 不传discountDetails时: 商家优惠
serviceFee Int 服务费 ,平台向商家收取的抽佣金额,单位:分
userFee Int 用户实付总价 ,顾客实际付款金额=订单总价-优惠总金额,单位:分
shopFee Int 商户实收总价 ,商户实际收款=订单总价-商家承担优惠金额-服务费,单位:分
payType Int 支付方式 1:会员卡余额 2:优惠券 3:订单来源支付
qrCode String 会员支付二维码 格式 会员id:token 如果传了该字段,就不会校验memberId和memberPassword

Customer

参数名 类型 是否必填 参数描述
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 , 如果优惠类型是优惠券必传,而且必须和DinnerOrderMember中至少一个id一致
description String 优惠描述

TableInfo

参数名 类型 是否必填 参数描述
tableId long 桌台id
tableName string 桌台名称
remark string 备注

业务示例(JSON)

场景一:无加料无子菜的情况

{
    "createTime":1567425360000,
    "customers":[
        {
            "gender":0,
            "id":37950727842270111,
            "name":"哈哈",
            "phoneNumber":13239373769
        }
    ],
    "discountDetails":[
        {
            "customerId":37950727842270111,
            "description":"我是优惠券描述",
            "discountFee":100,
            "discountType":3
        }
    ],
    "payment":{
        "memberId":37950727842270111,
        "memberPassword":"1111113949ba59abbe56e057f20f883e",
        "payType":1,
        "platformDiscountFee":0,
        "serviceFee":0,
        "shopDiscountFee":100,
        "shopFee":4900,
        "totalDiscountFee":100,
        "totalFee":5000,
        "userFee":4900
    },
    "peopleCount":1,
    "print":1,
    "products":[
        {
            "id":40740829341443072,
            "name":"水煮牛肉",
            "price":2500,
            "properties":[
                {
                    "id":40740829341443072,
                    "name":"五成熟",
                    "reprice":0,
                    "type":1
                }
            ],
            "quantity":1,
            "remark":"菜品备注",
            "totalFee":2500,
            "tpId":"40740829341443072",
            "unit":"份",
            "type":0
        },
        {
            "id":40740829341443072,
            "name":"水煮牛肉",
            "price":2500,
            "properties":[
                {
                    "id":40740829341443072,
                    "name":"七成熟",
                    "reprice":0,
                    "type":1
                }
            ],
            "quantity":1,
            "remark":"菜品备注",
            "totalFee":2500,
            "tpId":"40740829341443072",
            "unit":"份",
            "type":0
        }
    ],
    "remark":"备注信息",
    "shopIdenty":810094162,
    "shopName":"体验区测试品牌01体验区测试品牌01store品牌1门店3",
    "status":2,
    "totalPrice":5000,
    "tpOrderId":"68234561123412354765467890323",
    "updateTime":1567368026000
}

场景二:有加料的情况(如:点两份相同的奶茶,加料不同,那么两份奶茶的uuid需定义成不相同的,加料的商品中parentUuid分别填写需要加的奶茶的uuid)

{
    "createTime":1567425360000,
    "customers":[
        {
            "gender":0,
            "id":37950727842270111,
            "name":"哈哈",
            "phoneNumber":13239373769
        }
    ],
    "discountDetails":[
        {
            "customerId":37950727842270111,
            "description":"我是优惠券描述",
            "discountFee":100,
            "discountType":3
        }
    ],
    "payment":{
        "memberId":37950727842270111,
        "memberPassword":"1111113949ba59abbe56e057f20f883e",
        "payType":1,
        "platformDiscountFee":0,
        "serviceFee":0,
        "shopDiscountFee":100,
        "shopFee":300,
        "totalDiscountFee":100,
        "totalFee":400,
        "userFee":300
    },
    "peopleCount":1,
    "print":1,
    "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,
    "totalPrice":400,
    "tpOrderId":"68234561123412354765467890323",
    "updateTime":1567368026000
}

场景三:套餐有子菜的情况

{
    "createTime":1567425360000,
    "customers":[
        {
            "gender":0,
            "id":37950727842270111,
            "name":"哈哈",
            "phoneNumber":13239373769
        }
    ],
    "discountDetails":[
        {
            "customerId":37950727842270111,
            "description":"我是优惠券描述",
            "discountFee":100,
            "discountType":3
        }
    ],
    "payment":{
        "memberId":37950727842270111,
        "memberPassword":"1111113949ba59abbe56e057f20f883e",
        "payType":1,
        "platformDiscountFee":0,
        "serviceFee":0,
        "shopDiscountFee":100,
        "shopFee":300,
        "totalDiscountFee":100,
        "totalFee":400,
        "userFee":300
    },
    "peopleCount":1,
    "print":1,
    "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,
    "totalPrice":400,
    "tpOrderId":"68234561123412354765467890323",
    "updateTime":1567368026000
}

响应参数

参数名 类型 是否必填 参数描述
code Int 错误码;0:成功;其他详见错误码
message String 错误说明
messageUuid String 消息uuid
result Object 返回业务参数 code !=0的情况下不返回业务参数

result

参数名 类型 是否必填 参数描述
orderId String 开放平台订单id
tradeId Long 订单id
serialNumber String 序列号
pickUpNumber String 自定义取餐号

响应示例(JSON)

{
    "result": {
        "orderId": "c57d5f80e847490baa70c9f9db0860c1",
        "tradeId": 268700047959992320,
        "serialNumber": "30"
    },
    "code": 0,
    "message": "成功[OK]",
    "messageUuid": "9cf9adc0ed2746b9865fb3edf31ba423",
    "apiMessage": null
}
目录