foliolib.folio.api.finance.ExchangeRate

class foliolib.folio.api.finance.ExchangeRate(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Exchange rate API

This documents the API calls that can be made to get exchange rates

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

get_exchangeRates(**kwargs)

Get exchange rate

get_exchangeRates(**kwargs)

Get exchange rate

GET /finance/exchange-rate

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • from (currency_code) –

    From currency code

    Example

    • USD

  • to (currency_code) –

    To currency code

    Example

    • EUR

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Exchange rate schema",
  "type": "object",
  "properties": {
    "from": {
      "description": "From currency code",
      "$ref": "../../common/schemas/currency_code.json"
    },
    "to": {
      "description": "To currency code",
      "$ref": "../../common/schemas/currency_code.json"
    },
    "exchangeRate": {
      "description": "Exchange rate value",
      "type": "number"
    }
  },
  "additionalProperties": false,
  "required": [
    "from",
    "to",
    "exchangeRate"
  ]
}