Place an order
place_orderPlace an order against the agent_session_id from start_order_session. Atomically inserts the order + items, applies server-side canonical pricing + tax (do NOT trust the unit_price you compute — we re-read it from D1), decrements inventory and optionally redeems a promo code. The guest pays at the venue (payment_status 'unpaid'). At a venue that takes payment before preparing (pay_first: true) the order is held as 'awaiting' and payment_url is returned: give it to the guest — they pay on the restaurant's own checkout, exactly like a guest ordering from the table; the kitchen gets the order once it is paid, and an unpaid order expires. This tool never charges anything itself. Options (size, doneness, extras …): get_restaurant_menu lists each dish's option_groups; send the chosen option ids per line as modifier_option_ids — each option's price_delta is added to the dish price on the server. A group with required: true needs at least max(1, min_select) of its options and no group takes more than max_select. A line that breaks this is refused and nothing is ordered: modifier_required (a required group left empty), modifier_too_many, modifier_unknown_option (an id the dish does not offer), modifier_malformed (not a list of option ids); the error data names the product_id and group_id. Ask the guest, or leave that dish out. Returns order_id, total_cents (tax-inclusive), currency, promo_discount and, when pay_first, payment_url. Idempotency-Key header REQUIRED.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent_session_id": "<agent_session_id>",
"items": "<items>"
},
"name": "place_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Optional order-level note (max 500 chars). | |
| items | Yes | ||
| table_id | No | Optional table id when ordering at a table. | |
| guest_name | No | Optional guest name shown to staff with the order. | |
| order_type | No | Channel: 'dine_in' (default — at a table) or 'takeaway' (pickup; requires customer_name + customer_phone, ignores table_id, only when the restaurant has takeaway enabled — else channel_not_available). Delivery is not offered to agents. | |
| promo_code | No | Optional promo code to redeem at order time (validate first with apply_promo). The redemption slot is consumed only when this order lands. | |
| customer_name | No | Required for takeaway — who picks the order up. | |
| customer_phone | No | Required for takeaway — reachable phone (digits, +, spaces/dashes tolerated). | |
| agent_session_id | Yes |