Exchange rate version v1
https://github.com/folio-org/mod-finance
Exchange rate API
This documents the API calls that can be made to get exchange rates
Exchange rate
Exchange rate API
Get exchange rate
get /finance/exchange-rate
Get exchange rate
Query Parameters
- from: required(string)
From currency code
Example:
USD
- to: required(string)
To currency code
Example:
EUR
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 200
Exchange rate successfully retrieved
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Exchange rate schema",
"type": "object",
"properties": {
"from": {
"description": "From currency code",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"to": {
"description": "To currency code",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"exchangeRate": {
"description": "Exchange rate value",
"type": "number"
}
},
"additionalProperties": false,
"required": [
"from",
"to",
"exchangeRate"
]
}
Example:
sample
HTTP status code 400
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "An error",
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
Example:
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
HTTP status code 404
Exchange rate is not available
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "An error",
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
Example:
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "An error",
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
Example:
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}