· 5 years ago · Jul 20, 2020, 07:10 PM
1swagger: '2.0'
2info:
3 description: |
4 # Environments
5 Young Platform B2B currently provide two different environments as described in this section.
6
7 Environment | Base url | Support versioning
8 ----------------|-------------|---------
9 Production | https://b2b.youngplatform.com/api | Yes
10 Sandbox | https://sandbox-b2b.youngplatform.com/api | Yes
11
12 Our `sandbox environment` provides a **no-limit** account with 20k Euros.
13
14 **Important**: If you need more balance, feel free to contact us at [b2b@youngplatform.com](mailto:b2b@youngplatform.com)
15
16 # Versioning
17
18 This documentation is for version 1.0 of the API. Use this table to find documentation for previous versions of the API:
19
20 API version | Changes
21 -------------|---------
22 1.0 | ----
23
24 # Authentication
25
26 Api key is provided by Young Platform after the business onboarding process.
27 If you don't have one or you want more info about Young Platform B2B services, please [contact us](mailto:b2b@youngplatform.com)
28
29
30 Api key example: `03c06dd7-4982-441a-910d-5fd2cbb3f1c6`
31 version: 1.0.0
32 title: Young Platform B2B
33 x-logo:
34 url: 'http://188.9.210.35:8000/images/logo.png'
35 altText: Petstore logo
36servers:
37 - url: https://b2b.youngplatform.com/api
38 basePath: /v1
39 description: Production server (uses live data)
40 - url: https://sandbox-b2b.youngplatform.com/api
41 description: Sandbox server (uses test data)
42tags:
43 - name: Account
44 description: Everything about your Account
45 - name: Markets
46 description: Access to Petstore orders
47 - name: Orders
48 description: Operations about user
49schemes:
50 - https
51 - http
52paths:
53 /account/balance:
54 get:
55 tags:
56 - Account
57 summary: Get wallets balance
58 description: ''
59 operationId: getBalance
60 consumes:
61 - application/json
62 produces:
63 - application/json
64 responses:
65 '200':
66 description: Ok
67 schema:
68 type: array
69 items:
70 $ref: '#/definitions/Balance'
71 '500':
72 description: Internal Server Error
73 schema:
74 type: object
75 properties:
76 code:
77 type: string
78 example: 'internal_error'
79 message:
80 type: string
81 example: "Something went wrong."
82
83 '/account/balance/{currency}':
84 get:
85 tags:
86 - Account
87 summary: Get wallet balance by currency
88 description: Returns a single pair market
89 operationId: getBalanceByPair
90 produces:
91 - application/json
92 parameters:
93 - name: currency
94 in: path
95 description: Currency to return
96 required: true
97 type: string
98 responses:
99 '200':
100 description: Ok
101 schema:
102 $ref: '#/definitions/Balance'
103 '400':
104 description: Bad Request
105 schema:
106 type: object
107 properties:
108 code:
109 type: string
110 example: 'currency_not_found'
111 message:
112 type: string
113 example: "Currency not found."
114 '500':
115 description: Internal Server Error
116 schema:
117 type: object
118 properties:
119 code:
120 type: string
121 example: 'internal_error'
122 message:
123 type: string
124 example: "Something went wrong."
125 /account/fees:
126 get:
127 tags:
128 - Account
129 summary: Get current account fees
130 description: ''
131 operationId: getFees
132 consumes:
133 - application/json
134 produces:
135 - application/json
136 responses:
137 '200':
138 description: Ok
139 schema:
140 type: array
141 items:
142 $ref: '#/definitions/Fee'
143 '500':
144 description: Internal Server Error
145 schema:
146 type: object
147 properties:
148 code:
149 type: string
150 example: 'internal_error'
151 message:
152 type: string
153 example: "Something went wrong."
154 /market:
155 get:
156 tags:
157 - Markets
158 summary: Get all markets
159 description: ''
160 operationId: getMarkets
161 consumes:
162 - application/json
163 produces:
164 - application/json
165 responses:
166 '200':
167 description: Ok
168 schema:
169 type: array
170 items:
171 $ref: '#/definitions/Market'
172 '500':
173 description: Internal Server Error
174 schema:
175 type: object
176 properties:
177 code:
178 type: string
179 example: 'internal_error'
180 message:
181 type: string
182 example: "Something went wrong."
183 '/market/{pair}':
184 get:
185 tags:
186 - Markets
187 summary: Get market by pair
188 description: Returns a single pair market
189 operationId: getMarketByPair
190 produces:
191 - application/json
192 parameters:
193 - name: pair
194 in: path
195 description: Pair to return
196 required: true
197 type: string
198 responses:
199 '200':
200 description: Ok
201 schema:
202 type: array
203 items:
204 $ref: '#/definitions/Market'
205 '400':
206 description: Bad Request
207 schema:
208 type: object
209 properties:
210 code:
211 type: string
212 example: 'pair_not_found'
213 message:
214 type: string
215 example: "Pair not found."
216 '500':
217 description: Internal Server Error
218 schema:
219 type: object
220 properties:
221 code:
222 type: string
223 example: 'internal_error'
224 message:
225 type: string
226 example: "Something went wrong."
227 security:
228 - api_key: []
229 /order/orderHistory:
230 get:
231 tags:
232 - Orders
233 summary: Get all orders
234 description: ''
235 operationId: getOrderHistory
236 consumes:
237 - application/json
238 produces:
239 - application/json
240 responses:
241 '200':
242 description: Ok
243 schema:
244 type: array
245 items:
246 $ref: '#/definitions/ClosedOrder'
247 '500':
248 description: Internal Server Error
249 schema:
250 type: object
251 properties:
252 code:
253 type: string
254 example: 'internal_error'
255 message:
256 type: string
257 example: "Something went wrong."
258 /order/placeOrder:
259 post:
260 tags:
261 - Orders
262 summary: Create a new order
263 description: ''
264 operationId: createOrder
265 consumes:
266 - application/json
267 produces:
268 - application/json
269 parameters:
270 - in: body
271 name: body
272 description: The user to create.
273 schema:
274 $ref: '#/definitions/CreateOrderModel'
275 responses:
276 '200':
277 description: Ok
278 schema:
279 $ref: '#/definitions/ClosedOrder'
280 '500':
281 description: Internal Server Error
282 schema:
283 type: object
284 properties:
285 code:
286 type: string
287 example: 'internal_error'
288 message:
289 type: string
290 example: "Something went wrong."
291definitions:
292 Balance:
293 type: object
294 properties:
295 currency:
296 type: string
297 amount:
298 type: number
299 format: decimal
300 Fee:
301 type: object
302 properties:
303 pair:
304 type: string
305 example: BTC-EUR
306 fee:
307 type: number
308 example: 0.5
309 Market:
310 type: object
311 properties:
312 pair:
313 type: string
314 example: BTC-EUR
315 last:
316 type: number
317 example: 0.02881448
318 lowest_ask:
319 type: number
320 example: 0.0271664
321 highest_bid:
322 type: number
323 example: 0.02967318
324 percent_change:
325 type: number
326 example: -12.1
327 base_volume:
328 type: number
329 example: 6346.67537171
330 quote_volume:
331 type: number
332 example: 220259.93083026
333 is_frozen:
334 type: boolean
335 example: false
336 high_24h:
337 type: number
338 example: '2,'
339 low_24h:
340 type: number
341 example: 0.02303214
342 ClosedOrder:
343 type: object
344 properties:
345 order_id:
346 type: number
347 example: 31113863
348 base_currency:
349 type: string
350 example: EUR
351 quote_currency:
352 type: string
353 example: BTC
354 volume:
355 type: number
356 example: 0.4273464
357 rate:
358 type: number
359 example: 1.14136325
360 amount:
361 type: number
362 example: 0.487757
363 service_charge:
364 type: number
365 example: 0.24038235
366 side:
367 type: string
368 example: BUY
369 date:
370 type: string
371 example: '2019-05-14T08:22:14.63'
372 CreateOrderModel:
373 type: object
374 properties:
375 pair:
376 type: string
377 example: BTC_EUR
378 side:
379 type: string
380 example: BUY
381 volume:
382 type: number
383 example: 0.4273464