# Currency Conversion Rates (API)

On the Home page of UnitPay personal cabinet there is a section "Reference information", where we display currency exchange rates. The same data can be requested using API request.

```
https://unitpay.ru/api? 
     method=getCurrencyCourses 
     params[login]=partner@example.com
     params[secretKey]=secretKey
```

<table data-header-hidden><thead><tr><th width="199.33333333333331">name</th><th width="175.111083984375">type</th><th>description</th></tr></thead><tbody><tr><td><strong>login</strong></td><td>string</td><td>Email account in the UnitPay system</td></tr><tr><td><strong>secretKey</strong></td><td>string</td><td>Account secret key, available in the UnitPay profile settings</td></tr></tbody></table>

#### An example of a successful request:&#x20;

```
https://unitpay.ru/api?method=getCurrencyCourses&params[login]=unitpay-test@example.ru&params[secretKey]=11122233F11-1F2220E3344-11122233D2
```

#### Example of a successful response:

```
{
   "result": {
      "in": {
         "wmz": 62.57,
         "usd": 74.55
      },
      "out": {
         "wmz": 64.9,
         "eur": 80.65
      }
   }
}
```

<table data-header-hidden><thead><tr><th width="150.44441731770831">name</th><th width="140.22216796875">type</th><th>description</th></tr></thead><tbody><tr><td>payment type</td><td>text</td><td>Conversion type: to receive (in) or to pay out (out)</td></tr><tr><td>currency</td><td>text</td><td>Currency of payment/payment</td></tr><tr><td>course</td><td>number</td><td>Conversion rate of the selected currency</td></tr></tbody></table>

#### **Description of possible errors:**

<table data-header-hidden><thead><tr><th width="172.88897705078125">name</th><th>description</th></tr></thead><tbody><tr><td><strong>-32000</strong></td><td>Invalid authorization parameters (login, secret key)</td></tr><tr><td><strong>-32602</strong></td><td>Invalid query parameters</td></tr><tr><td><strong>-32603</strong></td><td>Internal technical error</td></tr></tbody></table>
