TOOL API
calculate-price
Description: Calculate product price (including discounts), supports dine-in pickup (orderType=1) and delivery (orderType=2) scenarios 【Required】Must determine order type first, required (1: dine-in, 2: delivery) 【Required】Must get store info first, cannot skip When: - User asks "How much for these items" - User asks "What's the total price" - User wants to know the price after applying coupon - User finished selecting items and wants to see price Preconditions: - 【Required】Must determine order type first, required (1: dine-in, 2: delivery) - 【Required】Must get store info first, cannot skip - storeCode: Store code, required - Dine-in pickup scenario: orderType=1 && beCode=null - Delivery scenario: orderType=2 && beCode is from delivery-query-address - items: Product list, required, at least one product Input: - orderType: Order type, required (1: dine-in, 2: delivery) - storeCode: Store code - Dine-in pickup scenario: orderType=1 && beCode=null - Delivery scenario: orderType=2 && beCode is from delivery-query-address - items: Product list (array) - productCode: Product code, required - quantity: Product quantity, required - couponId: Coupon ID, optional (if user wants to use coupon) - couponCode: Coupon code, optional (if user wants to use coupon) Output: - productOriginalPrice: Original product price (unit: cents) - productPrice: Current product price (unit: cents) - deliveryOriginalPrice: Original delivery fee (unit: cents) - deliveryPrice: Current delivery fee (unit: cents) - packingOriginalPrice: Original packing fee (unit: cents) - packingPrice: Current packing fee (unit: cents) - originalPrice: Original price (unit: cents) - discount: Discount amount (unit: cents) - price: Current price (unit: cents) = originalPrice - discount - productList: Product list - productCode: Product code - productName: Product name - quantity: Product quantity - originalSubtotal: Original subtotal (unit: cents) - subtotal: Subtotal (unit: cents) - takeWayList: Pickup method - code: Pickup method code - title: Pickup method title - subtitle: Pickup method subtitle On Error: - Missing required parameters: Tell user which parameters are missing - Product doesn't exist: Tell user product code is invalid - Coupon unavailable: Tell user coupon cannot be used Next: - After successful calculation: Tell user "Original product price {productOriginalPrice/100} yuan, current product price {productPrice/100} yuan, delivery fee {deliveryPrice/100} yuan, packing fee {packingPrice/100} yuan, total discount {discount/100} yuan, current price {price/100} yuan" - Guide user: "After confirming the price, say 'Create order' to place the order"
Call information
- Tool slug
- mcdonalds.calculate-price
- Provider
- McDonald's
- Average response
- 0 ms
- Calls in 7 days
- 0
Input parameters
beCodebeCode
items待价格计算的商品列表
orderType订单类型
storeCode门店code