---
title: "Answer a cart's question"
method: POST
path: "/carts/{cartId}/answer"
tags: ["Carts"]
---

# Answer a cart's question

`POST /carts/{cartId}/answer`

## Request

- Base URL: `https://api.layout.link/v1`
- URL: `https://api.layout.link/v1/carts/{cartId}/answer`
- Auth: HTTP bearer

Builds the cart again with the person's answer. The answer is a new cart: poll the id this returns.

## Path parameters

- `cartId` string, required

## Headers

- `Layout-Version` '2026-10-01'
- `Idempotency-Key` string

## Request body

- AnswerCartRequest
  - `choices` string: The person's answer to a `choices` decision, in their words.
  - `acceptPickupTime` true: The person accepts the pickup time a `pickup_time` decision states.
  - `idempotencyKey` string: 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 `202`

The new build started.

- CartAccepted
  - `cart` object, required
    - `id` string, required
    - `status` 'building' | 'ready' | 'needs_answer' | 'failed' | 'canceling' | 'canceled' | 'expired' | 'closed', required: `canceling`: a cancel arrived while the cart was building. Layout releases the cart the moment the build lands, never offers it to the person, and never texts it; read the cart until it is `canceled`.

## Other responses

- `400`: `invalid_request`: send exactly one of choices or acceptPickupTime. `unsupported_version`: the Layout-Version header names no version this API answers.
- `401`: The token is missing, expired, revoked, issued for another audience, or the person disconnected. Every 401 reads the same.
- `403`: The credential is real and may not do this: an application or account that is suspended, a live person on an unapproved application, a scope the token was not granted, or a person whose Layout account cannot order yet.
- `404`: No such cart for this application and person. Another application's cart is a 404 too.
- `409`: `answer_not_needed`: the cart is not waiting on that answer, or it was canceled. `idempotency_conflict` / `in_progress` as on POST /carts. `store_ambiguous` / `store_not_found` / `store_mismatch` when the rebuild cannot resolve the store. `idempotency_conflict`: the Idempotency-Key was already used with a different request. `in_progress`: the first request with that key is still running; retry after `Retry-After`.
- `429`: `build_limit`: a daily build budget is spent. `rate_limited`: a per-minute brake.
- `500`: Layout failed to answer. Retry with backoff.
- `503`: Credentials or a dependency could not be checked right now. Retry with backoff.

---

[API](https://skmtc.dev/layout/apis/layout-partner-api.md) · [All operations](https://skmtc.dev/layout/apis/layout-partner-api/llms.txt) · [OpenAPI document](https://skmtc.dev/layout/apis/layout-partner-api/revisions/7ff4ba01bf56?raw)
