-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.raml
More file actions
164 lines (161 loc) · 4.82 KB
/
api.raml
File metadata and controls
164 lines (161 loc) · 4.82 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#%RAML 0.8
title: Coinnect Standard API
version: v1
baseUri: /coinnect/v1/
mediaType: application/json
schemas:
- jsend: |
{
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "http://coinnect.io/schema#",
"description": "Following jsend @ http://labs.omniti.com/labs/jsend",
"properties": {
"status": {
"type": "string",
"required": true,
"description": "Response status",
"enum": [ "success", "fail", "error" ]
},
"data": {
"type": "object",
"description": "Data returned in case of success",
"oneOf": [
{ "$ref": "#/definitions/currencies" },
{ "$ref": "#/definitions/quote" },
{ "$ref": "#/definitions/order" }
]
},
"message":{
"type": "string",
"description": "Error message in case of error"
}
},
"definitions":{
"currencies": {
"type": "object",
"properties": {
"crypto": {
"type": "array",
"required": true,
"description": "Supported crypto currencies"
},
"fiat": {
"type": "array",
"required": true,
"description": "Supported fiat currencies"
}
}
},
"quote": {
"type": "object",
"properties": {
"crypto_from": {
"type": "string",
"required": "true",
"description": "Crypto currency quoted"
},
"fiat_to": {
"type": "string",
"required": "true",
"description": "Fiat currency quoted"
},
"amount_crypto": {
"type": "integer",
"required": "true",
"description": "Amount of crypto quoted"
},
"amount_fiat": {
"type": "integer",
"required": "true",
"description": "Amount of fiat. Integer value. Smallest denomination"
},
"expire_in":{
"type": "integer",
"required": "false",
"description": "Expiration in seconds"
}
}
},
"order": {
}
}
}
/currency:
displayName: Get supported currencies
description: List supported curriencies handled by the server
get:
responses:
200:
body:
application/json:
schema: jsend
example: |
{
"status" : "success",
"data": {
"crypto": [
"BTC", "ETH"
],
"fiat": [
"ARS", "MXN", "CLP", "USD", "BRL"
]
}
}
/quote:
description: Get a quote
get:
queryParameters:
crypto_from:
displayName: Crypto currency to get quote from
description: Currency code should be one of the codes provided in /currency (crypto_currency array)
type: string
default: BTC
required: true
fiat_to:
displayName: Fiat currency to get quote to
description: Currency code should be one of the codes provided in /currency (fiat_currency array)
type: string
required: true
example: USD
amount_crypto:
displayName: Amount of crypto_currency quoted
description: Amount to be quoted. |
Must be in the smallest denomination of the crypto_currency, if BTC then amount is in satoshi, if ETH in wei.
Default value is 1 standard denomination; 1 BTC (100000000 satoshis), 1 ETH (1000000000000000000).
type: integer
required: false
responses:
200:
body:
application/json:
schema: jsend
example: |
{
"status" : "success",
"data": {
"crypto_from": "BTC",
"fiat_to": "USD",
"amount_crypto": 100000000,
"amount_fiat": 42234,
"expire_in": 300
}
}
400:
body:
application/json:
schema: jsend
example: |
{
"status" : "fail",
"data": {
"crypto_from": "Unsupported currency code 'LTC'"
}
}
/order:
post:
description: Place a send money order
delete:
description: Cancel a send money order
get:
description: Query order info and status