场景 如果是先吃后付情况下,已下单、待付款状态下的订单,可以进行管理员结算结账

1.餐饮 - 结算

说明 无论是系统优惠,直接更改金额,直接打折,要进行结算(订单状态必须是待商家接单)必须先调用该接口;结算可以选择任意下单人(给该订单加过菜);付款方式除了当面付,其他方式都会进行积分、分销等营销方式结算

接口

POST https://open.jisuapp.cn/business/Order/Calulate/

请求参数说明

Content-Type: application/x-www-form-urlencoded

参数 类型 必填 说明
access_token String Y 用户授权的唯一票据
order_id String Y 主订单id
buyer_id String N 选择下单人的用户凭证(user_token),默认选择下单人
people_num int Y 就餐人数
is_balance String Y 是否使用储值抵扣,0->否,1->是
selected_benefit object N 选择何种优惠方式,这里传递优惠方式整个数据结构
voucher_coupon_goods_info object N 如果优惠方式是兑换券,需要传递兑换券的结构信息

返回参数

参数 类型 说明
status int 状态码 0成功 1失败
order_amount_price string 应付总额
tissue_fee string 纸巾费
server_fee string 服务费
box_fee string 餐盒费
original_price string 商品总价(如果是营销工具,则是活动价,比如秒杀价)
total_original_price string 商品总价(商品原价)
buyer_list array 买家列表
can_use_benefit object 可优惠的方式
selected_benefit_info object 当前选择的优惠方式
total_original_price string 商品总价(商品原价)
discount_cut_price string 优惠方式优惠的金额
use_balance string 储值抵扣金额
balance string 用户当前的储值总额
goods_info array 该订单的商品结构
price string 实付价格

返回参数具体解析

buyer_list结构:
    buyer_id: 用户凭证(user_token)
    nickname: 用户昵称
    phone: 用户手机号
    cover_thumb: 用户头像

can_use_benefit结构:
    可选择的优惠方式只需要考虑data结构和selected_index字段,data是该订单用户可使用的优惠方式,selected_index代表当前选择的是data结构的具体数据下标。

goods_info结构:
    对于先吃后付来说,每次加菜生成一个小订单,该结构在结算时会格式化成前端可直接渲染的数据结构。除了管理员加菜,小程序用户端每次加菜都会在第一层数组里多加一个,代表是新的小订单。每个小订单里边,会构成以 goods_list(商品信息)和buyer_info(买家信息)包含的买家层级的数据结构。页面的渲染逻辑是每一层小订单下包裹每个用户层级下的所有商品。

    buyer_info结构:
       from_admin: 1->管理员小订单(管理员小订单有且只有一个)

传参实例:
    order_id: 5d3561f641e3f706347137
    buyer_id: ef43b3d9729843c8ce9e0c2e48b760f3
    people_num: 1
    is_balance: 1
    selected_benefit[vip_id]: 321299
    selected_benefit[discount_title]: vip2-打8折(打8.00折)
    selected_benefit[discount_price]: 2.20
    selected_benefit[discount]: 8.00
    selected_benefit[value]: 8.00
    selected_benefit[name]: vip2-打8折
    selected_benefit[title]: vip2-打8折(打8.00折)
    selected_benefit[logo]: https://develop.zhichiwangluo.com/zhichi_frontend/static/webapp/images/vip-card/group-2.png
    selected_benefit[app_name]: FatFitm5Tm
    selected_benefit[is_free_postage]: 0
    selected_benefit[discount_type]: vip

参数返回示例

