Week of October 19
wrong_credential
A real credential of the wrong kind now answers 403 wrong_credential, with a message that names what to send: your secret key on an endpoint that acts for a person (carts, places, menus, images, the profile), or a build grant on an endpoint that takes your secret key (/v1/users, /v1/events, /v1/usage). It used to be 401 unauthorized. A credential Layout does not recognise is still 401 unauthorized. See Every error code.
grant_expired
An expired build grant now answers 401 with error.code grant_expired, and WWW-Authenticate carries error_description="grant_expired". Mint a new grant with POST /v1/users/:id/grant. A revoked grant still answers 401 unauthorized. mcp.layout.link answers the same way. See Refusals.
Expired carts
A ready cart nobody confirmed before expiresAt now ends on its own. The cart reads expired with failure.code CART_EXPIRED, and its order reads failed with failure_code CART_EXPIRED, where it was OUR_TIMEOUT. Its confirm is 409 cart_closed, and nothing is charged. You need not cancel it. Build again with a new key. See GET /v1/carts/:id.
Store names
- On
POST /v1/cartsand/answer, every word ofrestaurantNamemust appear in the store's name or address. A word the store does not carry, such as another branch, is409 store_mismatch. - A name that matches no store is
409 store_not_found, notstore_ambiguous. Itscandidatesare other stores; send one only if the person says it is the one they meant. - After
store_ambiguous, send theplaceIdthe person picked with the name you first sent. It is neverstore_mismatch.
See POST /v1/carts.
Answered carts
Once a cart's question is answered, that cart reads closed with replacedBy, the cart the answer started. An answer under a second key is 409 answer_not_needed and starts nothing. Confirming the answered cart is 409 cart_closed with error.replacedBy, where it was cart_not_ready. See POST /v1/carts/:id/answer.
A real wait on every 429
Every per-minute or per-hour 429 now carries Retry-After and the same wait as error.retryInSeconds. A cart that failed with retry_blocked carries failure.retryInSeconds. A cancel that releases a cart is never refused for rate. See Handling a 429.
provisioned_to_another_app
POST /v1/users for a number another of your applications already holds, in the same environment, now answers 409 provisioned_to_another_app, where it was 409 invalid_request. See Users, sessions and texts.
Stricter request checks
POST /v1/usersanswers400 invalid_requestfor a body that is not a JSON object, a name, phone, label or email that is not a string, and a phone with letters in it. See Fields.GET /v1/eventsanswers400 invalid_requestfor acursorit never wrote and alimitof 0 or a non-number. With a sandbox key, an unknown parameter is400too. See GET /v1/events.
The standard 404
A path no endpoint handles now answers 404 in the standard error shape, { "error": { "code": "not_found", "message": "…" } }, with X-Request-Id. It was a flat body with error as a string. See Error shape.
Pickup details on order.updated
order.updated now carries order.ready_eta and order.fulfillment, as GET /v1/orders/:id returns them. While a payment waits on the person approving Layout's texted link, GET /v1/orders/:id carries "challenge": { "sms_sent": true }. See Example payload.
fee_not_included
A confirm whose expectedTotalMinor left out Layout's service fee now carries error.reason: "fee_not_included". Confirm with the cart's totalMinor.
Sandbox codes are limited
Sandbox now applies production's code limits: verify/start spacing and hourly cap, four codes per cart at test_place_code, and 429 code_attempts_exceeded after 8 wrong codes in 15 minutes. The sandbox test menu also reads quantities and options from plain words, such as "an iced latte, large, with oat milk" or "two lattes". See the test restaurants.
Breaking changes
- Your secret key on a person endpoint now gets
403 wrong_credential, not401. - An expired build grant now gets
grant_expired. The status is still401. - A cart past
expiresAtcan no longer be confirmed, and its order readsCART_EXPIRED, notOUR_TIMEOUT. - A
restaurantNamewith a word the store does not carry is nowstore_mismatch. - Confirming an answered cart now gets
cart_closed, notcart_not_ready. - A number another of your applications holds now gets
provisioned_to_another_app. - Loosely formed
POST /v1/usersbodies andGET /v1/eventsqueries are now400. - A
404body'serroris now an object. - Sandbox tests that resend codes quickly can now get
429, and a sandbox request withoutitemscan build different lines than before.