Sandbox carts at real restaurants

SandboxBreaking

In sandbox, POST /v1/carts and the MCP order tool build a cart at a real restaurant from that restaurant’s menu as Layout holds it, with its real items and choices. No browser opens, and the same code you ship builds it.

What changed

  • simulate on a sandbox cart picks its ending: placed (the default), failed, unconfirmed, challenge, code, card_declined, price_changed, closed or pickup_later.
  • latency: realistic (the default) takes 30 seconds for one item and 10 more for each item after it, at most 90; instant skips every wait.
  • engine: shadow (the default) builds from the menu Layout holds; real builds on the restaurant’s own site, 10 a day per developer account.
  • Production refuses simulate, latency and engine with 400 invalid_request, and MCP with sandbox_only.
  • 409 menu_not_held answers a sandbox cart or menu read at a restaurant whose menu Layout does not hold, or a sandbox cart that names no place.
  • Sandbox places searches and browses list only restaurants whose menu Layout holds. A list emptied for that reason carries emptyBecause: "no_held_menu".
  • Sandbox POST /v1/menus answers only with the menu Layout holds, the one a sandbox cart is priced from, and never reads one live.
  • MCP menu is on sandbox build sessions, and answers the same way. mcp-tools.json lists the tools a sandbox session reads differently as sandboxSessionTools, and the session’s own instructions.
  • Sandbox places list a restaurant only when its held menu shows at least 3 items. An option that takes money off reads like No Rice (-$1.00).
  • soldOut: true marks a menu item that is sold out.
  • GET /v1/usage lists sandbox builds that open no browser as simulated_builds, 10,000 a day. In sandbox, builds counts only builds with "engine": "real".

What to do

Build sandbox carts with a placeId from a sandbox places search. Test each ending with simulate, and "latency": "instant" in CI. See Sandbox.

Breaking changes

A sandbox cart opens the restaurant’s site only with "engine": "real". A sandbox cart or menu read at a restaurant whose menu Layout does not hold answers menu_not_held. The GET /v1/usage pool test_restaurant_builds is renamed simulated_builds.

All changes