> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange Rates

> Preview exchange rates and estimated destination amounts before creating payment accounts or transfers.

## Overview

Exchange rates let you preview the available rates and estimated destination amounts for a given currency pair before committing to the full transfer flow. This is useful for displaying indicative pricing to users before they provide bank account details or create a payment account.

Unlike [quotes](/docs/transfers), exchange rates don't lock in a rate or require any customer or bank account information. They fit into the transfer flow as an optional first step, letting you check what rates are available and what the user can expect to receive before proceeding.

## API flow

<div className="wf-diagram">
  <div className="legend">
    <span className="lg"><span className="swatch action" />Action / step</span>
  </div>

  <div className="diagram-shell borderless">
    <svg id="exchange-rates-flow" role="img" aria-label="Exchange rates: the user requests a rate, the partner calls GET /exchange-rates, Rain returns the available rate, the partner displays it to the user, then creates a quote and transfer to proceed." viewBox="0 0 1080 200" width="1080" height="200" style={{width: "100%", height: "auto"}}><defs><marker id="arrow-exchange-rates-flow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" className="marker-fill-default" /></marker></defs><path d="M 196 130 L 236 130" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow-exchange-rates-flow)" opacity="0.92" /><path d="M 412 130 L 452 130" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow-exchange-rates-flow)" opacity="0.92" /><path d="M 628 130 L 668 130" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow-exchange-rates-flow)" opacity="0.92" /><path d="M 844 130 L 884 130" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow-exchange-rates-flow)" opacity="0.92" /><foreignObject x="20" y="96" width="176" height="68"><div className="card action"><span className="ct"><span className="tag">User</span><span className="lab">Requests exchange rate</span></span></div></foreignObject><foreignObject x="236" y="96" width="176" height="68"><div className="card action"><span className="bn">1</span><span className="ct"><span className="tag">Partner</span><span className="lab mono">GET /exchange-rates</span></span></div></foreignObject><foreignObject x="452" y="96" width="176" height="68"><div className="card action"><span className="bn">2</span><span className="ct"><span className="tag rain">Rain</span><span className="lab">Returns available rate</span></span></div></foreignObject><foreignObject x="668" y="96" width="176" height="68"><div className="card action"><span className="bn">3</span><span className="ct"><span className="tag">Partner</span><span className="lab">Displays indicative rate</span></span></div></foreignObject><foreignObject x="884" y="96" width="176" height="68"><div className="card action"><span className="bn">4</span><span className="ct"><span className="tag">Partner</span><span className="lab">Creates quote and transfer</span></span></div></foreignObject></svg>
  </div>
</div>

The steps above, in text:

| # | Actor   | Step                                       |
| - | ------- | ------------------------------------------ |
| – | User    | Requests an exchange rate from the partner |
| 1 | Partner | Calls `GET /exchange-rates`                |
| 2 | Rain    | Returns the available rate                 |
| 3 | Partner | Displays the indicative rate to the user   |
| 4 | Partner | Creates a quote and transfer to proceed    |

## Get an exchange rate

To retrieve the current exchange rate for a currency pair, call the Exchange Rates endpoint. The request shape mirrors a [quote](/docs/transfers#step-2-create-a-quote) but without any user, company, or payment account references.

### Request

```bash theme={null}
curl -X GET "https://api.rain.xyz/v1/exchange-rates?sourceCurrency=usdc&sourceRail=base&destinationCurrency=cop&destinationRail=co_ach&sourceAmount=100" \
  -H "Api-Key: YOUR_API_KEY"
```

<Info>
  The `sourceAmount` field is optional. If you omit it, the response returns
  only the exchange rate, without a destination amount or fees breakdown.
</Info>

### Response (with source amount)

```json theme={null}
{
  "source": {
    "amount": "100",
    "currency": "usdc",
    "rail": "base"
  },
  "destination": {
    "amount": "415000",
    "currency": "cop",
    "rail": "co_ach"
  },
  "exchangeRate": "4200",
  "fees": {
    "rain": {
      "currency": "usdc",
      "amount": "1",
      "amountUSD": "1"
    }
  }
}
```

### Response (without source amount)

```json theme={null}
{
  "source": {
    "currency": "usdc",
    "rail": "base"
  },
  "destination": {
    "currency": "cop",
    "rail": "co_ach"
  },
  "exchangeRate": "4200"
}
```

### Response fields

| Field                  | Description                                                                                      |
| ---------------------- | ------------------------------------------------------------------------------------------------ |
| `source.amount`        | The source amount provided in the request (if specified)                                         |
| `source.currency`      | The source currency                                                                              |
| `source.rail`          | The source rail                                                                                  |
| `destination.amount`   | The estimated destination amount based on the rate (only present if `source.amount` is provided) |
| `destination.currency` | The destination currency                                                                         |
| `destination.rail`     | The destination rail                                                                             |
| `exchangeRate`         | The indicative conversion rate as a decimal string (destination per source unit), excluding fees |
| `fees.rain`            | The fee charged to your platform (only present if `source.amount` is provided)                   |

<Info>
  Exchange rates are indicative and not locked. The actual rate applied to a
  transfer is determined when a [quote](/docs/transfers#step-2-create-a-quote)
  is created. Rates may fluctuate between the time an exchange rate is retrieved
  and a quote is locked.
</Info>

## Supported currency pairs

### Source

| Currency | Rails                                               |
| -------- | --------------------------------------------------- |
| `usdc`   | `base`, `ethereum`, `optimism`, `polygon`, `solana` |
| `rusd`   | `base`, `ethereum`, `optimism`, `polygon`, `solana` |
| `usd`    | `base`, `ethereum`, `optimism`, `polygon`, `solana` |

### Destination

| Currency | Country  | Rail      |
| -------- | -------- | --------- |
| `cop`    | Colombia | `co_ach`  |
| `mxn`    | Mexico   | `mx_spei` |

<Info>
  Additional currency pairs are being added regularly. Contact your Rain
  representative for the latest supported configurations.
</Info>

## What's next

<Card title="Create quotes and transfers" href="/docs/transfers">
  Follow the full flow to create payment accounts, quotes, and transfers.
</Card>

<Card title="Set up onramps" href="/docs/onramps">
  Enable fiat deposits into crypto.
</Card>

<Card title="Set up offramps" href="/docs/offramps">
  Enable USD withdrawals from crypto.
</Card>
