-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcoinbase_rest_openapi.yaml
867 lines (848 loc) · 34.2 KB
/
coinbase_rest_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
openapi: 3.0.1
info:
title: Coinbase API
description: The Coinbase v2 API (converted from Swagger to OpenAPI by kanekoshoyu)
contact:
name: CoinFabrik
url: http://www.coinfabrik.com/
version: 2.0.0
servers:
- url: https://api.coinbase.com/v2
security:
- coinbaseAccessCode: []
paths:
/users/{user_id}:
get:
tags:
- Users
summary: Show a user
description: Get any user’s public information with their ID.
parameters:
- name: user_id
in: path
description: The user id
required: true
schema:
type: string
responses:
"200":
description: The requested user
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/User"
security:
- coinbaseAccessCode: []
/user:
get:
tags:
- Users
summary: Show current user
description: >-
Get current user’s public information. To get user’s email or private
information, use permissions wallet:user:email and wallet:user:read.
responses:
"200":
description: The requested user
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/User"
security:
- coinbaseAccessCode: []
put:
tags:
- Users
summary: Update current user
description: Modify current user and their preferences.
requestBody:
description: Properties to update
content:
"*/*":
schema:
type: object
properties:
name:
type: string
time_zone:
type: string
native_currency:
type: string
required: false
responses:
"200":
description: The updated user
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/User"
security:
- coinbaseAccessCode:
- wallet:user:update
x-codegen-request-body-name: body
/user/auth:
get:
tags:
- Users
summary: Show authorization information
description: >-
Get current user’s authorization information including granted scopes
and send limits when using OAuth2 authentication.
responses:
"200":
description: The requested user
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
method:
type: string
scopes:
type: array
items:
type: string
oauth_meta:
type: object
properties: {}
security:
- coinbaseAccessCode: []
/accounts:
get:
tags:
- Accounts
summary: List accounts
description: >-
Lists current user’s accounts to which the authentication method has
access to.
responses:
"200":
description: The accounts
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: "#/components/schemas/Pagination"
data:
type: array
items:
$ref: "#/components/schemas/Account"
security:
- coinbaseAccessCode:
- wallet:accounts:read
post:
tags:
- Accounts
summary: Create account
description: Creates a new account for user.
requestBody:
description: Account properties
content:
"*/*":
schema:
type: object
properties:
name:
type: string
description: The account name
required: false
responses:
"201":
description: The created account
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Account"
security:
- coinbaseAccessCode:
- wallet:accounts:create
x-codegen-request-body-name: account_properties
/accounts/{account_id}:
get:
tags:
- Accounts
summary: Show an account
description: >-
Show current user’s account. To access user’s primary account, primary
keyword can be used instead of the account id in the URL.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"200":
description: The account
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Account"
security:
- coinbaseAccessCode:
- wallet:accounts:read
put:
tags:
- Accounts
summary: Update account
description: Modifies user’s account name.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
requestBody:
description: Properties to update
content:
"*/*":
schema:
type: object
properties:
name:
type: string
description: New account name
required: false
responses:
"200":
description: The account
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Account"
security:
- coinbaseAccessCode:
- wallet:accounts:update
x-codegen-request-body-name: account_properties
delete:
tags:
- Accounts
summary: Delete account
description: |
Removes user’s account. In order to remove an account it can’t be
- Primary account
- Account with non-zero balance
- Fiat account
- Vault with a pending withdrawal
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"204":
description: No content
content: {}
security:
- coinbaseAccessCode:
- wallet:accounts:delete
/accounts/{account_id}/primary:
get:
tags:
- Accounts
summary: Set account as primary
description: Promote an account as primary account.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"200":
description: The account in question
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Account"
security:
- coinbaseAccessCode:
- wallet:accounts:update
/accounts/{account_id}/addresses:
get:
tags:
- Addresses
summary: List addresses
description: |
Lists addresses for an account.
*Important*: Addresses should be considered one time use only.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"200":
description: The addresses
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: "#/components/schemas/Pagination"
data:
type: array
items:
$ref: "#/components/schemas/Address"
security:
- coinbaseAccessCode:
- wallet:addresses:read
post:
tags:
- Addresses
summary: Create address
description: >
Creates a new address for an account. As all the arguments are optinal,
it’s possible just to do a empty POST which will create a new address.
This is handy if you need to create new receive addresses for an account
on-demand.
Addresses can be created for all account types. With fiat accounts,
funds will be received with Instant Exchange.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
requestBody:
description: Properties to update
content:
"*/*":
schema:
type: object
properties:
name:
type: string
description: Address label
required: false
responses:
"201":
description: The created address
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Address"
security:
- coinbaseAccessCode:
- wallet:addresses:create
x-codegen-request-body-name: address_properties
/accounts/{account_id}/addresses/{address_id}:
get:
tags:
- Addresses
summary: Show an address
description: >
Show an individual address for an account.
Regular bitcoin address can be used in place of address_id but the
address has to be associated to the correct account.
*Important* Addresses should be considered one time use only.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
- name: address_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"200":
description: The address
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Address"
security:
- coinbaseAccessCode:
- wallet:addresses:read
/accounts/{account_id}/addresses/{address_id}/transactions:
get:
tags:
- Addresses
summary: List address’s transactions
description: >
list transactions that have been sent to a specific address. Regular
bitcoin address can be used in place of address_id but the address has
to be associated to the correct account.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
- name: address_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"200":
description: The transactions
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: "#/components/schemas/Pagination"
data:
type: array
items:
$ref: "#/components/schemas/Transaction"
security:
- coinbaseAccessCode:
- wallet:transactions:read
/accounts/{account_id}/transactions:
get:
tags:
- Transactions
summary: List transactions
description: >-
Lists account’s transactions. See Transaction resource for more
information.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
responses:
"200":
description: The transactions
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: "#/components/schemas/Pagination"
data:
type: array
items:
$ref: "#/components/schemas/Transaction"
security:
- coinbaseAccessCode:
- wallet:transactions:read
post:
tags:
- Transactions
summary: Send or request money
description: >
Type=send
=========
Send funds to a bitcoin address or email address. No transaction fees
are required for off blockchain transactions, and Coinbase waives fees
for on-blockchain transactions greater than 0.0001 BTC, up to a
threshold of 25 per day. Read more about free transactions.
When used with OAuth2 authentication, this endpoint requires two factor
authentication unless used with wallet:transactions:send:bypass-2fa
scope.
If the user is able to buy bitcoin, they can send funds from their fiat
account using instant exchange feature. Buy fees will be included in the
created transaction and the recipient will receive the user defined
amount.
To create a multisig transaction, visit Multisig documentation.
Type=request
============
Requests money from an email address.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
requestBody:
content:
"*/*":
schema:
type: object
properties:
type:
type: string
description: >-
Type should be "send" for sending money, or "request" for
requesting money.
to:
type: string
description: >-
A bitcoin address (send only) or an email of the recipient
(send or request)
amount:
type: string
description: Amount to be sent/requested.
currency:
type: string
description: Currency for the amount
description:
type: string
description: >-
Notes to be included in the email that the recipient
receives
skip_notifications:
type: boolean
description: >-
(Send only) Don’t send notification emails for small amounts
(e.g. tips)
fee:
type: string
description: >-
(Send only) Transaction fee in BTC if you would like to pay
it. Coinbase pays transaction fees on payments greater than
or equal to 0.0001 BTC. But for smaller amounts you may want
to add your own amount. Fees can be added as a string, such
as 0.0005
idem:
type: string
description: >-
(Send only) A token to ensure idempotence. If a previous
transaction with the same idem parameter already exists for
this sender, that previous transaction will be returned and
a new one will not be created. Max length 100 characters
required: true
responses:
"201":
description: The pending transaction
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Transaction"
security:
- coinbaseAccessCode:
- wallet:transactions:send
- wallet:transactions:request
x-codegen-request-body-name: transaction_options
/accounts/{account_id}/transactions/{transaction_id}:
get:
tags:
- Transactions
summary: Show a transaction
description: >-
Show an individual transaction for an account. See Transaction resource
for more information.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
- name: transaction_id
in: path
description: The transaction id
required: true
schema:
type: string
responses:
"200":
description: The requested transaction
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Transaction"
security:
- coinbaseAccessCode:
- wallet:transactions:read
delete:
tags:
- Transactions
summary: Cancel request money
description: >-
Lets a user cancel a money request. Money requests can be canceled by
the sender or the recipient.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
- name: transaction_id
in: path
description: The transaction id
required: true
schema:
type: string
responses:
"204":
description: Success response (no content)
content: {}
security:
- coinbaseAccessCode:
- wallet:transactions:request
/accounts/{account_id}/transactions/{transaction_id}/complete:
post:
tags:
- Transactions
summary: Complete request money
description: >-
Lets the recipient of a money request complete the request by sending
money to the user who requested the money. This can only be completed by
the user to whom the request was made, not the user who sent the
request.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
- name: transaction_id
in: path
description: The transaction id
required: true
schema:
type: string
responses:
"200":
description: Success response (no content)
content: {}
security:
- coinbaseAccessCode:
- wallet:transactions:request
/accounts/{account_id}/transactions/{transaction_id}/resend:
post:
tags:
- Transactions
summary: Re-send request money
description: >-
Lets the user resend a money request. This will notify recipient with a
new email.
parameters:
- name: account_id
in: path
description: The account id
required: true
schema:
type: string
- name: transaction_id
in: path
description: The transaction id
required: true
schema:
type: string
responses:
"200":
description: Success response (no content)
content: {}
security:
- coinbaseAccessCode:
- wallet:transactions:request
components:
schemas:
User:
required:
- avatar_url
- id
- resource
- resource_path
type: object
properties:
id:
type: string
description: Resource ID
avatar_url:
type: string
description: User’s avatar url
resource:
type: string
resource_path:
type: string
Pagination:
type: object
MoneyHash:
type: object
properties:
amount:
type: string
currency:
type: string
Account:
type: object
properties:
id:
type: string
description: Resource ID
name:
type: string
description: User or system defined name
primary:
type: boolean
description: Indicates if this is a primary account
type:
type: string
description: >-
Account’s type. Available values: wallet, fiat, multisig, vault,
multisig_vault
currency:
type: string
description: Account's currency
balance:
$ref: "#/components/schemas/MoneyHash"
native_balance:
$ref: "#/components/schemas/MoneyHash"
created_at:
type: string
description: Timestamp indicating when was the account created.
updated_at:
type: string
description: Timestamp indicating when was the account last updated.
resource:
type: string
description: This value is always 'account'.
resource_path:
type: string
Address:
type: object
properties:
id:
type: string
description: Resource ID
address:
type: string
description: Bitcoin address
created_at:
type: string
description: Timestamp indicating when was the address was created.
updated_at:
type: string
description: Timestamp indicating when was the address last updated.
resource:
type: string
description: This value is always 'address'.
resource_path:
type: string
Transaction:
type: object
properties:
id:
type: string
description: Resource ID
type:
type: string
description: Transaction type
status:
type: string
description: Status
amount:
$ref: "#/components/schemas/MoneyHash"
native_amount:
$ref: "#/components/schemas/MoneyHash"
instant_exchange:
type: boolean
description: >-
Indicator if the transaction was instant exchanged (received into a
bitcoin address for a fiat account)
created_at:
type: string
description: Timestamp indicating when was the address was created.
updated_at:
type: string
description: Timestamp indicating when was the address last updated.
resource:
type: string
description: This value is always 'address'.
resource_path:
type: string
details:
type: object
properties: {}
description: Detailed information about the transaction
securitySchemes:
coinbaseAccessCode:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://www.coinbase.com/oauth/authorize
tokenUrl: http://www.coinbase.com/oauth/token
scopes:
wallet:accounts:read: List user’s accounts and their balances
wallet:accounts:update: Update account (e.g. change name)
wallet:accounts:create: Create a new account (e.g. BTC wallet)
wallet:accounts:delete: Delete existing account
wallet:addresses:read: List account’s bitcoin addresses
wallet:addresses:create: Create new bitcoin addresses for wallets
wallet:buys:read: List account’s buys
wallet:buys:create: Buy bitcoin
wallet:checkouts:read: List user’s merchant checkouts
wallet:checkouts:create: Create a new merchant checkout
wallet:deposits:read: List account’s deposits
wallet:deposits:create: Create a new deposit
wallet:notifications:read: List user’s notifications
wallet:orders:read: List user’s merchant order
wallet:orders:create: Create a new merchant order
wallet:orders:refund: Refund a merchant order
wallet:payment-methods:read: List user’s payment methods (e.g. bank accounts)
wallet:payment-methods:delete: Remove existing payment methods
wallet:payment-methods:limits: >-
Get detailed limits for payment methods (useful for performing
buys and sells). This permission is to be used together with
wallet:payment-methods:read
wallet:sells:read: List account’s sells
wallet:sells:create: Sell bitcoin
wallet:transactions:read: List account’s transactions
wallet:transactions:send: Send bitcoin
wallet:transactions:request: Request bitcoin from a Coinbase user
wallet:transactions:transfer: Transfer funds between user’s two bitcoin accounts
wallet:user:read: >-
List detailed user information (public information is available
without this permission)
wallet:user:update: Update current user
wallet:user:email: Read current user’s email address
wallet:withdrawals:read: List account’s withdrawals
wallet:withdrawals:create: Create a new withdrawal
x-original-swagger-version: "2.0"