# Conversions (/fr/docs/conversions)

A conversion moves value between two of **your own** balances: CAD or USD into a digital dollar (USDC or USDT), or back. You always know the exact price before anything moves, because a conversion executes a [quote](/docs/quotes) you requested first.

<Callout title="Two calls, one price">
1. **Quote** the conversion with `POST /v1/quotes`, without `method`: that's what makes it a conversion instead of a payout.
2. **Convert** with `POST /v1/conversions`, sending the quote's `id` while it lasts.

You pay exactly the quote's `source.total` and receive exactly its `destination.amount`.
</Callout>

<Callout type="warn" title="Canadian dollars">
CAD reaches your balance through Canadian rails (Interac e-Transfer, EFT), which run in sandbox only for now. See [Countries and methods](/docs/coverage).
</Callout>

## 1. Quote the conversion [#1-quote-the-conversion]

<Endpoint method="POST" path="/v1/quotes" href="/api#tag/quotes/POST/v1/quotes" />

```bash
curl "$CAIBO_API/v1/quotes" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: convert-quote-001" \
  -H "Content-Type: application/json" \
  -d '{
    "source_currency": "USD",
    "destination_currency": "USDC",
    "amount": "1000.00",
    "amount_side": "source"
  }'
```

| Field | Description |
| --- | --- |
| `source_currency` | The balance the money leaves. |
| `destination_currency` | The balance the money arrives in. |
| `amount` | The fixed amount, as a decimal string. |
| `amount_side` | `source`: `amount` is what leaves your balance. `destination`: `amount` is what arrives. |

The quote tells you the `rate`, what leaves (`source.total`, which is `principal` + `platform_fee` + `tenant_markup`) and what arrives (`destination.amount`). It's valid for a short time: use it before it expires.

## 2. Convert [#2-convert]

<Endpoint method="POST" path="/v1/conversions" href="/api#tag/conversions/POST/v1/conversions" />

```bash
curl "$CAIBO_API/v1/conversions" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: convert-001" \
  -H "Content-Type: application/json" \
  -d '{ "quote_id": "quo_01m3sgaz0000000000000000" }'
```

The quote's total is held from your available balance in the source currency, and the quote can't be used by anything else. The conversion is executed asynchronously.

## Statuses [#statuses]

| Status | What it means |
| --- | --- |
| `pending` | The total is held and the conversion is being executed. |
| `pending_review` | The risk controls asked a person to look. The total is held and nothing is executed until then; `risk_decision_id` says which decision. Approved, it becomes `pending`; rejected, it fails with `risk_rejected` and the hold is released. |
| `completed` | `destination.amount` is in your available balance. |
| `failed` | Nothing was converted and the hold was released. `failure_code` says why: `conversion_refused` or `risk_rejected`. |

Follow it with the `conversion.created`, `conversion.completed` and `conversion.failed` [events](/docs/events), or with <Endpoint method="GET" path="/v1/conversions/{id}" href="/api#tag/conversions/GET/v1/conversions/{id}" />.

## When it's refused [#when-its-refused]

Nothing is held and the quote is not used in any of these cases:

| Response | Why |
| --- | --- |
| `422 insufficient_funds` | Your available balance doesn't cover the total. The quote stays usable while it lasts. |
| `422 quote_expired` | The quote expired. Request a new one. |
| `409 quote_already_used` | The quote was already used by another operation. |
| `404` | The quote isn't yours. |
| `422 limit_exceeded` | A limit on your account. |
| `422 risk_blocked` | The risk controls refused it. |
| `503 operation_suspended` | Conversions are paused for now. Retry later. |

Repeating the request with the same `Idempotency-Key` returns the same conversion: it never converts twice. See [Idempotency](/docs/idempotency).
