-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
2425 lines (2318 loc) · 81.5 KB
/
openapi.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
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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Bity Exchange API
description: >
The present document gives the technical details enabling one to make
request to and understand the responses of the Exchange API. Should you
want to know what is possible to do with the API, please consult the
product guide or have a look at the
[product page](https://go.bity.com/Exchange API).
Version 2 of the Exchange API (this version) is stable and should be
considered reliable. However, Bity reserves itself the right to correct
bugs in these API endpoints without considering such corrections as being
breaking changes.
Connection to the API happens over HTTP/1.1 (RFC 7231) and HTTP State
Management (RFC 6265) is required. Most libraries and user-agents allowing
HTTP requests to be performed already implements that for you as long as
cookies are not disabled and that you are requesting credentials to be
included in the requests.
API clients of registered partners add an optional `Client-ID` header to
the requests. This enables partners to benefit from profit sharing. See the
[corresponding section of the product
guide](https://doc.bity.com/exchange/guide.html#financial-partners)
for more details.
End-users can access the order status page via
[https://go.bity.com/order-status](https://go.bity.com/order-status). A
link to the status of a specific order can be constructed by appending the
order identifier to `https://go.bity.com/order-status?id=`. The order
status page allows to contact the Bity Support Team about a specific order.
The OpenAPI definition in YAML format is available
[here](https://doc.bity.com/exchange/exchange_api_v2.openapi.yaml).
version: 2.6.0
contact:
name: Bity SA
url: https://bity.com/
license:
name: Bity
url: https://go.bity.com/legal
termsOfService: https://go.bity.com/legal
x-konfig-ignore:
potential-incorrect-type: true
servers:
- description: Bity Exchange API version 2
url: https://exchange.api.bity.com/v2
tags:
- name: Orders
- name: Currencies
- name: Other
paths:
/currencies:
summary: Get currencies
description: Available currencies are those exclusively supported by Bity.
get:
tags:
- Currencies
summary: List currencies
operationId: get_currencies
security:
- {}
parameters:
- description: >-
Comma-separated list of tags. Currencies that contain all tags will
be filtered.
explode: false
in: query
name: tags
required: false
schema:
items:
$ref: '#/components/schemas/CurrencyTag'
type: array
style: form
responses:
'200':
description: Successful operation
content:
application/json:
examples:
Filtered currencies:
description: List currencies filtering by "fiat".
value:
currencies:
- tags:
- fiat
code: CHF
input_methods:
- input_object_type: bank_account
name: bank_transfer
- input_object_type: online_instant_payment
name: online_instant_payment
max_digits_in_decimal_part: 2
- tags:
- fiat
code: EUR
input_methods:
- input_object_type: bank_account
name: bank_transfer
- input_object_type: online_instant_payment
name: online_instant_payment
max_digits_in_decimal_part: 2
List currencies:
description: List currencies without any filter.
value:
currencies:
- tags:
- crypto
code: BTC
input_methods:
- input_object_type: crypto_address
name: crypto_transaction
max_digits_in_decimal_part: 8
- tags:
- fiat
code: CHF
input_methods:
- input_object_type: bank_account
name: bank_transfer
- input_object_type: online_instant_payment
name: online_instant_payment
max_digits_in_decimal_part: 2
- tags:
- crypto
- ethereum
code: ETH
input_methods:
- input_object_type: crypto_address
name: crypto_transaction
max_digits_in_decimal_part: 18
- tags:
- fiat
code: EUR
input_methods:
- input_object_type: bank_account
name: bank_transfer
- input_object_type: online_instant_payment
name: online_instant_payment
max_digits_in_decimal_part: 2
- tags:
- crypto
- ethereum
- erc20
code: USDC
input_methods:
- input_object_type: crypto_address
name: crypto_transaction
max_digits_in_decimal_part: 6
schema:
$ref: '#/components/schemas/CurrenciesResponse'
'429':
$ref: '#/components/responses/RateLimited'
/currencies/{currency_code}:
summary: Get a single currency
description: Obtain information about a specified currency.
get:
tags:
- Currencies
summary: Get a single currency
operationId: Currencies_getByCode
security:
- {}
parameters:
- description: >-
Currency code identifying the currency about which to return
information.
in: path
name: currency_code
required: true
schema:
$ref: '#/components/schemas/CurrencyCode'
responses:
'200':
description: Successful operation
content:
application/json:
examples:
CHF:
description: Details of the CHF currency
value:
tags:
- fiat
code: CHF
input_methods:
- input_object_type: bank_account
name: bank_transfer
- input_object_type: online_instant_payment
name: online_instant_payment
max_digits_in_decimal_part: 2
schema:
$ref: '#/components/schemas/CurrencyDetails'
'404':
description: Currency not found or unsupported
'429':
$ref: '#/components/responses/RateLimited'
/orders:
get:
tags:
- Orders
summary: List previously placed orders
operationId: list_orders
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.history
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.audit
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.history
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.audit
- client_oauth:
- https://auth.bity.com/scopes/exchange.client-history
- client_oauth:
- https://auth.bity.com/scopes/exchange.client-history-full
description: |
Get a list of previously placed orders. Depending on the authentication
method used different orders will be returned.
When the `bity_account_oauth` or `bity_account_client_oauth` security
schemes are used, which orders are visible depends on the scope of the
access token.
parameters:
- description: >-
Number of the page to retrieve, defaults to the first page (1). See
also the `Link` header in the 200 response.
in: query
name: page
required: false
schema:
minimum: 1
type: number
- description: Number of orders to include in a page. When not specified, 100.
in: query
name: page_size
required: false
schema:
maximum: 100
minimum: 1
type: number
- description: |
When specified, restrict the orders listing to orders with a
specific status.
The currently understood values are:
- `finalized`: Only include orders that have reached a final state.
- `ongoing`: Only include orders that are not finalized.
in: query
name: status
required: false
schema:
enum:
- finalized
- ongoing
type: string
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/ListOrdersResponse'
headers:
Link:
$ref: '#/components/headers/Link'
'429':
$ref: '#/components/responses/RateLimited'
post:
tags:
- Orders
summary: Place an order
operationId: place_order
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
It is possible to specify amount in the input or output in which case
the corresponding input or output amount will be computed.
The input or output amount can be estimated beforehand using the
dedicated endpoint, see "Estimate the amount of an order".
The input object must in principle contain the IBAN or crypto-address
which will be used to pay the order. In some cases, this is optional.
See "Estimate the amount of an order" to figure out if this information
can be omitted or not. Omitting the information increases the number of
situations were we can be required to cancel an order uppon
reception of the funds. To ensure a reliable execution of your order,
the crypto-address or IBAN must be provided and the paiment must be
made from the provided object.
requestBody:
content:
application/json:
examples:
Buy CHF with ETH:
description: |
Request to place an order for buying CHF with ETH.
value:
input:
amount: '0.5'
crypto_address: '0xf35074bbd0a9aee46f4ea137971feec024ab7048'
currency: ETH
type: crypto_address
output:
bic_swift: XXXXCHXXXXX
currency: CHF
iban: CH3600000000000000000
owner:
address: Brückenstrasse 12
city: Bern
country: CH
name: John Doe
zip: '3000'
type: bank_account
Buy ETH with CHF and a credit card:
description: |
Request to place an order for buying ETH with CHF. The CHF
payment is to be made with a credit card.
value:
input:
amount: '0.5'
currency: CHF
type: online_instant_payment
output:
crypto_address: '0xf35074bbd0a9aee46f4ea137971feec024ab7048'
currency: ETH
type: crypto_address
schema:
$ref: '#/components/schemas/PlaceOrderRequest'
responses:
'201':
description: |
The order has been successfully created.
The `Location` header contains the URI (which can be relative) at
which the order status and details can be retrieved. That is the
`Location` header is meant to be interpreted as per RFC 7231 section
7.1.2.
headers:
Location:
description: URL to use for retrieving the details of the order.
schema:
type: string
'400':
description: >
Following cases:
- Unsupported currency pair.
- Quota exceeded for the bank account or crypto-address.
- Provided input payment address cannot be used currently. Please
try again later.
- Internal error.
'429':
$ref: '#/components/responses/RateLimited'
/orders/estimate:
summary: Estimate the input or output amounts of an order before placing it
description: |
Gets an accurate estimation for the output amount given an input amount
and vice-versa. It however does not take into account all the limitations
(such as currently consumed quota) that are enforced when an order is
placed. As such, obtaining an estimation does not guarantee that the
corresponding order can be placed.
The response also contains the minimum amount allowed for placing an
order with this pair. When the amount in the request is too small, an
estimation for the minimum amount is performed instead.
post:
tags:
- Orders
summary: Estimate the amount of an order
operationId: Orders_calculateAmountEstimate
security:
- {}
- bity_account_oauth: []
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
The endpoint is similar to the endpoints allowing an order to be placed.
However, only the currencies and the input or output amount are
necessary in the request.
Providing optional information, such as `type` in the `input` and
`output` objects will result in a more precise estimate being returned.
requestBody:
content:
application/json:
examples:
Estimate for buying BTC with a credit card:
description: |
Request an estimate for buying BTC, with 200 CHF paid via
credit card.
value:
input:
amount: '200'
currency: CHF
type: online_instant_payment
output:
currency: BTC
type: crypto_address
Estimate input amount:
description: Estimation the input amount for a given output amount.
value:
input:
currency: BTC
output:
amount: '0.5'
currency: ETH
Estimate output amount:
description: Estimating the output amount for a given input amount.
value:
input:
amount: '1.00000000'
currency: BTC
output:
currency: EUR
schema:
$ref: '#/components/schemas/AmountEstimateRequest'
responses:
'200':
description: Successful operation
content:
application/json:
examples:
Estimate:
description: |
Example response to a request specifying the input or output
amount.
value:
input:
amount: '415.45'
currency: CHF
object_information_optional: true
type: online_instant_payment
ordering_requirements:
account:
satisfied: true
account_quota:
satisfied: true
kyc:
satisfied: true
output:
amount: '0.01000000'
currency: BTC
minimum_amount: '0.00020204'
type: crypto_address
price_breakdown:
customer_trading_fee:
amount: '3.32'
currency: CHF
instant_payment_fee:
amount: '15.79'
currency: CHF
output_transaction_cost:
amount: '0.00003972'
currency: BTC
schema:
$ref: '#/components/schemas/AmountEstimate'
'400':
description: >-
Malformed request. <br> Invalid currency code. <br> Invalid currency
pair. <br> Invalid amount.
'429':
$ref: '#/components/responses/RateLimited'
/orders/estimate/multiple:
post:
tags:
- Orders
summary: Perform several estimations in one request
operationId: Orders_performMultipleEstimations
security:
- {}
- bity_account_oauth: []
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: >-
This endpoint is equivalent to `/orders/estimate` except that several
estimations can be performed in a single request.
requestBody:
content:
application/json:
examples:
CHF to BTC and ETH:
description: |
Request estimates for CHF→BTC and CHF→ETH.
value:
- input:
amount: '200'
currency: CHF
output:
currency: BTC
- input:
amount: '200'
currency: CHF
output:
currency: ETH
schema:
$ref: '#/components/schemas/OrdersPerformMultipleEstimationsRequest'
responses:
'200':
description: Successful operation
content:
application/json:
examples:
CHF to BTC and ETH:
description: |
Estimates for CHF→BTC and CHF→ETH.
value:
- input:
amount: '200.00'
currency: CHF
minimum_amount: '10.00'
object_information_optional: false
type: bank_account
output:
amount: '0.00493540'
currency: BTC
type: crypto_address
price_breakdown:
customer_trading_fee:
amount: '1.60'
currency: CHF
non-verified_fee:
amount: '0.80'
currency: CHF
output_transaction_cost:
amount: '0.00003972'
currency: BTC
- input:
amount: '200.00'
currency: CHF
minimum_amount: '10.00'
object_information_optional: false
type: bank_account
output:
amount: '0.089742853056898515'
currency: ETH
type: crypto_address
price_breakdown:
customer_trading_fee:
amount: '1.60'
currency: CHF
non-verified_fee:
amount: '0.80'
currency: CHF
output_transaction_cost:
amount: '0.002167105536687000'
currency: ETH
schema:
$ref: '#/components/schemas/OrdersPerformMultipleEstimationsResponse'
'400':
description: >-
This endpoint can produce the same errors as `/orders/estimate` in
addition to refusing to perform too many estimations in a single
call.
'429':
$ref: '#/components/responses/RateLimited'
/orders/{order_uuid}:
summary: Order details
get:
tags:
- Orders
summary: Get the details of an order
operationId: Orders_getOrderDetails
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.audit
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.history
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.audit
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.history
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
Please note the following:
- If the amount paid is not exactly the input amount, we can be
required to cancel the order, or the output amount will be adjusted
and extra fees could be charged.
- If it is sent in multiple transactions, we can be required to cancel
the order and extra processing fees could be charged.
### Minimal details
When the request does not include sufficient credentials, only minimal
information is returned. If you are unexpectedly receiving only minimal
details, please double check which security scheme you are using and
used to place the order. When no security scheme is used, please make
sure you are making all the requests to the correct URLs and that
cookies are accepted and handled according to RFC 6265. Most user
agents handle that for you but cookies must not be disabled and you may
have to request the user-agent to include credentials in the request.
The full information is returned when one of the following is true:
- No security scheme is used and the order was placed while
unauthenticated, in the same session.
- The `bity_account_oauth` or `bity_account_oauth_client` security
scheme are used, the scope includes
`https://auth.bity.com/scopes/exchange.place` or
`https://auth.bity.com/scopes/exchange.history`, and the OAuth client
is the client having placed the order.
- The `bity_account_oauth` or `bity_account_oauth_client` security
scheme are used and the scope includes
`https://auth.bity.com/scopes/exchange.audit`.
- The `client_oauth` security scheme is used and the OAuth client is
the client having placed the order.
### Output address signature
When the customer is not authenticated or has not gone through the KYC
process, crypto-to-crypto and fiat-to-crypto orders require the
signature of a message by the output address for the order to become
executable. When such a signature is required "message_to_sign" is
included in the response. The price will not be fixed and the payment
details will not be provided before the signature of the message is
submitted.
### Input and output objects
The input type and output type can be one of "crypto_address" or
"bank_account".
- In case it is "crypto_address" the object additionally contains
"crypto_address".
- In case it is "bank_account" the object additionally contains "iban".
Whenever the input object contains iban or crypto_address, the input
must be paid from the corresponding object. If this is not the case, we
can be required to cancel the order and perform a refund uppon
reception of the funds and extra fees can be charged.
### Payment details
This object describes how to pay the input amount.
There are two different possible types of payment details:
`"crypto_address"` and `"bank_account"`. Both types are described
bellow. The amount and the associated currency is found in the input
object.
#### Crypto-address
When the payment must be made to a crypto-address, the `type` is
`"crypto_address"` and the address to use as a destination address
is found in the `"crypto_address"` attribute. If the payment details
contain a `"memo"`, the cryptocurrency transaction must include it.
#### Bank account
When the payment must be made to a bank account, the type is
`"bank_account"`.
In most cases the banks involved in sending, transmitting and receiving
the payment will require the IBAN, SWIFT code and the bank account
owner name and address to process the payment. This is reflected by the
information provided in the response:
- `"iban"`: The IBAN to which the payment must be made.
- `"owner"`: An object containing information about the owner of the
bank account. It can contain the following properties: "name",
"address", "address_complement", "zip", "city", "state", "country".
The country is formatted as a two-letter country code.
- `"swift_bic"` The SWIFT code (also known as BIC) of the bank account
at which the bank account is located.
### Amounts
When `timestamp_price_guaranteed` is not present or has elapsed, the
amounts (input, output and price breakdown) are an estimation of the
amounts that would have been used should the order have been executed
at the time the order details were retrieved.
When `timestamp_price_guaranteed` is present and has not elapsed, the
amounts correspond to the amounts that will be used provided that the
exact input amount is received before `timestamp_price_guaranteed`
elapses.
parameters:
- description: ID of the order.
in: path
name: order_uuid
required: true
schema:
type: string
responses:
'200':
description: Order successfully retrieved.
content:
application/json:
schema:
$ref: '#/components/schemas/OrdersGetOrderDetailsResponse'
'400':
description: Order with such ID not found.
'429':
$ref: '#/components/responses/RateLimited'
/orders/{order_uuid}/bank_transfer_qr_bill:
get:
tags:
- Orders
summary: Get the QR-bill of an order where the input is bank_transfer.
operationId: Orders_getQrBill
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
Retrieve a QR-bill that can be used to record a payment for the order in
e-banking systems.
Note that scanning the QR-bill will not ensure that the payment will be
made from the correct bank account. The user still need to choose the
correct bank account with which to pay the order in case the order was
created with information of the input bank account.
parameters:
- description: Identifier of the order for which to retrieve the QR-bill image.
in: path
name: order_uuid
required: true
schema:
type: string
responses:
'200':
description: Image of the QR-bill.
content:
application/pdf: {}
image/*: {}
'404':
description: >-
The specified order does not exist, its input is not bank_transfer
or the order's input currency is not fiat.
/orders/{order_uuid}/cancel:
post:
tags:
- Orders
summary: Cancel an order
operationId: cancel_order
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
Attempt to cancel an order.
If a payment is received after the order has been cancelled, Bity is
free to choose what to do at its own discretion. Bity will generally
attempt to perform a refund to the same crypto-address or IBAN having
performed the payment. Various unpredictable fees may apply. It is very
highly recommended to not cancel orders for which a payment has already
been sent.
This functionality is meant for the customer to cancel orders for which
no payment has been made and will be made. In particular, it is not
meant to cancel orders for which a payment has already been made or
will be made at a later time, and will result in an unpredictable
outcome if used in such situation.
parameters:
- description: Identifier of the order to attempt to cancel
in: path
name: order_uuid
required: true
schema:
type: string
responses:
'202':
description: |
The request to cancel the order is being processed asynchronously.
It is at this time not possible to know whether the cancellation
attempt will be successful or not.
'204':
description: The cancellation attempt was successful.
'400':
description: The cancellation attempt was unsuccessful.
'429':
$ref: '#/components/responses/RateLimited'
/orders/{order_uuid}/duplicate:
post:
tags:
- Orders
summary: Duplicate an order
operationId: duplicate_order
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
This endpoint places a new order with the same amount, same input
object, same ouput object and same payment details as an already
executed one.
It is only possible to duplicate orders of which the full order details
are accessible.
parameters:
- description: ID of the order to duplicate.
in: path
name: order_uuid
required: true
schema:
type: string
responses:
'201':
description: |
The order has been successfully created.
The `Location` header contains the URI (which can be relative) at
which the order status and details can be retrieved. That is, the
`Location` header is meant to be interpreted as per RFC 7231
section 7.1.2.
'400':
description: >-
This operation can return the same errors as the `place_order`
operation (POST /orders).
'429':
$ref: '#/components/responses/RateLimited'
/orders/{order_uuid}/execute:
post:
tags:
- Orders
summary: Execute order
operationId: execute_order
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
This operation is only valid when the order input type is
`bity_account`.
Calling this endpoint indicates that the system can now proceed with
the execution of the order. Compared to other input types, calling
this endpoint is equivalent to paying the order.
parameters:
- description: Identifier of the order to attempt to execute
in: path
name: order_uuid
required: true
schema:
type: string
responses:
'202':
description: The order has been paid, execution is ongoing
'400':
description: Bad request
/orders/{order_uuid}/signature:
post:
tags:
- Orders
summary: Sign proof of wallet ownership message
operationId: Orders_submitSignature
security:
- {}
- bity_account_oauth:
- https://auth.bity.com/scopes/exchange.place
- bity_account_client_oauth:
- https://auth.bity.com/scopes/exchange.place
- client_oauth: []
description: |
Submit the signature of the message provided in the order details.
The body of the request must contain the signature of the message.
The message to sign is located in the `body` property of the
`message_to_sign` object of the order details.
Once the signature is verified to be correct (204 response), the
order becomes executable and the order details will contain the
`payment_details` object which provides the information to use to pay
the order.
Do not build the URL of this endpoint but instead use the value of
`signature_submission_url` included along the message to be signed in
the order details.
parameters:
- description: ID of the order.
in: path
name: order_uuid
required: true
schema:
type: string
requestBody:
content:
'*/*':
examples:
bitcoin:
description: Example Bitcoin signature.
value: >-
INLD1TamPfjszILEL+Q2DanJeldExqZ5YahJxS3FxqBfL9zDt+wtqgTRcB72Bq9H88meKlGl3WoPEplwBcYF52A=
ethereum:
description: Example Ethereum signature.
value: >-
0x7709bc9c45926cc4d9791d868ad6c81883b624db44fbae1e62c0e6cc6c19784b74eb7
schema:
$ref: '#/components/schemas/OrdersSubmitSignatureRequest'
text/plain:
examples:
bitcoin:
description: Example Bitcoin signature.
value: >-
INLD1TamPfjszILEL+Q2DanJeldExqZ5YahJxS3FxqBfL9zDt+wtqgTRcB72Bq9H88meKlGl3WoPEplwBcYF52A=
ethereum:
description: Example Ethereum signature.
value: >-
0x7709bc9c45926cc4d9791d868ad6c81883b624db44fbae1e62c0e6cc6c19784b74eb7
schema:
$ref: '#/components/schemas/OrdersSubmitSignatureRequest1'
responses:
'204':
description: >-
The signature is correct, the order details now contain
`payment_details`.
'400':
description: The signature is invalid.
'404':
description: >-
The associated order could not be found or there is no message to
sign.
'429':
$ref: '#/components/responses/RateLimited'
'502':
description: Internal error.
'503':
description: Internal error.
'504':
description: Internal error.
/pairs:
summary: Get and filter currency pairs
description: Available currency pairs are those exclusively supported by Bity.
get:
tags:
- Currencies
summary: List currency pairs
operationId: Currencies_getList
security:
- {}
description: >-
Gets a list of all the currency pairs that can be traded through the
Bity platform.
parameters:
- description: >-
Retrieve all pairs for given input currency code. This parameter can
be repeated several times to match many input currencies.
in: query
name: input
required: false
schema:
type: string
- description: >-