# Quote an order

`POST /sigmafi/orders/check` · Lithos client API · SigmaFi Bonds

Source: https://lithosprotocol.org/docs/api/check-sf-order

What creating the order would lock, and its terms as a lender reads them. Signs nothing.

## Request body

`SFOrderRequest`, application/json.

- `collateralNanoErgs` (string, required)
- `collateralTokens` (SFTokenAmount[])
  - `tokenId` (string, required)
  - `amount` (string, required): Base units.
- `principalNanoErgs` (string)
- `principalToken` (SFTokenAmount)
- `repayment` (string, required)
- `maturityHeight` (integer · int64): At least 3 blocks above the current height.
- `durationBlocks` (integer · int64)
- `batchingFee` (string): Rejected on order creation. The lender selects this reserve in SFFillRequest instead.
- `liquidation` (string)

## Responses

### 200: What the action would do. Nothing was signed or sent.

`SFQuote`

- `action` (string, required)
- `boxId` (string)
- `terms` (SFTerms): A bond's terms, as its order states them and the bond carries them.
  - `kind` (string, required): The bond's kind. Every SigmaFi V2 bond is `zero-coupon`.
  - `principalNanoErgs` (string): Agreed nanoERG lent; for a token loan, the principal box's floor. Read directly from a bond's R6.
  - `principalToken` (SFTokenAmount)
    - `tokenId` (string, required)
    - `amount` (string, required): Base units.
  - `repayment` (string, required): What the borrower repays, in nanoERG or in base units of `repayToken`.
  - `repayToken` (string): The token a token loan is repaid in. Absent when repaid in ERG.
  - `collateralNanoErgs` (string, required): Borrower collateral nanoERG, excluding the lender-funded reserve.
  - `collateralTokens` (SFTokenAmount[], required)
  - `maturityHeight` (integer · int64): Repayment is open strictly below it. Absent for an on-close order until it is filled.
  - `durationBlocks` (integer · int64): An on-close order's term, counted from its fill.
  - `batchingFee` (string, required): Lender-funded reserve selected on fill; zero on unfilled orders. Refunded on repayment.
  - `liquidation` (string): The liquidation script's name. Absent when this client does not know it.
  - `liquidationHash` (string, required)
- `paysNanoErgs` (string, required): What leaves this wallet, the network fee included.
- `paysTokens` (SFTokenAmount[], required)
- `receivesNanoErgs` (string, required)
- `receivesTokens` (SFTokenAmount[], required)
- `feeNanoErgs` (string, required)
- `notes` (string[], required)
- `warnings` (string[], required)

### 400: A malformed field, or terms no contract or shipped client accepts.

`ApiError`

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

### 503: Node or index unavailable. Never returns a partial answer.

`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/orders/check" \
  -H "Content-Type: application/json" \
  -d '{ "collateralNanoErgs": "string", "collateralTokens": [ { "tokenId": "string", "amount": "string" } ], "principalNanoErgs": "string", "principalToken": { "tokenId": "string", "amount": "string" }, "repayment": "string", "maturityHeight": 0, "durationBlocks": 30, "batchingFee": "string", "liquidation": "MaturityLiquidation" }'
```

## Example response

```json
{
  "action": "string",
  "boxId": "string",
  "terms": {
    "kind": "string",
    "principalNanoErgs": "string",
    "principalToken": {
      "tokenId": "string",
      "amount": "string"
    },
    "repayment": "string",
    "repayToken": "string",
    "collateralNanoErgs": "string",
    "collateralTokens": [
      {
        "tokenId": "string",
        "amount": "string"
      }
    ],
    "maturityHeight": 0,
    "durationBlocks": 0,
    "batchingFee": "string",
    "liquidation": "string",
    "liquidationHash": "string"
  },
  "paysNanoErgs": "string",
  "paysTokens": [
    {
      "tokenId": "string",
      "amount": "string"
    }
  ],
  "receivesNanoErgs": "string",
  "receivesTokens": [
    {
      "tokenId": "string",
      "amount": "string"
    }
  ],
  "feeNanoErgs": "string",
  "notes": [
    "string"
  ],
  "warnings": [
    "string"
  ]
}
```
