Place a pay-at-restaurant order
create_orderPlace an order for a diner yourself (if you cannot verify the diner by the emailed code or pay for them, use prepare_order_link and give them its order_url instead). MenuNode collects no payment: the diner pays at the restaurant / on delivery, or, with payment_method transfer (only when get_restaurant_info.ordering.payment_methods lists it), by bank transfer straight to the restaurant's account. Once the order is placed (here, or by confirm_order) a transfer object carries the account and its kind (alias, CBU/CVU, Pix key or CLABE), holder, exact amount and the reference to write; relay it to the diner (pay_first true: the kitchen waits for the money). A payment_method the location does not take fails with payment_method_not_accepted (details.accepted); details.accepted empty with online_only true means the location only takes online payment, which you cannot make for the diner: use prepare_order_link and give them its order_url to order and pay there. Requires item ids from get_menu_structured, the diner's name and email, a fulfillment type the restaurant offers (see get_restaurant_info), a table_number for dine-in, and an address + phone for delivery. When the restaurant has delivery zones (get_restaurant_info.ordering.delivery_zones) the delivery fee and minimum are computed server-side from the address (pass latitude/longitude too if the diner shared their location); an address outside every zone fails with delivery_out_of_zone (offer pickup instead) and one that cannot be found with delivery_address_not_found. Returns verification_required — if true, ask the diner for the 6-digit code emailed to them and call confirm_order. If the code email cannot be sent the call fails with code_not_sent and nothing is saved: tell the diner to try again in a few minutes or call the restaurant. An address that cannot receive mail (a made-up or reserved domain) fails with invalid_email and nothing is saved: ask for a real one. If the kitchen paused online orders the call fails with "paused" and a resume_at (ISO time) — tell the diner when to come back, do not retry before then; if the time slot is full it fails with next_slot_at — offer that time (as scheduled_for when the restaurant allows scheduling). Reservations are never paused. Some restaurants confirm pickup/delivery orders that may come from far away: the call then fails with requires_confirmation (details.reason: distance | timezone | phone | no_location) and nothing is created — ask the diner whether the order is real and for this location, then call again with far_order_confirmed true. Ordering for someone else: pass recipient_name and recipient_phone. Pass avoid when the diner says what they cannot eat, through prepare_order_link or get_menu_structured before create_order: a create_order that needs no emailed code is already placed when it answers. Health information: never tell the diner a dish is safe or free of anything, whatever the answer; pass on the note of each line (note_id and add_ons_note_id, the text in avoid_notes) and tell them to confirm with the restaurant. Add-ons carry no allergen information. The kitchen does NOT receive avoid: only the allergy of create_order, sent with allergy_consent true, reaches it.
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": {
"restaurant_slug": "<restaurant_slug>",
"items": "<items>",
"customer_name": "<customer_name>",
"customer_email": "<customer_email>",
"fulfillment": "<fulfillment>"
},
"name": "create_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| avoid | No | What the diner must avoid, the same keys as get_menu_structured's avoid. Send it only if the diner said so. A warning for the diner, never refused: every line gets one answer per key (avoid_conflicts) and the order or the link stays as it is. peanuts and tree_nuts are separate; shellfish needs crustaceans and molluscs; any other allergy has no key: send the diner to the restaurant. Not saved with the order, so the kitchen does NOT receive it: for the kitchen to know, send `allergy` with allergy_consent. | |
| items | Yes | ||
| notes | No | Order-level notes | |
| branch | No | Location of a restaurant with several (get_restaurant_info.locations[].branch, e.g. "palermo"). Omit for the main location. Hours, contact, address, ordering and reservations differ per location. | |
| allergy | No | What the diner is allergic to, for the kitchen: saved with the order and shown on the kitchen ticket, like the diner's own answer on the order page. Send it only if the diner said so, and only with allergy_consent true. keys: any of gluten, crustaceans, eggs, fish, peanuts, soy, milk, tree_nuts, celery, mustard, sesame, sulphites, lupin, molluscs (an unknown key fails with invalid_allergy); note: one line of text, at most 200 characters ("celiac, no cross-contact"). Health data: the restaurant keeps it 90 days, then it is deleted (the order stays). | |
| coupon_code | No | ||
| fulfillment | Yes | ||
| table_number | No | ||
| customer_name | Yes | ||
| scheduled_for | No | ISO datetime for a later pickup/delivery, only when get_restaurant_info.ordering.scheduling is asap_and_scheduled and within max_days_ahead; otherwise the call fails with scheduled_not_accepted (and the earliest_at/latest_at window when scheduling is allowed; reason too_soon + item when a dish needs days of notice or is sold out until tomorrow: schedule it at earliest_at or later). A preorder dish (get_menu_structured category preorder) must be scheduled on one of its delivery_dates before order_by: otherwise preorder_date (details deliveryDates, orderBy), preorder_closed after order_by, and preorder_mixed when other dishes are in the same order | |
| customer_email | Yes | ||
| customer_phone | No | ||
| payment_method | No | How the diner will pay: cash/card/qr at the restaurant or on delivery, or transfer to the restaurant's account. Must be one of get_restaurant_info.ordering.payment_methods | |
| recipient_name | No | Pickup/delivery for someone else: who receives or picks it up. Send together with recipient_phone. Seen only by the restaurant and its courier. | |
| adult_confirmed | No | When get_restaurant_info.ordering.adult_confirmation_required is true and a dish is marked contains_alcohol: true only after the diner said they are 18 or older. Otherwise the call fails with adult_confirmation_required and nothing is ordered. Dishes with alcohol inside ordering.alcohol_hours_blocked fail with alcohol_hours (details from, to, items): order without them or later (#350). | |
| allergy_consent | No | Required with `allergy`: true only after the diner explicitly agreed to share their allergy with the restaurant. allergy without allergy_consent true fails with allergy_consent_required and nothing is ordered. | |
| recipient_phone | No | Phone of recipient_name | |
| restaurant_slug | Yes | ||
| delivery_address | No | ||
| far_order_confirmed | No | Only after create_order failed with requires_confirmation (#386): the diner said yes, the order is real (a prank or the wrong branch are what the restaurant wants to avoid). Never set it without asking them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | Decimal amount as a string with 2 decimals, e.g. "14800.00" | |
| message | Yes | ||
| currency | Yes | ||
| order_id | Yes | ||
| transfer | No | ||
| avoid_notes | No | Only with `avoid`: the text of each note_id. Tell the diner the note of the dishes you mention; translate it if needed, but do not soften it. | |
| order_number | Yes | ||
| tracking_url | No | Present when the order is already placed (no verification needed) | |
| pickup_number | Yes | The short number the restaurant calls out when a pickup order is ready (1, 2, 3... per location and local day, #588): tell it to the diner. null for a table or a delivery, until the order is confirmed (email code or online payment), once it is finished, and on older orders | |
| avoid_conflicts | No | Only with `avoid`: one row per line, in the order of the lines; a line left out is not here. For the diner: it warns, never refuses, and the kitchen does NOT receive it. note_id could_not_check = the dish could not be read just now, not that the restaurant left it blank | |
| transfer_discount | No | The restaurant's discount for paying by bank transfer that this order was given, already inside total (and inside transfer.amount). null = none. It is lost, and the total goes back up, if the diner ends up paying another way | |
| verification_required | Yes | True: ask the diner for the emailed 6-digit code and call confirm_order |