# Quotes

> Request a USD↔COP quote with its settlement term, read its factor and execute it before it expires after 30 seconds.

[Sandbox · coming soon]

**GET** `/v1/quotes` — Quote a conversion · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/get-quote.md)

## Request a quote

**GET /v1/quotes**

```bash
curl "https://sandbox.zulu.com.co/v1/quotes?from=COP&to=USD" \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY"
```

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/quotes?from=COP&to=USD', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.ZULU_ACCESS_TOKEN}`,
    'X-API-Key': process.env.ZULU_API_KEY,
  },
});

console.log(response.status, await response.json());
```

```python
import os

import requests

response = requests.get(
    "https://sandbox.zulu.com.co/v1/quotes?from=COP&to=USD",
    headers={
        "Authorization": f"Bearer {os.environ['ZULU_ACCESS_TOKEN']}",
        "X-API-Key": os.environ["ZULU_API_KEY"],
    },
    timeout=30,
)
print(response.status_code, response.json())
```

| Parameter        | What it is                                        |
| ---------------- | ------------------------------------------------- |
| `from`           | The currency you hand over (`COP` or `USD`).      |
| `to`             | The currency you receive; other than `from`.      |
| `settlementTerm` | `SAME_DAY` (default), `NEXT_DAY` or `SECOND_DAY`. |

**Response 200**

```json
{
  "quote": "EQ-COPXUSDX-261124150405-SBX7Q",
  "expiresAt": "2026-11-24T15:04:35.123Z",
  "from": {
    "country": "COL",
    "currency": {
      "code": "COP",
      "decimals": 0
    }
  },
  "to": {
    "country": "USA",
    "currency": {
      "code": "USD",
      "decimals": 2
    }
  },
  "factor": 3973.7,
  "factorFormula": "COP/USD",
  "settlementTerm": "SAME_DAY",
  "settlementDate": "2026-11-24"
}
```

## How to read it

- **`factor`** is how many pesos a dollar is worth in this quote (`factorFormula: "COP/USD"`), with 2 decimals. Buying USD costs more than selling them: the difference is the spread.
- **`expiresAt`** is when it expires, 30 seconds after it is issued. Execute it before then.
- **`settlementDate`** is the business day the destination currency will be credited.
- **`decimals`** says how many decimals each currency takes: COP in whole pesos, USD with cents.

## When there is no quote

Under `REAL` hours the market opens from 08:05 to 15:30 on business days, and `SAME_DAY` is only quoted until 13:00. By default the sandbox uses `ALWAYS_OPEN`, like production's test users; switch the hours in the dashboard to test these errors.

| HTTP | error | cause | Description |
| --- | --- | --- | --- |
| 400 | `BadRequestApiError` | `error in struct validation` | One or more fields fail their validation. `values` carries one message per field, keyed by its JSON path, naming the Go validator that failed. |
| 404 | `NotFoundApiError` | `rate "%s->%s" not found` | There is no rate configured for that currency pair. |
| 422 | `UnprocessableEntityApiError` | `the fx market is closed` | The FX market is closed (`REAL` hours: 08:05–15:30 on Bogotá business days). The sandbox defaults to `ALWAYS_OPEN`. |
| 422 | `UnprocessableEntityApiError` | `SAME_DAY settlement is not available after %s` | After the cutoff `SAME_DAY` is not available; quote `NEXT_DAY` or `SECOND_DAY`. |
