JSON API: Currency Queries

Currency queries are used to obtain a list of the currencies defined in the ledger.

Refer to the currency query schema for a formal definition of the request and the currency query response schema for a definition of the response.

Currencies are retrieved by code. There are two ways to select results: the range andrangeEnding properties specify the first and last code to retrieve, respectively. Alternatively, the codes array can be used to select or exclude specific codes and code ranges.

The page size limit is capped by the ledger configuration. If a request is made for more records than the configured limit, then only the configured maximum page size will be returned.

Route: currency/query

Request all currencies in sets of 10:

{
  "limit": 10
}

Request a single currency:

{
  "codes": ["CAD"]
}

Sample result:

{
  "currencies": [
    {
      "code": "CAD",
      "decimals": 2,
      "revision": "970867c6fce070db563107ff12650d73fab4c428a0d9162bcc47a1049186497f",
      "createdAt": "2021-12-29T04:25:08.421723Z",
      "updatedAt": "2021-12-29T04:25:08.421723Z"
    }
  ],
  "after": "2ec47cc3-6117-40f8-adaf-d1067caf04b0",
  "time": "2022-01-18T16:10:58.021722Z"
}