-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi_trading_platform.yaml
169 lines (169 loc) · 4.49 KB
/
openapi_trading_platform.yaml
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
openapi: 3.1.0
info:
title: Forex Trading Platform API
description: >-
A RESTful API to simulate a Forex trading platform with WebSocket support
for real-time order updates.
version: 1.0.0
paths:
/orders:
get:
summary: Retrieve All Orders
operationId: retrieve_all_orders_orders_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/OrderOutput'
type: array
title: Response Retrieve All Orders Orders Get
post:
summary: Post Order
operationId: post_order_orders_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderInput'
required: true
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/OrderOutput'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/orders/{orderId}:
get:
summary: Get Order By Id
operationId: get_order_by_id_orders__orderId__get
parameters:
- name: orderId
in: path
required: true
schema:
type: string
title: Orderid
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/OrderOutput'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
summary: Cancel An Order
operationId: cancel_an_order_orders__orderId__delete
parameters:
- name: orderId
in: path
required: true
schema:
type: string
title: Orderid
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/ws:
get:
summary: WebSocket Endpoint
description: >-
WebSocket endpoint for real-time updates on order status. Connect to
this endpoint and send a message with the action 'subscribe' and the
'order_id' to receive updates for that specific order.
operationId: websocket_connection
responses:
'101':
description: WebSocket connection established
'426':
description: Upgrade Required
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
OrderInput:
properties:
stocks:
type: string
title: Stocks
description: Currency pair symbol (e.g. 'EURUSD'), or any other stuff
quantity:
type: number
title: Quantity
description: Quantity of the currency pair to be traded
type: object
title: OrderInput
OrderOutput:
properties:
stocks:
type: string
title: Stocks
description: Currency pair symbol (e.g. 'EURUSD'), or any other stuff
quantity:
type: number
title: Quantity
description: Quantity of the currency pair to be traded
id:
type: string
title: Id
status:
type: string
enum:
- PENDING
- EXECUTED
- CANCELED
title: Status
description: Status of the order
type: object
required:
- id
title: OrderOutput
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError