> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# ExchangeRate

ExchangeRate contains data on the rate to be used when converting amounts from one currency into another.

## Schema ID

`https://gobl.org/draft-0/currency/exchange-rate`

## Properties

| Title | Property | Type | Description |
| - | - | - | - |
| From | `from` | [currency.Code](https://docs.gobl.org/draft-0/currency/code.md) | Currency code this will be converted from. |
| To | `to` | [currency.Code](https://docs.gobl.org/draft-0/currency/code.md) | Currency code this exchange rate will convert into. |
| At | `at` | [cal.DateTime](https://docs.gobl.org/draft-0/cal/date_time.md) | Effective date and time at which the exchange rate was determined by the source. The time may be zero if referring to a specific day only. |
| Source | `source` | [cbc.Key](https://docs.gobl.org/draft-0/cbc/key.md) | Key identifying the source the exchange rate was obtained from. Typically set by an application that updates exchange rates automatically. |
| Amount | `amount` | [num.Amount](https://docs.gobl.org/draft-0/num/amount.md) | How much is 1 of the "from" currency worth in the "to" currency. |

## Validation Rules

| Field | Test | Validation Code / Message |
| - | - | - |
| `from` | <ul><li>Present</li></ul> | `GOBL-CURRENCY-EXCHANGERATE-01` From currency is required |
| `to` | <ul><li>Present</li></ul> | `GOBL-CURRENCY-EXCHANGERATE-02` To currency is required |
| `at` | <ul><li>Not zero</li></ul> | `GOBL-CURRENCY-EXCHANGERATE-03` Date/time must not be zero |
| `amount` | <ul><li>Min 0</li></ul> | `GOBL-CURRENCY-EXCHANGERATE-04` Amount must be positive |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.