{
    "status": 0,
    "data": {
        "price": "0.00",
        "least_cost": null,
        "original_price": "11.00",
        "total_original_price": "11.00",
        "group_buy_discount_price": "0.00",
        "store_benefit_info": null,
        "express_fee": "0.00",
        "use_balance": "20.80",
        "balance": "9949.00",
        "discount_cut_price": "2.20",
        "can_use_benefit": {
            "vip_benefit": {
                "vip_id": "321299",
                "discount_title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
                "discount_price": "2.20",
                "discount": "8.00",
                "value": "8.00",
                "name": "vip2-\u62538\u6298",
                "title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
                "logo": "https:\/\/develop.zhichiwangluo.com\/zhichi_frontend\/static\/webapp\/images\/vip-card\/group-2.png",
                "app_name": "FatFitm5Tm",
                "is_free_postage": "0",
                "discount_type": "vip"
            },
            "coupon_benefit": [],
            "integral_benefit": [],
            "all_vip_benefit": [{
                "vip_id": "321299",
                "discount_title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
                "discount_price": "2.20",
                "discount": "8.00",
                "value": "8.00",
                "name": "vip2-\u62538\u6298",
                "title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
                "logo": "https:\/\/develop.zhichiwangluo.com\/zhichi_frontend\/static\/webapp\/images\/vip-card\/group-2.png",
                "app_name": "FatFitm5Tm",
                "is_free_postage": "0",
                "discount_type": "vip"
            }],
            "max_can_use_integral": 0,
            "data": [{
                "vip_id": "321299",
                "discount_title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
                "discount_price": "2.20",
                "discount": "8.00",
                "value": "8.00",
                "name": "vip2-\u62538\u6298",
                "title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
                "logo": "https:\/\/develop.zhichiwangluo.com\/zhichi_frontend\/static\/webapp\/images\/vip-card\/group-2.png",
                "app_name": "FatFitm5Tm",
                "is_free_postage": "0",
                "discount_type": "vip"
            }],
            "selected_index": 0
        },
        "selected_benefit_info": {
            "is_free_postage": "0",
            "discount_type": "vip",
            "vip_id": "321299",
            "benefit_type": 1,
            "type": 1,
            "condition": 0,
            "name": "vip2-\u62538\u6298",
            "title": "vip2-\u62538\u6298\uff08\u62538.00\u6298\uff09",
            "value": "8.00",
            "discount": 11,
            "discount_cut_price": 2.2
        },
        "goods_info": [
            [{
                "goods_list": [{
                    "id": "28363",
                    "goods_id": "28363",
                    "price": "11.00",
                    "stock": "1",
                    "goods_name": "\u8d2d\u4e70\u8d60\u9001\u6307\u5b9a\u5151\u6362\u5238\u5546\u54c1",
                    "is_integral": "-1",
                    "cover": "https:\/\/img.alicdn.com\/imgextra\/TB1aWwwgzQnBKNjSZSgL6RHGXXa_q90.jpg",
                    "model": "31",
                    "model_name": ["\u989c\u8272\u5206\u7c7b"],
                    "model_value": ["N°1 \u6b63\u5bab\u8272"],
                    "max_can_use_integral": "0",
                    "model_id": "504968",
                    "num": 1,
                    "sub_shop_app_id": null,
                    "related_shop_app_id": null,
                    "buyer_id": "ef43b3d9729843c8ce9e0c2e48b760f3",
                    "is_seckill": 2,
                    "group_buy_discount_price": 0,
                    "dis_group_discount_price": 0,
                    "mass": "0.000",
                    "volume": "0.000",
                    "express_rule_id": "0",
                    "box_fee": 0,
                    "original_price": "11.00",
                    "delivery_id": 0,
                    "presell_activity_id": null,
                    "is_presell": 0,
                    "is_vip_goods": 0,
                    "bargain": "0.00",
                    "use_integral": 0
                }],
                "buyer_info": {
                    "buyer_id": "ef43b3d9729843c8ce9e0c2e48b760f3",
                    "nickname": "\u6df1\u5733\u571f\u5305\u5b50-\u963f\u78ca\ud83d\udca8\ud83d\udca8\ud83d\udca8",
                    "phone": "",
                    "cover_thumb": "https:\/\/wx.qlogo.cn\/mmopen\/vi_32\/Q0j4TwGTfTK0G3cibDykvgCK3v5zEPvzfxh9V4nKlwtOrNT2V7jNCfIicXj1LI36J5s1R4MvG4otWjf46OYskAaw\/132",
                    "from_admin": 0
                }
            }]
        ],
        "box_fee": "0.00",
        "deliver_fee": "0.00",
        "tissue_fee": "3.00",
        "server_fee": "9.00",
        "deliver_time": 0,
        "min_deliver_fee": 0,
        "is_take_deliver": 0,
        "address": {
            "id": "851",
            "buyer_id": "ef43b3d9729843c8ce9e0c2e48b760f3",
            "address_info": {
                "name": "\u5347\u78ca\u540c\u57ce\u5730\u5740",
                "contact": "13620190416",
                "country": {
                    "text": "\u4e2d\u56fd",
                    "id": "1"
                },
                "province": {
                    "text": "\u5e7f\u4e1c\u7701",
                    "id": "19"
                },
                "city": {
                    "text": "\u6cb3\u6e90\u5e02",
                    "id": "244"
                },
                "district": {
                    "text": "\u6e90\u57ce\u533a",
                    "id": "2216"
                },
                "detailAddress": "666\u73a9\u5177\u57ce",
                "sex": "1",
                "label": "3",
                "regionInfoText": "\u5e7f\u4e1c\u7701\u6cb3\u6e90\u5e02\u6e90\u57ce\u533a",
                "address": "\u5e7f\u4e1c\u7701\u6cb3\u6e90\u5e02\u6e90\u57ce\u533a\u57d4\u524d\u9547\u9ad8\u65b0\u533a\u6280\u672f\u5f00\u53d1\u533a\u9ad8\u57d4\u5c0f\u5b66",
                "address_id": "851"
            },
            "add_time": "1555398415",
            "is_default": "0",
            "latitude": "23.733969",
            "longitude": "114.702517",
            "pick_up_type": null,
            "oversea": "0"
        },
        "line_up_data": {
            "line_up_type_data": [],
            "line_up_count_info": []
        },
        "intra_city_status_data": null,
        "self_delivery_status_data": null,
        "dining_status_data": {
            "in_business_time": 1
        },
        "server_time": 1563780618,
        "total_bargain": "0.00",
        "total_final_payment": "0.00",
        "final_payment_start_time": 0,
        "final_payment_end_time": 0,
        "buyer_list": [{
            "buyer_id": "ef43b3d9729843c8ce9e0c2e48b760f3",
            "nickname": "\u6df1\u5733\u571f\u5305\u5b50-\u963f\u78ca\ud83d\udca8\ud83d\udca8\ud83d\udca8",
            "phone": "",
            "cover_thumb": "https:\/\/wx.qlogo.cn\/mmopen\/vi_32\/Q0j4TwGTfTK0G3cibDykvgCK3v5zEPvzfxh9V4nKlwtOrNT2V7jNCfIicXj1LI36J5s1R4MvG4otWjf46OYskAaw\/132"
        }],
        "order_amount_price": "23.00",
        "people_num": 1,
        "buyer_id": "ef43b3d9729843c8ce9e0c2e48b760f3",
        "vip_cut_price": "0.00",
        "is_vip_order": 0,
        "self_pay_on_delivery": 0,
        "is_pay_on_delivery": 1
    }
}

