Docs corrections

Docs

We read every reference page against the code that runs it and corrected about 140 statements. Most fill in limits and refusals that were not written down. The ones below change what an integration should do.

What to do

  • Totals. An order's and a webhook's total_minor is the restaurant's total without Layout's fee. Show the cart's totalMinor before confirm and the order's amounts.charged_minor after. Never confirm with total_minor. See Confirm.
  • A failed order. Do not tell the person "nothing was charged" on every failure: a pending hold can show for a while. Retry only on the failure codes that say a retry can work. See Failure codes.
  • When a code is needed. A build grant's confirm needs the person's code when Layout would ask for one anywhere else, and on the first order of a person who connected before Layout asked for their agreement at connect. Read codeReason on the cart. See When the answer is code_required.
  • Sandbox codes. Sandbox asks for a code only at test_place_code, whose code is 000000. See Sandbox.
  • Unconfirmed orders over MCP. The placement poll answers unconfirmed, never failed. Never retry it. See MCP.
  • Building over MCP. A build needs query and a restaurant name with near or geo; a placeId alone is refused. A build session cancels only with an orderId. See MCP tools.
  • Location. near takes a city or town name, and distances are measured from its centre, not from the person. A neighbourhood or landmark is usually not placed: send coordinates. See Finding the nearest store.
  • Silent sign-in. prompt=none can also answer unauthorized_client or invalid_target, which showing the button will not fix, and always answers consent_required to a localhost redirect. See Returning people.
  • Testing with your own account. Before your application is approved, your own Layout account cannot connect to your client. Test with a sign-in test account. See Authentication.

Breaking changes

None. Nothing in the API changed with these corrections; the pages now describe what it already does.

All changes