-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprice.json
More file actions
494 lines (494 loc) · 21.7 KB
/
price.json
File metadata and controls
494 lines (494 loc) · 21.7 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
{
"title": "Price",
"category": "ancillary",
"docpath": "prices",
"introduction": [
"A Price is the number of units equal in value to a single denominating unit. For example, the price of one U.S. Dollar might be 0.86 Euros. Prices may retrieved in any <a class=\"link\" href=\"/documentation/units\">Global Unit</a> or <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a>, and denominated in any Global Unit or Custom Unit. Custom Unit Prices may only be denominated in Custom Units from within the same <a class=\"link\" href=\"/documentation/entities\">Entity</a>.",
"You need not have supplied explicit prices for a given pairing, Amatino will derive prices from available data. For example, you may have supplied price data for Bitcoin in U.S. Dollars, but wish to retrieve the price of a Bitcoin in Euros.",
"Prices may be created for any Custom Unit. Global Unit prices are constants, and prices may only be retrieved for Global Units. When creating a Custom Unit Price, the Price may be denominated in any Global Unit, or in any Custom Unit for which you have previously supplied at least one Price.",
"When calculating Prices for retrieval, Amatino looks for the most recent available data less than or equal to the date of the Price. For example, if you supply prices for a Custom Unit on 23 Jan 2018 and 25 Jan 2018, and then request a Price dated at 24 Jan 2018, Amatino will use the 23 Jan 2018 data.",
"All Global Unit Prices served by Amatino come courtesy of the European Central Bank (ECB)."
],
"object": {
"name": "Price",
"exposition": "The Amatino API returns Price objects with the following structure",
"form": {
"root": "object",
"components": [
{
"key": {
"value": "\"global_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/units\">Global Unit</a> this Price describes, or <span class=\"monospace\">null</span> if this Price describes a <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a>.",
"mono": false
},
"example": {
"value": 5,
"mono": true
},
"source": {
"value": "/units/list",
"mono": false,
"link": "/documentation/unit_list"
}
},
{
"key": {
"value": "\"custom_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a> this Price describes, or <span class=\"monospace\">null</span> if this Price describes a <a class=\"link\" href=\"/documentation/global_units\">Global Unit</a>.",
"mono": false
},
"example": {
"value": 42,
"mono": true
}
},
{
"key": {
"value": "\"denomination_global_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/units\">Global Unit</a> denominating this Price, or <span class=\"monospace\">null</span> if this Price is denominated by <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a>.",
"mono": false
},
"example": {
"value": 5,
"mono": true
},
"source": {
"value": "/units/list",
"mono": false,
"link": "/documentation/unit_list"
}
},
{
"key": {
"value": "\"denomination_custom_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a> denominating this Price, or <span class=\"monospace\">null</span> if this Price is denominated by a <a class=\"link\" href=\"/documentation/global_units\">Global Unit</a>.",
"mono": false
},
"example": {
"value": 42,
"mono": true
}
},
{
"key": {
"value": "\"magnitude\"",
"mono": true
},
"type": {
"value": "JSON String",
"mono": false
},
"description": {
"value": "The number of priced units equal in value to one denominating unit",
"mono": false
},
"example": {
"value": "42.00",
"mono": true
}
},
{
"key": {
"value": "\"price_time\"",
"mono": true
},
"type": {
"value": "JSON String",
"mono": false
},
"description": {
"value": "Time at which this Price holds, in the format YYYY-MM-DD_HH24:MI:SS.US",
"mono": false
},
"example": {
"value": "\"2018-05-02_05:01:54.72941\"",
"mono": true
}
},
{
"key": {
"value": "\"generated_time\"",
"mono": true
},
"type": {
"value": "JSON String",
"mono": false
},
"description": {
"value": "Time that this Price was computed, in the format YYYY-MM-DD_HH24:MI:SS.US",
"mono": false
},
"example": {
"value": "\"2018-05-02_05:01:54.72941\"",
"mono": true
}
}
]
}
},
"actions": [{
"name": "Retrieve",
"method": "GET",
"path": "/prices",
"description": "Retrieve a Price or set of Prices",
"return_root_type": "JSON Array",
"required_json_data": {
"root": "list",
"max_length": 10,
"components": [
{
"key": {
"value": "\"global_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/units\">Global Unit</a> you wish to price, or <span class=\"monospace\">null</span> if you wish to wish to price a <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a>.",
"mono": false
},
"example": {
"value": 5,
"mono": true
},
"source": {
"value": "/units/list",
"mono": false,
"link": "/documentation/unit_list"
}
},
{
"key": {
"value": "\"custom_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a> you wish to price.",
"mono": false
},
"example": {
"value": 42,
"mono": true
}
},
{
"key": {
"value": "\"denomination_global_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/units\">Global Unit</a> denomination you wish to use, or <span class=\"monospace\">null</span> if you wish to use a <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a>.",
"mono": false
},
"example": {
"value": 42,
"mono": true
},
"source": {
"value": "/units/list",
"mono": false,
"link": "/documentation/unit_list"
}
},
{
"key": {
"value": "\"denomination_custom_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a> denomination you wish to use, or <span class=\"monospace\">null</span> if you wish to use a <a class=\"link\" href=\"/documentation/global_units\">Global Unit</a>.",
"mono": false
},
"example": {
"value": 42,
"mono": true
}
},
{
"key": {
"value": "\"price_time\"",
"mono": true
},
"description": {
"value": "Time at which the Price should hold, in the format YYYY-MM-DD_HH24:MI:SS.US",
"mono": false
},
"type": {
"value": "JSON String",
"mono": false
},
"example": {
"value": "\"2017-01-17_17:22:16.51245\"",
"mono": true
}
}
]
},
"required_headers": [
{
"key": "X-Signature",
"content": "Your <a class=\"link\" href=\"/documentation/sessions\">Session</a> signature",
"example": "\"yxATCPRKAAXHNiPctNQPHEGGVJF\"..."
},
{
"key": "X-Session-ID",
"content": "An an integer <a class=\"link\" href=\"/documentation/sessions\">Session</a> ID",
"example": 7449059267091272858
}
],
"required_url_parameters": [
{
"key": "entity_id",
"type": "string",
"description": "The entity id of the entity in which you wish to retrieve Prices",
"example": "oB3cjSNKXklkJ4Tb",
"repeatable": false
}
],
"returns": {
"root": "list",
"components": {
"object": "Price"
}
}
}, {
"name": "Create",
"method": "POST",
"path": "/prices",
"description": "Create a new Price or Prices",
"required_headers": [
{
"key": "X-Signature",
"content": "Your <a class=\"link\" href=\"/documentation/sessions\">Session</a> signature",
"example": "\"yxATCPRKAAXHNiPctNQPHEGGVJF\"..."
},
{
"key": "X-Session-ID",
"content": "An an integer <a class=\"link\" href=\"/documentation/sessions\">Session</a> ID",
"example": 7449059267091272858
}
],
"required_url_parameters": [
{
"key": "entity_id",
"type": "string",
"description": "The entity id of the entity in which you wish to record Prices",
"example": "oB3cjSNKXklkJ4Tb",
"repeatable": false
}
],
"return_root_type": "JSON Array",
"required_json_data": {
"root": "list",
"max_length": 10,
"components": [
{
"key": {
"value": "\"price_time\"",
"mono": true
},
"description": {
"value": "Time at which the Price holds, in the format YYYY-MM-DD_HH24:MI:SS.US",
"mono": false
},
"type": {
"value": "JSON String",
"mono": false
},
"example": {
"value": "\"2017-01-17_17:22:16.51245\"",
"mono": true
}
},
{
"key": {
"value": "\"custom_unit_id\"",
"mono": true
},
"description": {
"value": "The ID of the <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a> this Price should describe.",
"mono": false
},
"type": {
"value": "JSON Number",
"mono": false
},
"example": {
"value": "42",
"mono": true
}
},
{
"key": {
"value": "\"denomination_custom_unit_id\"",
"mono": true
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a> denomination you wish to use, or <span class=\"monospace\">null</span> if this Price is denominated by a <a class=\"link\" href=\"/documentation/global_units\">Global Unit</a>.",
"mono": false
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"example": {
"value": "null",
"mono": true
},
"source": {
"value": "/custom_units/list",
"mono": false,
"link": "/documentation/custom_unit_list"
}
},
{
"key": {
"value": "\"denomination_global_unit_id\"",
"mono": true
},
"type": {
"value": "JSON Number or JSON Null",
"mono": false
},
"description": {
"value": "Integer identifier of the <a class=\"link\" href=\"/documentation/units\">Global Unit</a> denomination you wish to use, or <span class=\"monospace\">null</span> if you wish to use a <a class=\"link\" href=\"/documentation/custom_units\">Custom Unit</a>.",
"mono": false
},
"example": {
"value": 5,
"mono": true
},
"source": {
"value": "/units/list",
"mono": false,
"link": "/documentation/unit_list"
}
}
]
},
"returns": {
"root": "list",
"components": {
"object": "transaction"
}
}
}, {
"name": "Delete",
"method": "DELETE",
"path": "/prices",
"return_root_type": "JSON Array",
"description": "Delete a Price or Prices",
"required_json_data": {
"root": "list",
"max_length": 10,
"components": [
{
"key": {
"value": "\"custom_unit_id\"",
"mono": true
},
"description": {
"value": "The ID of the Custom Unit for which you wish to delete a Price.",
"mono": false
},
"type": {
"value": "JSON Number",
"mono": false
},
"example": {
"value": "42",
"mono": true
}
},
{
"key": {
"value": "\"price_time\"",
"mono": true
},
"description": {
"value": "Time of the Price you wish to delete, in the format YYYY-MM-DD_HH24:MI:SS.US",
"mono": false
},
"type": {
"value": "JSON String",
"mono": false
},
"example": {
"value": "\"2017-01-17_17:22:16.51245\"",
"mono": true
}
}
]
},
"required_headers": [
{
"key": "X-Signature",
"content": "Your <a class=\"link\" href=\"/documentation/sessions\">Session</a> signature",
"example": "\"yxATCPRKAAXHNiPctNQPHEGGVJF\"..."
},
{
"key": "X-Session-ID",
"content": "An an integer <a class=\"link\" href=\"/documentation/sessions\">Session</a> ID",
"example": 7449059267091272858
}
],
"required_url_parameters": [
{
"key": "entity_id",
"type": "string",
"description": "The entity id of the entity in which you wish to delete Prices",
"example": "oB3cjSNKXklkJ4Tb",
"repeatable": false
}
],
"returns": {
"root": "list",
"components": {
"object": "transaction"
}
}
}
]
}