2.餐饮 - 确认生成待支付订单

说明 待支付订单之前都可以随意修改下单人和优惠方式等,生成了待支付订单则不允许再进行结算,只能支付

接口

POST https://open.jisuapp.cn/business/Order/ConfirmOrder/

请求参数说明

Content-Type: application/x-www-form-urlencoded

参数 类型 必填 说明
access_token String Y 用户授权的唯一票据
order_id String Y 主订单id
buyer_id String Y 选择下单人的用户凭证(user_token)
people_num int Y 就餐人数
is_balance String Y 是否使用储值抵扣,0->否,1->是
selected_benefit object N 选择何种优惠方式,这里传递优惠方式整个数据结构
voucher_coupon_goods_info object N 如果优惠方式是兑换券,需要传递兑换券的结构信息
benefit_type int N 1->系统优惠,2->直接修改价格,3->直接打折
discount_value string N 直接修改的价格或折扣
offline_payment_id int N 线下支付方式,1:微信,2:支付宝,3:当面付,4:现金,5:其他

返回参数

参数 类型 说明
status int 状态码 0成功 1失败

3.餐饮 - 管理员支付订单

说明 管理员支付待付款订单,小程序端生成的先吃后付待付款订单也能使用该接口支付

接口

POST https://open.jisuapp.cn/business/Order/PayOrder/

请求参数说明

Content-Type: application/x-www-form-urlencoded

参数 类型 必填 说明
access_token String Y 用户授权的唯一票据
order_id String Y 主订单id

返回参数

参数 类型 说明
status int 状态码 0成功 1失败

results matching ""

    No results matching ""