Prepare an order link with the cart filled in
prepare_order_linkCheck a cart against today's menu and get a link to the restaurant's own order page with those dishes already in the cart (and pickup / delivery / dine-in already chosen when you pass fulfillment).The diner opens it, checks it and fills in their contact, pickup or delivery details and payment there. Nothing is ordered, saved or charged by this call and no personal data goes in, except avoid, which is not kept. Use it when you cannot verify the diner (emailed code) or pay for them; create_order is for placing the order yourself. Same lines as create_order: item_id from get_menu_structured, quantity, personalization_ids. Returns order_url (give it to the diner as is), estimated_total (the food at today's prices in currency; cover charge, delivery fee and coupons are added on the page), left_out (dishes that would not go in and why: not_on_menu, addon_unavailable, sold_out, notice = must be ordered days ahead, hours = not served right now, set_menu, preorder = only for set delivery dates (get_menu_structured category preorder; create_order scheduled on one of them, apart from other dishes), limit_reached with left = how many can still be ordered when known; absent for an online daily quota; combo = a combo or set meal sent without valid combo_option_ids (a step not answered, an option that ran out or is gone): send the option_ids from get_menu_structured combo_steps, or the diner picks on the page), accepting_now (an order for as soon as possible is taken right now) and scheduled_only (only an order for a later time is taken right now; the page offers it). Dishes are checked for right now, sections with their own hours (breakfast, lunch) included: a dish outside its section's hours is left out with hours even if the diner wants it later. The order_url has no language unless you pass language (the page then opens in the diner's own). Prices and availability are confirmed on the page. Fails with commerce_disabled where the restaurant takes no online orders (plan_required with its phone when it takes them by phone only). 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>"
},
"name": "prepare_order_link"
}
}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 put in the link and not saved, so the kitchen does NOT receive it: the diner answers the allergy question on the page or calls the restaurant. | |
| items | Yes | ||
| 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. | |
| language | No | Menu language: en | es | pt | fr. A language the restaurant does not offer falls back to its own language. | |
| fulfillment | No | Preselect pickup, delivery or dine_in on the page (one of get_restaurant_info.ordering.fulfillment_options). Omit to let the diner choose; they can change it on the page. | |
| restaurant_slug | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| currency | Yes | ||
| language | Yes | Language of the page and of the dish names | |
| left_out | Yes | ||
| order_url | Yes | The restaurant's order page with the cart filled in: give it to the diner as is | |
| 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. | |
| fulfillment | Yes | The way of ordering preselected on the page; null = the diner chooses | |
| accepting_now | Yes | An order for as soon as possible is taken right now (the verdict create_order applies, #452) | |
| lines_in_cart | Yes | ||
| scheduled_only | Yes | Only an order for a later time is taken right now (closed or past the last order, with "order for later" on); the page offers it | |
| 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 | |
| estimated_total | Yes | Food in the cart at today's prices; cover charge, delivery fee, coupons and any discount for paying by transfer (get_restaurant_info ordering.transfer_discount_percent) are applied on the page, once the diner picks how to pay |