> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-colombia.wallib.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-colombia.wallib.io/_mcp/server.

# Exchange Rates

POST https://third/v1/provider/exchangerates
Content-Type: application/json

Returns the current exchange rate and converted amount between two currencies.

Use this endpoint to get a real-time rate for a given amount before generating a quote. Supports conversions between supported crypto assets (e.g. **USDT**) and fiat currencies (e.g. **COP**).

**Authentication:** Bearer token (`{{JWT_LOGIN}}`) + `x-api-key` header.

**Key body fields**

* `baseCurrency`: The source currency to convert from (e.g. `USDT`).
* `quoteCurrency`: The target currency to convert to (e.g. `COP`).
* `amount`: The amount in the base currency to calculate the rate for.

Reference: https://docs-colombia.wallib.io/wallib-payments-api-colombia/exchange-rates

## Request

### Headers

- `x-api-key` (string, optional)

### Body (application/json)

- `baseCurrency` (string, required)
- `quoteCurrency` (string, required)
- `amount` (integer, required)

## Response

### 200

OK

- `baseCurrency` (string, required)
- `quoteCurrency` (string, required)
- `exchangeRate` (double, required)
- `baseAmount` (integer, required)
- `quoteAmount` (integer, required)

## Examples

**Request**

```json
{
  "baseCurrency": "USDT",
  "quoteCurrency": "COP",
  "amount": 100
}
```

**Response**

```json
{
  "baseCurrency": "USDT",
  "quoteCurrency": "COP",
  "exchangeRate": 3120.55,
  "baseAmount": 100,
  "quoteAmount": 312055
}
```

**SDK Code**

```python Exchange Rates_example
import requests

url = "https://third/v1/provider/exchangerates"

payload = {
    "baseCurrency": "USDT",
    "quoteCurrency": "COP",
    "amount": 100
}
headers = {
    "x-api-key": "{{X_API_KEY}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Exchange Rates_example
const url = 'https://third/v1/provider/exchangerates';
const options = {
  method: 'POST',
  headers: {'x-api-key': '{{X_API_KEY}}', 'Content-Type': 'application/json'},
  body: '{"baseCurrency":"USDT","quoteCurrency":"COP","amount":100}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Exchange Rates_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://third/v1/provider/exchangerates"

	payload := strings.NewReader("{\n  \"baseCurrency\": \"USDT\",\n  \"quoteCurrency\": \"COP\",\n  \"amount\": 100\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "{{X_API_KEY}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Exchange Rates_example
require 'uri'
require 'net/http'

url = URI("https://third/v1/provider/exchangerates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{X_API_KEY}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"baseCurrency\": \"USDT\",\n  \"quoteCurrency\": \"COP\",\n  \"amount\": 100\n}"

response = http.request(request)
puts response.read_body
```

```java Exchange Rates_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://third/v1/provider/exchangerates")
  .header("x-api-key", "{{X_API_KEY}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"baseCurrency\": \"USDT\",\n  \"quoteCurrency\": \"COP\",\n  \"amount\": 100\n}")
  .asString();
```

```php Exchange Rates_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://third/v1/provider/exchangerates', [
  'body' => '{
  "baseCurrency": "USDT",
  "quoteCurrency": "COP",
  "amount": 100
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '{{X_API_KEY}}',
  ],
]);

echo $response->getBody();
```

```csharp Exchange Rates_example
using RestSharp;

var client = new RestClient("https://third/v1/provider/exchangerates");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "{{X_API_KEY}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"baseCurrency\": \"USDT\",\n  \"quoteCurrency\": \"COP\",\n  \"amount\": 100\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Exchange Rates_example
import Foundation

let headers = [
  "x-api-key": "{{X_API_KEY}}",
  "Content-Type": "application/json"
]
let parameters = [
  "baseCurrency": "USDT",
  "quoteCurrency": "COP",
  "amount": 100
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://third/v1/provider/exchangerates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```