> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablepayfi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a quote

> Retrieve a quote

See [authentication, signing, data conventions, and errors](https://docs.stablepayfi.ai/en/api/stablecoin-exchange/overview). Regenerate the timestamp, nonce, and signature on every retry.

`GET /quote/{quote_id}` Returns a quote by ID; use status to decide whether it is usable.

## Request headers

**Authorization** `string` *required*

Bearer API Key.

**X-StablePay-Timestamp** `string` *required*

Unix seconds, within five minutes of server time.

**X-StablePay-Nonce** `string` *required*

Unique per request, 16–64 characters.

**X-StablePay-Signature** `string` *required*

Lowercase hexadecimal HMAC-SHA256 signature for the exact request body.

## Request parameters

**quote\_id** `string` *required*

Quote ID, 10 digits

**merchant\_id** `string`

10 digits; omit for merchant apps, required for service-provider apps

## Response

**quote\_id** `string` *required*

Quote ID, 10 digits

**quote\_type** `string` *required*

`on_ramp`, `off_ramp`, swap

**source\_currency** `string` *required*

Sell currency

**target\_currency** `string` *required*

Buy currency

**source\_amount** `integer` *required*

Sell amount, smallest unit

**target\_amount** `integer` *required*

Buy amount

**rate** `string` *required*

Locked rate, decimal string

**fee\_amount** `integer` *required*

Fee in source currency

**fee\_currency** `string` *required*

Fee currency

**expires\_at** `integer` *required*

Expiry time

**status** `string` *required*

open, used, expired

**metadata** `object`

Custom metadata

**created** `integer` *required*

Creation time

## Status and errors

404 when missing or owned by another merchant.

```bash cURL theme={"system"}
curl --request GET \
  --url "https://api.stablepay.co/api/v1/quote/{quote_id}" \
  --header "Authorization: Bearer <API_KEY>" \
  --header "X-StablePay-Timestamp: <TIMESTAMP>" \
  --header "X-StablePay-Nonce: <NONCE>" \
  --header "X-StablePay-Signature: <SIGNATURE>"
```

```javascript JavaScript theme={"system"}
const response = await fetch("https://api.stablepay.co/api/v1/quote/{quote_id}", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <API_KEY>",
    "X-StablePay-Timestamp": "<TIMESTAMP>",
    "X-StablePay-Nonce": "<NONCE>",
    "X-StablePay-Signature": "<SIGNATURE>"
  }
});
console.log(await response.json());
```

```json 200 theme={"system"}
{
  "quote_id": "9000000017",
  "quote_type": "on_ramp",
  "source_currency": "USD",
  "target_currency": "USDC",
  "source_amount": 100500,
  "target_amount": 100479,
  "rate": "0.9998",
  "fee_amount": 5,
  "fee_currency": "USD",
  "expires_at": 1718730000,
  "status": "open",
  "created": 1718726400
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.