Carts

Build a cart

Starts a real build on the restaurant's own site and answers at once. Poll GET /carts/{cartId}. Nothing is charged: a cart is built and unpaid until it is confirmed.

post/carts

Request

  • Base URL: https://api.layout.link/v1
  • URL: https://api.layout.link/v1/carts
  • Auth: HTTP bearer

Headers

Layout-Version'2026-10-01'

The API version you code against. Optional; without it you get 2026-10-01, the current version. Layout answers with the version it used.

Idempotency-Keystring

Optional. Any 1 to 255 visible ASCII characters, unique per real intent. A retry with the same key and the same body gets the stored response for 24 hours, with Idempotent-Replayed: true, and is never run twice. The same key with a different body is 409 idempotency_conflict; while the first request is still running it is 409 in_progress with Retry-After. Only a success is stored: any error releases the key so it can be sent again. A 4xx ran nothing. A 5xx may have run, above all a confirm's 500, so read the resource before sending anything changed.

Request body

requeststring

What the person wants, in their words.

itemsstring[]

One entry per item, when you have a list.

placeIdstring

The store, from a places search. Sent with restaurantName, the two must name the same store, or the build is refused with store_mismatch.

orderUrlstring
restaurantNamestring
nearstring

Where the person is, as text. Used with restaurantName.

timeZonestring
idempotencyKeystring

Unique per real intent. A retry with the same key and body returns the same answer. Optional when the request carries an Idempotency-Key header, whose value is then used; when both are sent, this one names the cart or the confirm.

Response

The build started, or this key already started it.

Changes

No recorded changes to this operation across all 1 revision of this API.