# Extinguish a bond (quote)

`POST /sigmafi/zc/bonds/{assetId}/extinguish/check` · Lithos client API · SigmaFi ZC Standard · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/check-extinguish-zc-bond

What the send would do, at the snapshot `at`. Signs nothing. A write that cannot run now answers 200 with its `refusals`. Needs the key, since the quote reads this wallet's bond-unit and share holdings.

## Parameters

| Name | In | Type | Required | Description |

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

| `assetId` | path | string | yes | A bond asset id: the id of the order box its fill spent.  |

## Request body

`ZcLimitsOnly`, application/json.

- `limits` (ZcLimits): Bounds on the rebuilt transaction. For fills, buys, repays, recollateralizations and claims, amounts are in the action's market unit (nanoERG for ERG, fee included; raw units for SigUSD; nanoERG for actions with no market). For posts (orders, offers, asks, lots, fractionalize and wraps), `maxPay` is always in nanoERG (box value plus miner fee), since any token capital or collateral is fixed directly by the request body. Outside them the send answers 409. 
  - `maxPay` (string)
  - `minReceive` (string)

## Responses

### 200: What the write would do, or its `refusals`. Nothing was signed or sent.

`ZcQuote`

- `action` (string)
- `at` (ZcAt): The snapshot a read or quote was taken from.
  - `height` (integer)
  - `blockId` (string)
  - `indexedHeight` (integer)
  - `revision` (integer · int64): Changes whenever anything a read returns changes, the mempool included.
  - `cut` (boolean): True when the book is at its size cap and left boxes out.
  - `mempool` (boolean): Whether unconfirmed boxes are laid over the confirmed book.
- `paysNanoErgs` (string): nanoERG leaving this wallet, the miner fee included.
- `paysTokens` (ZcToken[])
  - `tokenId` (string, required)
  - `amount` (string, required)
- `receivesNanoErgs` (string)
- `receivesTokens` (ZcToken[])
- `fees` (object[])
  - `name` (string)
  - `nanoErg` (string)
  - `kind` (string, one of spent, locked, refundable, earned)
- `creates` (object[]): Each output that does not come to this wallet, by role.
  - `role` (string)
  - `contract` (string)
  - `nanoErg` (string)
  - `tokens` (ZcToken[])
- `terms` (object): The resolved terms; they differ by action.
- `validFrom` (integer)
- `validThrough` (integer)
- `matchesNow` (any): For a create, the simulation of its body; for a fill or buy, the offers that would compete for it.
- `warnings` (string[])
- `refusals` (string[]): When not empty, the send answers 422 with these reasons.
- `requires` (string[]): What must happen before the write can run.

### 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

### 429: Too many concurrent quotes, simulations, or heavy reads (`/curves`, `/orderbook`, `/fills`): at most 4 quotes/simulations and at most 4 heavy reads run or wait at once across all callers, and simulations are additionally limited to 5 in flight per caller, then 1 a second. Retry shortly.

`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/bonds/{assetId}/extinguish/check" \
  -H "api_key: $LITHOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "limits": { "maxPay": "string", "minReceive": "string" } }'
```

## Example response

```json
{
  "action": "string",
  "at": {
    "height": 0,
    "blockId": "string",
    "indexedHeight": 0,
    "revision": 0,
    "cut": true,
    "mempool": true
  },
  "paysNanoErgs": "string",
  "paysTokens": [
    {
      "tokenId": "string",
      "amount": "string"
    }
  ],
  "receivesNanoErgs": "string",
  "receivesTokens": [
    {
      "tokenId": "string",
      "amount": "string"
    }
  ],
  "fees": [
    {
      "name": "string",
      "nanoErg": "string",
      "kind": "spent"
    }
  ],
  "creates": [
    {
      "role": "string",
      "contract": "string",
      "nanoErg": "string",
      "tokens": [
        {
          "tokenId": "string",
          "amount": "string"
        }
      ]
    }
  ],
  "terms": {},
  "validFrom": 0,
  "validThrough": 0,
  "matchesNow": null,
  "warnings": [
    "string"
  ],
  "refusals": [
    "string"
  ],
  "requires": [
    "pull"
  ]
}
```
