# Quote a conversion

`GET /v1/quotes` · [Sandbox · coming soon]

> Base URL: Sandbox `https://sandbox.zulu.com.co/v1`
>
> Not in production yet: it arrives with this same signature. Try it in the sandbox.

Creates a USD↔COP quote that expires after 30 seconds and serves a single conversion (`POST /v1/transactions`). `factor` is always COP per USD: buying USD (COP→USD) it includes zulu's spread, and so does selling them (USD→COP). The term (`SAME_DAY`, `NEXT_DAY`, `SECOND_DAY`) sets the settlement date; `SAME_DAY` only until 13:00 under `REAL` hours. In the sandbox the rate is synthetic: not a real quote.

## Authentication

`Authorization: Bearer <access_token>` (401 when missing or expired) and `X-API-Key` (403 when missing or not matching).

## Request

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string | required | Origin currency (the one you hand over). Values: `COP` (Colombian peso (whole pesos).), `USD` (US dollar (up to 2 decimals).). |
| `to` | string | required | Destination currency (the one you receive). Values: `COP` (Colombian peso (whole pesos).), `USD` (US dollar (up to 2 decimals).). |
| `settlementTerm` | string | optional | Settlement term (default `SAME_DAY`). Values: `SAME_DAY` (Settles the same business day (before the 13:00 cutoff).), `NEXT_DAY` (Settles the next business day.), `SECOND_DAY` (Settles on the second business day.). Default: `"SAME_DAY"`. |

## Responses

### 200

Quote issued.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `quote` | string | required | Quote id (30 characters): `EQ-{ORIGIN}{DESTINATION}-{YYMMDDHHMMSS}-{client}{2}`. Send it to `POST /v1/transactions`. |
| `expiresAt` | string (date-time) | required | Expires 30 seconds after it was issued; single use. |
| `from` | object | required | One side of the quote. |
| `from.country` | string | required | Country of the currency. Values: `COL` (Colombia (ISO 3166-1 alpha-3).), `USA` (United States (ISO 3166-1 alpha-3).). |
| `from.currency` | object | required | Currency. |
| `from.currency.code` | string | required | Currency code. Values: `COP` (Colombian peso (whole pesos).), `USD` (US dollar (up to 2 decimals).). |
| `from.currency.decimals` | integer | required | Decimals of the currency (COP 0, USD 2). |
| `to` | object | required | One side of the quote. |
| `to.country` | string | required | Country of the currency. Values: `COL` (Colombia (ISO 3166-1 alpha-3).), `USA` (United States (ISO 3166-1 alpha-3).). |
| `to.currency` | object | required | Currency. |
| `to.currency.code` | string | required | Currency code. Values: `COP` (Colombian peso (whole pesos).), `USD` (US dollar (up to 2 decimals).). |
| `to.currency.decimals` | integer | required | Decimals of the currency (COP 0, USD 2). |
| `factor` | number | required | COP per USD, with 2 decimals. Synthetic in the sandbox: the workspace mid rate ± the term's spread. |
| `factorFormula` | string | required | Always `COP/USD`. Always `"COP/USD"`. |
| `settlementTerm` | string | required | Quoted term. Values: `SAME_DAY` (Settles the same business day (before the 13:00 cutoff).), `NEXT_DAY` (Settles the next business day.), `SECOND_DAY` (Settles on the second business day.). |
| `settlementDate` | string (date) | required | Business day it settles (Bogotá). |

### 400

Invalid request: the body is not JSON, a field has another type or fails its validation.

### 401

The access token is missing, invalid or expired.

### 403

The `X-API-Key` is missing, invalid or does not match the token.

### 404

The resource does not exist.

### 422

The operation can not be processed; nothing is recorded.

### 429

Too many requests: wait the seconds in `Retry-After`.

### 500

Internal error.

## 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. |
| 401 | — | `Unauthorized` | The `Authorization: Bearer <access_token>` header is missing, or the token is invalid or expired. |
| 403 | — | `Forbidden` | The `X-API-Key` is missing, unknown, revoked or does not belong to the credentials of the token. |
| 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`. |
| 429 | — | `Too Many Requests` | You exceeded the request limit of your credentials. Wait the seconds in `Retry-After`. |
| 500 | `InternalServerApiError` | `[code:1] unexpected error` | Internal error. On operations that move money, check the state before retrying so the operation is not duplicated. |

## Examples

### Buy USD with COP, same day

```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"
```

**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"
}
```

### Sell USD for COP, same day

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

**Response 200**

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

### The same currency on both sides

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

**Response 400**

```json
{
  "error": "BadRequestApiError",
  "cause": "error in struct validation",
  "values": {
    "from": "failed validation on the \"not_equal_to\" tag with value required \"To\"",
    "to": "failed validation on the \"not_equal_to\" tag with value required \"From\""
  }
}
```

### No currencies

```bash
curl https://sandbox.zulu.com.co/v1/quotes \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY"
```

**Response 400**

```json
{
  "error": "BadRequestApiError",
  "cause": "error in struct validation",
  "values": {
    "from": "failed validation on the \"required\" tag",
    "to": "failed validation on the \"required\" tag"
  }
}
```
