工具 API

calculate-price

Description: 计算商品的价格(含优惠),支持到店自提(orderType=1)和外送(orderType=2)两种场景 【强制】必须先确定订单类型,必填 (1:到店,2外送) 【强制】必须先获取门店信息,不可跳过 When: - 用户问"这些商品多少钱" - 用户问"总价是多少" - 用户想知道使用优惠券后的价格 - 用户选好商品后想看价格 Preconditions: - 【强制】必须先确定订单类型,必填 (1:到店,2外送) - 【强制】必须先获取门店信息,不可跳过 - storeCode: 门店编码,必填 - 到店自提场景: orderType=1 && beCode=null - 外送场景: orderType=2 && beCode 为delivery-query-address中的beCode - items: 商品列表,必填,至少包含一个商品 Input: - orderType: 订单类型,必填 (1:到店,2外送) - storeCode: 门店编码 - 到店自提场景: orderType=1 && beCode=null - 外送场景: orderType=2 && beCode 为delivery-query-address中的beCode - items: 商品列表(数组) - productCode: 商品编码,必填 - quantity: 商品数量,必填 - couponId: 优惠券ID,选填(如果用户要使用优惠券) - couponCode: 优惠券编码,选填(如果用户要使用优惠券) Output: - productOriginalPrice: 商品原价(单位:分) - productPrice: 商品现价(单位:分) - deliveryOriginalPrice: 运费原价(单位:分) - deliveryPrice: 运费现价(单位:分) - packingOriginalPrice: 打包费原价(单位:分) - packingPrice: 打包费现价(单位:分) - originalPrice: 原价(单位:分) - discount: 优惠金额(单位:分) - price: 现价(单位:分)= originalPrice - discount - productList: 商品列表 - productCode: 商品编码 - productName: 商品名称 - quantity: 商品数量 - originalSubtotal: 商品原小计 单位分 - subtotal: 商品小计 单位分 - takeWayList: 取餐方式 - code: 取餐方式编码 - title: 取餐方式标题 - subtitle: 取餐方式副标题 On Error: - 缺少必填参数时:提示用户缺少哪些参数 - 商品不存在时:提示用户商品编码无效 - 优惠券不可用时:提示用户优惠券无法使用 Next: - 计算成功后:告知用户"商品原价 {productOriginalPrice/100}元,商品现价 {productPrice/100}元,运费 {deliveryPrice/100}元,打包费 {packingPrice/100}元,总优惠 {discount/100}元,现价 {price/100}元" - 引导用户:"确认价格后,可以说'创建订单'进行下单"

ecommerce1 积分

调用信息

工具标识
mcdonalds.calculate-price
服务提供方
麦当劳
平均响应
0 ms
近 7 天调用
0

输入参数

beCode

beCode

items

待价格计算的商品列表

orderType

订单类型

storeCode

门店code