---
title: "Release a cart"
method: POST
path: "/carts/{cartId}/cancel"
tags: ["Carts"]
---

# Release a cart

`POST /carts/{cartId}/cancel`

## Request

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

Releases this cart and nothing else. A build grant may release only a cart its own application built. A cart still building is accepted with 202 `canceling`: Layout records the cancel, releases the cart the moment the build lands, and never texts the person that it is ready; read it until it is `canceled`. A cart already confirmed is not canceled here: the answer is `cart_closed` with `error.order` naming the order and its state now.

## Path parameters

- `cartId` string, required

## Headers

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

## Response `200`

Released: `canceled`.

- 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

- `202`: The cart is still building. The cancel is recorded: `canceling`.
- `400`: `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`: `cart_closed`: already confirmed, so not canceled; `error.order` is the order and its state now (`placing`, `placed`, `unconfirmed` or `refunded`). `nothing_to_cancel`: nothing to release. `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`: 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)
