---
title: "Store a new currency exchange rate."
method: POST
path: "/v1/exchange-rates"
tags: ["currency_exchange_rates"]
---

# Store a new currency exchange rate.

`POST /v1/exchange-rates`

## Request

- Base URL: `https://demo.firefly-iii.org/api`
- URL: `https://demo.firefly-iii.org/api/v1/exchange-rates`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://demo.firefly-iii.org/oauth/authorize`
    - Token URL: `https://demo.firefly-iii.org/oauth/token`
  - HTTP bearer

Stores a new exchange rate. The data required can be submitted as a JSON body or as a list of parameters.

## Headers

- `X-Trace-Id` string, uuid

## Request body

- CurrencyExchangeRateStore
  - `date` string, date, required: The date to which the exchange rate is applicable.
  - `from` string, string, required: The base currency code.
  - `to` string, string, required: The destination currency code.
  - `rate` string, string: The exchange rate from the base currency to the destination currency.

## Response `200`

New exchange stored, result in response. If a rate already exists for this currency pair and date, it will be updated.

- CurrencyExchangeRateSingle
  - `data` CurrencyExchangeRateRead, required
    - `type` string, string: Immutable value
    - `id` string, string
    - `attributes` CurrencyExchangeProperties
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `from_currency_id` string, string: Base currency ID for this exchange rate entry.
      - `from_currency_name` string, string: Base currency name for this exchange rate entry.
      - `from_currency_code` string, string: Base currency code for this exchange rate entry.
      - `from_currency_symbol` string, string: Base currency symbol for this exchange rate entry.
      - `from_currency_decimal_places` integer: Base currency decimal places for this exchange rate entry.
      - `to_currency_id` string, string: Destination currency ID for this exchange rate entry.
      - `to_currency_name` string, string: Destination currency name for this exchange rate entry.
      - `to_currency_code` string, string: Destination currency code for this exchange rate entry.
      - `to_currency_symbol` string, string: Destination currency symbol for this exchange rate entry.
      - `to_currency_decimal_places` integer: Destination currency decimal places for this exchange rate entry.
      - `rate` string, string: The actual exchange rate. How many 'to' currency will you get for 1 'from' currency?
      - `date` string, date-time: Date and time of the exchange rate.
    - `links` ObjectLink
      - `0` object
        - `rel` string, string
        - `uri` string, string
      - `self` string, uri

## Other responses

- `400`: Bad request
- `401`: Unauthenticated
- `404`: Page not found
- `422`: Validation error. The body will have the exact details.
- `500`: Internal exception

---

[API](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-1.md) - [All operations](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-1/llms.txt) - [OpenAPI document](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-1/revisions/d60bf328844a?raw)
