Sandbox carts at real restaurants

SandboxBreaking

In sandbox, POST /v1/carts and the MCP order tool build a cart at a real restaurant from its menu as Layout holds it, with its real items and choices. Nothing is ordered or charged.

What changed

  • simulate picks how a sandbox cart ends: placed (the default), failed, unconfirmed, challenge, code, card_declined, price_changed, closed or pickup_later.
  • latency: realistic (the default) builds in 30 seconds for one item and 10 more for each item after it, at most 90; instant skips every wait.
  • engine: "real" builds on the restaurant's own site instead, as production does, 10 a day per developer account. The default is shadow.
  • Production refuses simulate, latency and engine with 400 invalid_request, and MCP with sandbox_only.
  • Sandbox places list only restaurants whose menu Layout holds, with at least 3 items. A search emptied for that reason carries emptyBecause: "no_held_menu".
  • Sandbox menus. POST /v1/menus and the MCP menu tool answer with the held menu, the one a sandbox cart is priced from. A restaurant without one answers 409 menu_not_held.
  • soldOut: true marks a menu item that is sold out.
  • GET /v1/usage counts these carts as simulated_builds, 10,000 a day. In sandbox, builds counts only "engine": "real".

Why it matters

You can test against the restaurants your users will order from, with every ending, in seconds.

What to do

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

Breaking changes

A sandbox cart builds on the restaurant's own 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 name test_restaurant_builds is now simulated_builds.

All changes