# An exporter sells USD

> Sell the dollars in your USD balance for pesos and pay your suppliers in Colombia with the same API.

[Sandbox · coming soon]

An exporter holds dollars in its zulu USD balance and needs pesos for payroll and suppliers in Colombia. It sells USD for COP and pays out with the pesos.

## The flow

1. Quote USD→COP.
2. Execute with `originAmount`: the dollars it wants to sell.
3. When the conversion is `COMPLETED`, the pesos are in its COP balance.
4. Pay out with `POST /v1/transfer`, available in production.

## 1. Quote the sale

**GET /v1/quotes**

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

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/quotes?from=USD&to=COP&settlementTerm=SAME_DAY', {
  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=USD&to=COP&settlementTerm=SAME_DAY",
    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())
```

`factor` is still COP per USD. Selling, the spread is subtracted from the mid rate: in the sandbox, 3,950.00 − 60 bps = 3,926.30.

## 2. Sell by the origin amount

```bash
curl https://sandbox.zulu.com.co/v1/transactions \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quote": "EQ-USDXCOPX-261124150405-SBX3M", "originAmount": 1000}'
```

At factor 3,926.30 (f₂ = 392,630), selling 1,000 USD gives round(100,000 × 392,630 / 10⁴) = 3,926,300 COP.

## 3. Wait for the pesos

The conversion stays `IN_PROGRESS` until its settlement date. Do not pay out before `COMPLETED`: until then the pesos are not in your balance.

**GET** `/v1/transactions/{transactionId}` — Get a transaction · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/get-transaction.md)

## 4. Pay out

With the pesos in your balance, pay each beneficiary. This operation is already in production:

**POST** `/v1/transfer` — Withdraw COP balance · [Production] · [See the reference](https://developers.zulu.com.co/en/reference/create-transfer.md)

Read [Payouts and method selection](https://developers.zulu.com.co/en/docs/payout/transfers.md) and the [supplier payments](https://developers.zulu.com.co/en/docs/payout/use-cases/supplier-payments.md) use case.

| Limit | Value |
| --- | --- |
| USD side of a conversion | 1 – 1,000,000 USD |
| Life of a quote (single use) | 30 seconds |
