-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexchange.raml
More file actions
149 lines (144 loc) · 4.59 KB
/
exchange.raml
File metadata and controls
149 lines (144 loc) · 4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#%RAML 1.0
title: Exchange
version: v1
protocols: [ HTTP, HTTPS ]
baseUri: https://github.com/folio-org/mod-finance
documentation:
- title: Exchange API
content: This documents the API calls that can be made to get exchange operations
types:
exchangeRate: !include acq-models/mod-finance/schemas/exchange_rate.json
exchangeRateSource: !include acq-models/mod-finance/schemas/exchange_rate_source.json
errors: !include raml-util/schemas/error.schema
currency_code:
description: currency_code expressed as a code of currency
type: string
example: USD
amount:
type: number
description: Amount expressed as a number of major currency units that needs to be calculate
example: 99.95
exchange_calculation:
type: number
description: Exchange calculation expressed as a total calculation of exchange
example: 99.95
/finance/calculate-exchange:
displayName: Calculate exchange
description: Calculate exchange API
get:
description: "Get exchange calculation"
queryParameters:
from:
description: "Source currency code"
type: currency_code
required: true
example: USD
to:
description: "Target currency code"
type: currency_code
required: true
example: EUR
amount:
description: "The amount of money to calculate exchange"
type: amount
required: true
example: 100.0
rate:
description: "The User defined exchange rate"
type: amount
required: false
example: 1.08
manual:
description: "Is the exchange rate manually set?"
type: boolean
required: false
default: false
example: false
operationMode:
description: "Operation mode for manual exchange rate use, MULTIPLY (default) or DIVIDE"
type: string
required: false
default: ""
example: "MULTIPLY"
responses:
200:
description: "Exchange calculation successfully retrieved"
body:
application/json:
type: exchange_calculation
example:
strict: false
value: 200.0
400:
description: "Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response."
body:
application/json:
type: errors
example:
strict: false
value: !include raml-util/examples/error.sample
404:
description: "Exchange rate is not available"
body:
application/json:
type: errors
example:
strict: false
value: !include raml-util/examples/error.sample
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
type: errors
example:
strict: false
value: !include raml-util/examples/error.sample
/finance/exchange-rate:
displayName: Exchange rate
description: Exchange rate API
get:
description: "Get exchange rate"
queryParameters:
from:
description: "From currency code"
type: currency_code
required: true
example: USD
to:
description: "To currency code"
type: currency_code
required: true
example: EUR
responses:
200:
description: "Exchange rate successfully retrieved"
body:
application/json:
type: exchangeRate
example:
strict: false
value: sample
400:
description: "Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response."
body:
application/json:
type: errors
example:
strict: false
value: !include raml-util/examples/error.sample
404:
description: "Exchange rate is not available"
body:
application/json:
type: errors
example:
strict: false
value: !include raml-util/examples/error.sample
500:
description: "Internal server error, e.g. due to misconfiguration"
body:
application/json:
type: errors
example:
strict: false
value: !include raml-util/examples/error.sample