# Rate API

API for getting exchange rates

## Get exchange rates

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Rate API","description":"API for getting exchange rates"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/rate":{"post":{"tags":["Rate API"],"summary":"Get exchange rates","description":"Permission annotations:","operationId":"getRates","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerPGRatesRequestDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PGRatesResponseDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"ContainerPGRatesRequestDTO":{"required":["payload","timestamp"],"type":"object","properties":{"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/PGRatesRequestDTO"}},"description":"Object with request data"},"PGRatesRequestDTO":{"type":"object","properties":{"fromCurrencies":{"uniqueItems":true,"type":"array","description":"List of source currencies for getting rate","items":{"$ref":"#/components/schemas/Currency"}},"toCurrencies":{"uniqueItems":true,"type":"array","description":"List of target currencies for getting rate","items":{"$ref":"#/components/schemas/Currency"}}},"description":"Request with currencies parameters"},"Currency":{"type":"string"},"PGRatesResponseDTO":{"required":["currencyRates"],"type":"object","properties":{"currencyRates":{"type":"array","description":"List of exchange rates","items":{"$ref":"#/components/schemas/CurrencyRates"}}},"description":"Exchange rates"},"CurrencyRates":{"required":["fromCurrency","rates","ratesDate","toCurrency"],"type":"object","properties":{"fromCurrency":{"type":"string","description":"Source currency"},"toCurrency":{"type":"string","description":"Target currency"},"rates":{"type":"number","description":"Rates"},"ratesDate":{"type":"string","description":"Rates date-time","format":"date-time"}},"description":"Exchange rates"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Get fiat exchange rates

> Permission annotations:

```json
{"openapi":"3.0.1","info":{"title":"Public API","version":"dev"},"tags":[{"name":"Rate API","description":"API for getting exchange rates"}],"servers":[{"url":"https://api.calypso.finance","description":"Generated server url"}],"paths":{"/api/v1/rate/fiat":{"post":{"tags":["Rate API"],"summary":"Get fiat exchange rates","description":"Permission annotations:","operationId":"getFiatRates","parameters":[{"name":"Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Sign","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerPGFiatRatesInvertRequestDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PGFiatRatesInvertResponseDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PublicGatewayErrorResponse"}}}}}}}},"components":{"schemas":{"ContainerPGFiatRatesInvertRequestDTO":{"required":["payload","timestamp"],"type":"object","properties":{"timestamp":{"type":"integer","description":"Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future","format":"int64"},"payload":{"$ref":"#/components/schemas/PGFiatRatesInvertRequestDTO"}},"description":"Object with request data"},"PGFiatRatesInvertRequestDTO":{"required":["from","to"],"type":"object","properties":{"from":{"type":"array","description":"List of source currencies for getting rate","items":{"$ref":"#/components/schemas/Currency"}},"to":{"type":"array","description":"List of target currencies for getting rate","items":{"$ref":"#/components/schemas/FiatCurrency"}}},"description":"Request with currencies parameters"},"Currency":{"type":"string"},"FiatCurrency":{"type":"string"},"PGFiatRatesInvertResponseDTO":{"required":["ratesMap"],"type":"object","properties":{"ratesMap":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}}},"description":"Response currency data"},"PublicGatewayErrorResponse":{"required":["errorCode","message","traceId"],"type":"object","properties":{"traceId":{"type":"string"},"errorCode":{"type":"string"},"message":{"type":"string"}}}}}}
```
