Wiki source code of 8. GetExchangeRates

Last modified by Giorgi Mdivnishvili on 2024/08/29 16:51

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2
3
4 {{toc/}}
5 {{/box}}
6
7 = Method Description =
8
9
10 Using this method, you can retrieve information about the currencies available in the system and their exchange rates.
11
12
13 Using this method, you can individually retrieve information about the currencies available in the system and their exchange rates. However, when searching for tour packages, if you provide the currency, you can pass the currency code, and the response will include the conversion rate alongside the requested data.
14
15
16 Based on the example provided in the image, it is evident that if you pass "searchCurrency": "USD", you will receive the exchange rate between Euro and USD, as the search is for a destination in Turkey where the default pricing is given in Euros. This example is illustrated using the tour package search method.
17
18 [[image:1724857515177-399.png]]
19
20
21
22 == EndpointURL - [GET] ==
23
24 {{info}}
25 [[https:~~/~~/integration.kazunion.com/api/Currency/GetExchangeRates>>https://integration.kazunion.com/api/Currency/GetExchangeRates]]
26 {{/info}}
27
28
29 == Request Body ==
30
31 {{code language="Json"}}
32 none
33 {{/code}}
34
35
36 === Response example data ===
37
38 {{code language="Json"}}
39 [
40 {
41 "id": 20569387,
42 "convertFrom": "AED",
43 "convertTo": "USD",
44 "rate": 0.2729
45 },
46 {
47 "id": 20569388,
48 "convertFrom": "EUR",
49 "convertTo": "USD",
50 "rate": 1.1168
51 },
52 {
53 "id": 20569389,
54 "convertFrom": "AZN",
55 "convertTo": "USD",
56 "rate": 0.5863
57 },
58 {
59 "id": 20569390,
60 "convertFrom": "TRY",
61 "convertTo": "USD",
62 "rate": 0.2353
63 },
64 {
65 "id": 20569391,
66 "convertFrom": "QAR",
67 "convertTo": "USD",
68 "rate": 0.2762
69 },
70 ]
71 {{/code}}
72
73
74 === Schema ===
75
76 {{success}}
77 [ExchangeRate{
78 id   integer($int32)
79 convertFrom   string
80 nullable: true
81 convertTo   string
82 nullable: true
83 rate   number($double)
84 }]
85 {{/success}}
86
87
88
89 ==== Response parameters ====
90
91
92 (% class="table-bordered" %)
93 |=Parameter|=example|=Description
94 |id|20569387|ID of convertion
95 |convertFrom|AED|The currency from which the conversion is made.
96 |convertTo|USD|The currency to which the conversion is made.
97 |rate|0.2729|Given conversion rate.
98
99