> For the complete documentation index, see [llms.txt](https://docs.malum.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.malum.co/transaction-api/currency-exchange-rate.md).

# Currency Exchange Rate

### Overview

This endpoint retrieves the current exchange rate between two specified currencies. This service supports all major currencies that conform to the ISO 4217 three-letter code standard.

### HTTP Request

```css
GET https://malum.co/api/v2/exchange/{FROM}-{TO}
OR
GET https://malum.co/api/v2/exchange/{FROM}{TO}
```

#### Path Parameters

| Parameter     | Description                                                                                                          |
| ------------- | -------------------------------------------------------------------------------------------------------------------- |
| `{FROM}-{TO}` | The currency pair to convert from and to. Format as `FROM` to `TO` using ISO 4217 codes (e.g., `EUR-USD OR EURUSD`). |

### Success Response

A successful request returns the current exchange rate between the specified currencies:

```json
{
  "status": "success",
  "from": "EUR",
  "to": "USD",
  "rate": "1.0651",
  "pair": "EURUSD"
}
```

#### Response Fields

| Field    | Description                               |
| -------- | ----------------------------------------- |
| `status` | The status of the request (`success`).    |
| `from`   | The currency code of the source currency. |
| `to`     | The currency code of the target currency. |
| `rate`   | The exchange rate from `from` to `to`.    |
| `pair`   | The concatenated currency pair code.      |

### Error Response

If the request fails, typically due to an invalid currency pair, the following JSON is returned:

```json
{
  "status": "failed",
  "error": "Invalid exchange pair."
}
```

#### Error Response Fields

| Field    | Description                                   |
| -------- | --------------------------------------------- |
| `status` | The status of the request (`failed`).         |
| `error`  | A message describing the nature of the error. |

### Additional Notes

* Ensure that both currency codes are valid ISO 4217 codes.
* This endpoint does not require authentication.
* Rates are updated frequently, reflecting current market conditions.

***

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.malum.co/transaction-api/currency-exchange-rate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
