---
title: POST /v1/usdhb/quotes
---

# `POST /v1/usdhb/quotes`

Quote a mint or redeem

Price a USDhb mint or redeem (whole units on testnet v1); a 409 carries the refusal's figures when capacity, the oracle, a halt or dust refuses.

Money, price, rate and count fields cross the wire as decimal strings; units are shown beside each field ([Wire encoding](/api/wire-encoding)). Group: [Usdhb](/api/reference/usdhb/).

**Auth:** API key (`x-api-key`)

**Scope:** `trade`

**Rate limit:** the `order` budget ([Rate limits](/api/rate-limits))

**Effect:** `quote`: computes and changes nothing

**Quote expiry:** the response's `expiresAtMs` (epoch ms)

## Request

- <span id="req-side"></span>`side` · enum(`mint`, `redeem`) · required
- <span id="req-usdhb"></span>`usdhb` · string · required

```bash [curl]
curl -fsS -X POST "$HB/v1/usdhb/quotes" \
  -H "x-api-key: $HB_KEY" \
  -H "content-type: application/json" \
  -d '{
    "side": "mint",
    "usdhb": "100"
  }'
```

```python [Python]
import os

import requests

HB = os.environ.get("HB", "https://testnet.hardbasis.com")

resp = requests.post(
    f"{HB}/v1/usdhb/quotes",
    headers={
        "x-api-key": os.environ["HB_KEY"],
    },
    json={
        "side": "mint",
        "usdhb": "100",
    },
)
resp.raise_for_status()
print(resp.json())
```

```ts [TypeScript]
const HB = process.env.HB ?? "https://testnet.hardbasis.com";

const res = await fetch(`${HB}/v1/usdhb/quotes`, {
  method: "POST",
  headers: {
    "x-api-key": process.env.HB_KEY!,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "side": "mint",
    "usdhb": "100"
  }),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(await res.json());
```

## Responses

- **201**: Created
  - <span id="res-201-quoteId"></span>`quoteId` · string · required
  - <span id="res-201-side"></span>`side` · enum(`mint`, `redeem`) · required
  - <span id="res-201-usdhb"></span>`usdhb` · string · required
  - <span id="res-201-contracts"></span>`contracts` · string · unit `contracts` · required
  - <span id="res-201-priceQ8"></span>`priceQ8` · string · unit `q8` · required
  - <span id="res-201-spreadQ9"></span>`spreadQ9` · string · unit `q9` · required
  - <span id="res-201-feeMsat"></span>`feeMsat` · string · unit `msat` · required
  - <span id="res-201-dynFeeMsat"></span>`dynFeeMsat` · string · unit `msat` · required
  - <span id="res-201-impactMsat"></span>`impactMsat` · string · unit `msat` · required
  - <span id="res-201-satsMsat"></span>`satsMsat` · string · unit `msat` · required
  - <span id="res-201-expiresAtMs"></span>`expiresAtMs` · string · unit `ms` · required
  - <span id="res-201-oracleTsMs"></span>`oracleTsMs` · string · unit `ms` · required

Example `201` response:

```json
{
  "quoteId": "string",
  "side": "mint",
  "usdhb": "string",
  "contracts": "100000",
  "priceQ8": "100000",
  "spreadQ9": "100000",
  "feeMsat": "100000",
  "dynFeeMsat": "100000",
  "impactMsat": "100000",
  "satsMsat": "100000",
  "expiresAtMs": "100000",
  "oracleTsMs": "100000"
}
```

## Errors

Every refusal carries a stable `code` from [`ErrorCode`](/api/reference/all#errorcode) beside human `error` prose; match on the code. See [Errors](/api/errors).

- **401**: A refusal carrying a stable machine `code` (ErrorCode) beside human `error` prose.
- **403**: A refusal carrying a stable machine `code` (ErrorCode) beside human `error` prose.
- **409**: Conflict
- **429**: A token bucket is exhausted.
