# Cancel a box

`POST /sigmafi/zc/boxes/{boxId}/cancel` · Lithos client API · SigmaFi ZC Standard · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/cancel-zc-box

Take back an order, offer, ask, lot, share request or wrap request this wallet made, with one of its boxes at the creator's address as consent. A box past its expiry may be refunded by anyone first.

## Parameters

| Name | In | Type | Required | Description |

|---|---|---|---|---|

| `boxId` | path | string | yes | A ZC box id.  |

## Responses

### 200: The transaction was sent; `outcome` says whether the node accepted it.

`ZcResult`

- `txId` (string): None while the write is held.
- `outcome` (string, one of accepted, rejected, uncertain, held): The node's answer. `held`: the write reads the box a pending oracle refresh creates, and a miner could reach it before that refresh, so nothing was sent yet. The client tries it again every 30 seconds for 10 minutes, rebuilt and checked against `limits` each time, and sends it once the refresh confirms.
- `reason` (string): Why a write is held.
- `retriesUntil` (integer · int64): When a held write stops being tried (ms since the epoch).
- `boxId` (string): The transaction's first output.
- `assetId` (string): The bond asset a fill minted.
- `warnings` (string[])

### 400: A malformed field, or terms the contracts refuse.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 403: Missing or wrong api_key.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 404: No such box or token, or not this wallet's.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 409: A pending transaction already spends a box this needs, or the rebuilt transaction is outside `limits`. Re-quote and resend.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 422: Valid, but not possible now; the message gives the reason the check lists in `refusals`.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 503: ZC tracking is off or not seeded, or the node, its index or the wallet did not answer. Nothing was sent.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X POST "http://localhost:9000/sigmafi/zc/boxes/{boxId}/cancel" \
  -H "api_key: $LITHOS_API_KEY"
```

## Example response

```json
{
  "txId": "string",
  "outcome": "accepted",
  "reason": "string",
  "retriesUntil": 0,
  "boxId": "string",
  "assetId": "string",
  "warnings": [
    "string"
  ]
}
```
