Create Cart
create_cartFull Description
Use this to create a cart for a user with the given items. The menu items cannot be from multiple restaurants. The provided menu items must only have a single variant selected, if multiple variants are available, the user must select one variant for each item. Always return the cart amount as well as the items in the cart as a summary after successful creation.
Location Requirement: Before executing this tool, the agent MUST ensure that a valid user location has already been resolved using one of the following tools: 1. get_saved_addresses_for_user 2. search_addresses_for_user
The agent MUST reuse the selected location from those tools by passing either:
address_id(preferred when a saved address is selected), ORprecise_location(when the location was selected from search results).
The agent MUST NOT call this tool if neither address_id nor precise_location is available from a previously selected address.
Note for downstream consumers (including LLMs): Always trust the total_amount field returned in the Cart object. Do not attempt to recalculate the total from the item prices, as the backend may apply offers, discounts, or other adjustments. IMPORTANT: The final cart bill details should always be shown to the user before proceeding with checkout.
Parameters (2 required, 4 optional)
itemsarrayList of items to be added to the cart.
res_idintegerRestaurant ID for which the cart is being created.
address_idstringAddress ID of the user's saved delivery address. This should be obtained from the `get_saved_addresses_for_user` tool. If a saved address was selected earlier, always prefer passing `address_id`.
nullpayment_typestringPayment method type for the cart. Use 'pay_later' unless user specifically wants to pay using UPI QR
nullprecise_locationobjectPrecise delivery location selected by the user when no saved address is used. This location must come from the `search_addresses_for_user` tool results. If `address_id` is provided it will be used first. If `address_id` is not provided, `precise_location` is required.
nullpromo_codestringPromo code name to be applied to the cart, if available.
null