---
title: "Store new currency exchange rates under this from/to pair."
method: POST
path: "/v1/exchange-rates/by-currencies/{from}/{to}"
tags: ["currency_exchange_rates"]
---

# Store new currency exchange rates under this from/to pair.

`POST /v1/exchange-rates/by-currencies/{from}/{to}`

## Request

- Base URL: `https://demo.firefly-iii.org/api`
- URL: `https://demo.firefly-iii.org/api/v1/exchange-rates/by-currencies/{from}/{to}`
- 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 set of exchange rates for this pair. The date is variable, and the data required can be submitted as a JSON body.

## Path parameters

- `from` string, required
- `to` string, required

## Headers

- `X-Trace-Id` string, uuid

## Request body

- CurrencyExchangeRateStoreByPair: The actual entries for this data set. They 'key' value is the date in YYYY-MM-DD. The value is the exchange rate.

## Response `200`

New exchange rates stored, result in response. If a rate already existed for any submitted entry, it will be updated.

- CurrencyExchangeRateArray
  - `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
  - `meta` Meta, required
    - `pagination` object
      - `total` integer
      - `count` integer
      - `per_page` integer
      - `current_page` integer
      - `total_pages` integer
  - `links` PageLink, required
    - `self` string, uri
    - `first` string, uri
    - `next` string, uri, nullable
    - `prev` string, uri, nullable
    - `last` 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-4-14.md) - [All operations](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-4-14/llms.txt) - [OpenAPI document](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-4-14/revisions/73f0baf3c408?raw)
