JSON API: Manage Currencies

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

Route: currency/add

Sample request:

{
    "code": "USD",
    "decimals": 2
}

Sample response:

{
  "currency": {
    "code": "USD",
    "decimals": 2,
    "revision": "a93b5c344d42e4f5072fadb912fb059625fb051918505c64af105984e276da77",
    "createdAt": "2021-12-29T04:06:02.179669Z",
    "updatedAt": "2021-12-29T04:06:02.179669Z"
  },
  "time": "2021-12-29T04:06:02.182178Z"
}

Route: currency/delete

Sample request:

{
  "code": "USD",
  "revision": "a93b5c344d42e4f5072fadb912fb059625fb051918505c64af105984e276da77"
}

Sample response:

{
  "success": true,
  "time": "2021-12-29T04:09:02.310172Z"
}

Route: currency/get

Sample request:

{
    "code": "CAD"
}

Sample response:

{
  "currency": {
    "code": "CAD",
    "decimals": 2,
    "revision": "970867c6fce070db563107ff12650d73fab4c428a0d9162bcc47a1049186497f",
    "createdAt": "2021-12-29T04:25:08.421723Z",
    "updatedAt": "2021-12-29T04:25:08.421723Z"
  },
  "time": "2021-12-29T04:25:08.499757Z"
}

Route: currency/update

Sample request:

{
  "currency": {
    "code": "KDI",
    "decimals": 3,
    "toCode": "KWD",
    "revision": "a93b5c344d42e4f5072fadb912fb059625fb051918505c64af105984e276da77"
  }
}

Sample response:

{
  "currency": {
    "code": "KWD",
    "decimals": 3,
    "revision": "15a68d1643bd00195c281a801631bddf282093a51d6284e0eed25820cde7a467",
    "createdAt": "2021-12-29T05:32:03.612888Z",
    "updatedAt": "2021-12-29T05:32:03.612888Z"
  },
  "time": "2021-12-29T05:32:03.700805Z"
}