Skip to content

Create Fx Rate

POST
/api/v1/exchange-rates
curl --request POST \
--url https://example.com/api/v1/exchange-rates \
--header 'Content-Type: application/json' \
--data '{ "from_currency": "example", "to_currency": "example", "rate": 1, "date": "2026-04-15" }'
Media typeapplication/json
ExchangeRateCreate
object
from_currency
required
From Currency

Source currency, ISO 4217 code.

string
/^[A-Z]{3}$/
to_currency
required
To Currency

Target currency, ISO 4217 code.

string
/^[A-Z]{3}$/
rate
required
Any of:
number
> 0
date
required
Date

Date the rate applies to.

string format: date

Example generated

{
"from_currency": "example",
"to_currency": "example",
"rate": 1,
"date": "2026-04-15"
}

Successful Response

Media typeapplication/json
ExchangeRateOut
object
id
required
Id

Exchange rate id.

integer
from_currency
required
From Currency

Source currency, ISO 4217 code.

string
to_currency
required
To Currency

Target currency, ISO 4217 code.

string
rate
required
Rate

Exchange rate: 1 unit of from_currency in to_currency.

string
date
required
Date

Date the rate applies to.

string format: date
source
Source

Where the rate came from: ‘manual’ or ‘auto’ (frankfurter.app/ECB).

string
default: manual

Example

{
"source": "manual"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}