-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
11688 lines (11581 loc) · 372 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.0
info:
title: BTCPay Greenfield API
description: >+
# Introduction
The BTCPay Server Greenfield API is a REST API. Our API has predictable
resource-oriented URLs, accepts form-encoded request bodies, returns
JSON-encoded responses, and uses standard HTTP response codes,
authentication, and verbs.
# Authentication
You can authenticate either via Basic Auth or an API key. It's recommended
to use an API key for better security. You can create an API key in the
BTCPay Server UI under `Account` -> `Manage Account` -> `API keys`. You can
restrict the API key for one or multiple stores and for specific
permissions. For testing purposes, you can give it the 'Unrestricted access'
permission. On production you should limit the permissions to the actual
endpoints you use, you can see the required permission on the API docs at
the top of each endpoint under `AUTHORIZATIONS`.
If you want to simplify the process of creating API keys for your users, you
can use the [Authorization
endpoint](https://docs.btcpayserver.org/API/Greenfield/v1/#tag/Authorization)
to predefine permissions and redirect your users to the BTCPay Server
Authorization UI. You can find more information about this on the [API
Authorization Flow
docs](https://docs.btcpayserver.org/BTCPayServer/greenfield-authorization/)
page.
# Usage examples
Use **Basic Auth** to read store information with cURL:
```bash
BTCPAY_INSTANCE="https://mainnet.demo.btcpayserver.org"
USER="MyTestUser@gmail.com"
PASSWORD="notverysecurepassword"
PERMISSION="btcpay.store.canmodifystoresettings"
BODY="$(echo "{}" | jq --arg "a" "$PERMISSION" '. + {permissions:[$a]}')"
API_KEY="$(curl -s \
-H "Content-Type: application/json" \
--user "$USER:$PASSWORD" \
-X POST \
-d "$BODY" \
"$BTCPAY_INSTANCE/api/v1/api-keys" | jq -r .apiKey)"
```
Use an **API key** to read store information with cURL:
```bash
STORE_ID="yourStoreId"
curl -s \
-H "Content-Type: application/json" \
-H "Authorization: token $API_KEY" \
-X GET \
"$BTCPAY_INSTANCE/api/v1/stores/$STORE_ID"
```
You can find more examples on our docs for different programming languages:
- [cURL](https://docs.btcpayserver.org/Development/GreenFieldExample/)
-
[Javascript/Node.Js](https://docs.btcpayserver.org/Development/GreenFieldExample-NodeJS/)
- [PHP](https://docs.btcpayserver.org/Development/GreenFieldExample-PHP/)
version: v1
contact:
name: BTCPay Server
url: https://btcpayserver.org
license:
name: MIT
url: https://github.com/btcpayserver/btcpayserver/blob/master/LICENSE
x-api-status-urls: false
x-konfig-ignore:
potential-incorrect-type: true
servers:
- description: BTCPay Server Greenfield API
url: ''
tags:
- description: Store Wallet (On Chain) operations
name: Store Wallet (On Chain)
- description: Custodian operations
name: Custodians
- description: Lightning (Internal Node) operations
name: Lightning (Internal Node)
- description: Lightning (Store) operations
name: Lightning (Store)
- description: Invoice operations
name: Invoices
- description: App operations
name: Apps
- description: Stores (Payout Processors) operations
name: Stores (Payout Processors)
- description: Webhook operations
name: Webhooks
- description: User operations
name: Users
- description: Store Payment Methods (On Chain) operations
name: Store Payment Methods (On Chain)
- name: Stores (Payouts)
- description: API Key operations
name: API Keys
- description: Payment Requests operations
name: Payment Requests
- description: Pull payments (Public) operations
name: Pull payments (Public)
- description: Store operations
name: Stores
- description: Miscelleneous operations
name: Miscelleneous
- description: Notifications operations
name: Notifications (Current User)
- description: Store Payment Methods (LNURL Pay) operations
name: Store Payment Methods (LNURL Pay)
- description: Store Payment Methods (Lightning Network) operations
name: Store Payment Methods (Lightning Network)
- name: Lightning address
- description: Pull payments (Management) operations
name: Pull payments (Management)
- description: Store Emails operations
name: Stores (Email)
- description: Store Rates Config operations
name: Stores (Rates Config)
- description: Store Users operations
name: Stores (Users)
- description: Server Info operations
name: ServerInfo
- name: Crowdfund
- description: Authorization operations
name: Authorization
- description: Health operations
name: Health
- description: Payout Processors operations
name: Payout Processors
- description: Pull payments payout (Public) operations
name: Pull payments payout (Public)
- description: Store Payment Methods operations
name: Store Payment Methods
- description: Store Rates operations
name: Stores (Rates)
- name: Point of Sale
paths:
/api/v1/api-keys/{apikey}:
delete:
tags:
- API Keys
summary: Revoke an API Key
operationId: ApiKeys_DeleteApiKey
security:
- API_Key:
- unrestricted
Basic: []
description: Revoke the current API key so that it cannot be used anymore
parameters:
- description: The API Key to revoke
name: apikey
in: path
required: true
schema:
type: string
responses:
'200':
description: The key has been deleted
'404':
description: The key is not found for this user
/api/v1/users/{idOrEmail}/api-keys/{apikey}:
delete:
tags:
- API Keys
summary: Revoke an API Key of target user
operationId: ApiKeys_DeleteUserApiKey
security:
- API_Key:
- unrestricted
Basic: []
description: Revoke the API key of a target user so that it cannot be used anymore
parameters:
- description: The API Key to revoke
name: apikey
in: path
required: true
schema:
type: string
- description: The target user's id or email
name: idOrEmail
in: path
required: true
schema:
type: string
responses:
'200':
description: The key has been deleted
'404':
description: The key is not found for this user
/api/v1/api-keys/current:
get:
tags:
- API Keys
summary: Get the current API Key information
operationId: ApiKeys_GetCurrentApiKey
security:
- API_Key:
- btcpay.server.canmanageusers
Basic: []
description: View information about the current API key
responses:
'200':
description: Information about the current api key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyData'
'401':
description: Missing authorization
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
delete:
tags:
- API Keys
summary: Revoke the current API Key
operationId: ApiKeys_DeleteCurrentApiKey
security:
- API_Key: []
description: Revoke the current API key so that it cannot be used anymore
responses:
'200':
description: The key was revoked and is no longer usable
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyData'
'401':
description: Missing authorization
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/api/v1/api-keys:
post:
tags:
- API Keys
summary: Create a new API Key
operationId: ApiKeys_CreateApiKey
security:
- API_Key:
- unrestricted
Basic: []
description: Create a new API Key
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeysCreateApiKeyRequest'
responses:
'200':
description: Information about the new api key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyData'
'401':
description: Missing authorization
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
default:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/api/v1/users/{idOrEmail}/api-keys:
post:
tags:
- API Keys
summary: Create a new API Key for a user
operationId: ApiKeys_CreateUserApiKey
security:
- API_Key:
- btcpay.server.canmanageusers
Basic: []
description: Create a new API Key for a user
parameters:
- description: The target user's id or email
name: idOrEmail
in: path
required: true
schema:
type: string
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeysCreateUserApiKeyRequest'
responses:
'200':
description: Information about the new api key
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyData'
'401':
description: Missing authorization
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
default:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/api/v1/stores/{storeId}/apps/pos:
parameters:
- description: The store ID
name: storeId
in: path
required: true
schema:
type: string
post:
tags:
- Apps
summary: Create a new Point of Sale app
operationId: Apps_CreatePointOfSaleApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Point of Sale app allows accepting payments for items in a virtual store
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePointOfSaleAppRequest'
required: true
x-position: 1
responses:
'200':
description: Created app details
content:
application/json:
schema:
$ref: '#/components/schemas/PointOfSaleAppData'
'422':
description: Unable to validate the request
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationProblemDetails'
/api/v1/apps/pos/{appId}:
parameters:
- description: App ID
name: appId
in: path
required: true
schema:
type: string
put:
tags:
- Apps
summary: Update a Point of Sale app
operationId: Apps_PutPointOfSaleApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Use this endpoint for updating the properties of a POS app
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePointOfSaleAppRequest'
required: true
x-position: 1
responses:
'200':
description: App details
content:
application/json:
schema:
$ref: '#/components/schemas/PointOfSaleAppData'
'422':
description: Unable to validate the request
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationProblemDetails'
get:
tags:
- Apps
- Point of Sale
summary: Get Point of Sale app data
operationId: Apps_GetPointOfSaleApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Returns POS app data
responses:
'200':
description: POS app data
content:
application/json:
schema:
$ref: '#/components/schemas/PointOfSaleAppData'
'404':
description: POS app with specified ID was not found
/api/v1/apps/crowdfund/{appId}:
parameters:
- description: Crowdfund app ID
name: appId
in: path
required: true
schema:
type: string
get:
tags:
- Apps
- Crowdfund
summary: Get crowdfund app data
operationId: Apps_GetCrowdfundApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Returns crowdfund app data
responses:
'200':
description: Crowdfund app data
content:
application/json:
schema:
$ref: '#/components/schemas/CrowdfundAppData'
'404':
description: Crowdfund app with specified ID was not found
/api/v1/stores/{storeId}/apps/crowdfund:
parameters:
- description: The store ID
name: storeId
in: path
required: true
schema:
type: string
post:
tags:
- Apps
- Crowdfund
summary: Create a new Crowdfund app
operationId: Apps_CreateCrowdfundApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCrowdfundAppRequest'
required: true
x-position: 1
responses:
'200':
description: Created app details
content:
application/json:
schema:
$ref: '#/components/schemas/CrowdfundAppData'
'422':
description: Unable to validate the request
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationProblemDetails'
/api/v1/apps/{appId}:
get:
tags:
- Apps
summary: Get basic app data
operationId: Apps_GetApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Returns basic app data shared between all types of apps
parameters:
- description: The app ID
name: appId
in: path
required: true
schema:
type: string
responses:
'200':
description: Basic app data
content:
application/json:
schema:
$ref: '#/components/schemas/BasicAppData'
'404':
description: App with specified ID was not found
delete:
tags:
- Apps
summary: Delete app
operationId: Apps_DeleteApp
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Deletes apps with specified ID
parameters:
- description: The app ID
name: appId
in: path
required: true
schema:
type: string
responses:
'200':
description: App was deleted
'404':
description: App with specified ID was not found
/api/v1/stores/{storeId}/apps:
parameters:
- description: The store ID
name: storeId
in: path
required: true
schema:
type: string
get:
tags:
- Apps
summary: Get basic app data for all apps for a store
operationId: Apps_GetAllAppsForStore
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Returns basic app data for all apps for a store
responses:
'200':
description: Array of basic app data object
content:
application/json:
schema:
$ref: '#/components/schemas/AppsGetAllAppsForStoreResponse'
/api/v1/apps:
get:
tags:
- Apps
summary: Get basic app data for all apps for all stores for a user
operationId: Apps_GetAllApps
security:
- API_Key:
- btcpay.store.canmodifystoresettings
Basic: []
description: Returns basic app data for all apps for all stores
responses:
'200':
description: Array of basic app data object
content:
application/json:
schema:
$ref: '#/components/schemas/AppsGetAllAppsResponse'
/api-keys/authorize:
get:
tags:
- Authorization
summary: Authorize User
operationId: ApiKeys_Authorize
security: []
description: >-
Redirect the browser to this endpoint to request the user to generate an
api-key with specific permissions
parameters:
- description: The permissions to request. (See API Key authentication)
name: permissions
in: query
style: form
explode: true
schema:
type: array
nullable: true
items:
type: string
x-position: 1
- description: >-
If permissions are specified, and strict is set to false, it will
allow the user to reject some of permissions the application is
requesting.
name: strict
in: query
schema:
type: boolean
default: true
nullable: true
x-position: 3
- description: >-
If specified, BTCPay Server will check if there is an existing API
key associated with the user that also has this application
identifier, redirect host AND the permissions required match(takes
selectiveStores and strict into account). `applicationIdentifier` is
ignored if redirect is not specified.
name: applicationIdentifier
in: query
schema:
type: string
nullable: true
x-position: 6
- description: >-
If the application is requesting the CanModifyStoreSettings
permission and selectiveStores is set to true, this allows the user
to only grant permissions to selected stores under the user's
control.
name: selectiveStores
in: query
schema:
type: boolean
default: false
nullable: true
x-position: 4
- description: The name of your application
name: applicationName
in: query
schema:
type: string
nullable: true
x-position: 2
- description: >-
The url to redirect to after the user consents, with the query
parameters appended to it: permissions, user-id, api-key. If not
specified, user is redirected to their API Key list.
name: redirect
in: query
schema:
type: string
format: url
nullable: true
x-position: 5
responses:
'200':
description: A HTML form that a user can use to confirm permissions to grant
content:
text/html: {}
'307':
description: >-
Makes browser do an HTTP POST request to the specified url in
`redirect` with a JSON body consisting of `apiKey` (the api key
created or matched), `permissions` (the permissions the user
consented to), and `userId` (the id of the user that consented) upon
consent
'401':
description: Missing authorization
content:
text/html: {}
/api/v1/custodians:
get:
tags:
- Custodians
summary: List supported custodians
operationId: Custodians_GetSupportedCustodians
description: >-
List all supported custodians for the BTCPay instance. You can install
plugins to add more custodians.
responses:
'200':
description: List of supported custodians
content:
application/json:
schema:
$ref: '#/components/schemas/CustodiansGetSupportedCustodiansResponse'
/api/v1/stores/{storeId}/custodian-accounts:
get:
tags:
- Custodians
summary: List store custodian accounts
operationId: Custodians_GetStoreCustodianAccounts
parameters:
- description: >-
Enable if you want the result to include the 'assetBalances' field.
This will make the call slower or could cause the call to fail if
the asset balances cannot be loaded (i.e. due to a bad API key).
name: assetBalances
in: query
required: false
schema:
type: boolean
default: false
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
responses:
'200':
description: List of custodian accounts for the store.
content:
application/json:
schema:
$ref: >-
#/components/schemas/CustodiansGetStoreCustodianAccountsResponse
'403':
description: >-
If you are authenticated but forbidden to view the store's custodian
accounts
post:
tags:
- Custodians
summary: Add a custodial account to a store.
operationId: Custodians_AddStoreCustodianAccount
security:
- API_Key:
- btcpay.store.canmanagecustodianaccounts
Basic: []
description: Add a custodial account to a store.
parameters:
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCustodianAccountRequest'
required: true
x-position: 1
responses:
'200':
description: Information about the new custodian account
content:
application/json:
schema:
$ref: '#/components/schemas/CustodianAccountData'
'403':
description: If you are authenticated but forbidden to add new custodian account
/api/v1/stores/{storeId}/custodian-accounts/{accountId}:
get:
tags:
- Custodians
summary: Get store custodian account
operationId: Custodians_GetStoreCustodianAccount
parameters:
- description: >-
Enable if you want the result to include the 'assetBalances' field.
This will make the call slower or could cause the call to fail if
the asset balances cannot be loaded (i.e. due to a bad API key).
name: assetBalances
in: query
required: false
schema:
type: boolean
default: false
- description: The Custodian Account ID
name: accountId
in: path
required: true
schema:
type: string
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
responses:
'200':
description: List of custodian accounts for the store.
content:
application/json:
schema:
$ref: '#/components/schemas/CustodianAccountData'
'403':
description: If you are authenticated but forbidden to view the custodian account
put:
tags:
- Custodians
summary: Update custodial account
operationId: Custodians_UpdateStoreCustodianAccount
security:
- API_Key:
- btcpay.store.canmanagecustodianaccounts
Basic: []
description: Update custodial account
parameters:
- description: The Custodian Account ID
name: accountId
in: path
required: true
schema:
type: string
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCustodianAccountRequest'
required: true
x-position: 1
responses:
'200':
description: The updated custodian account
content:
application/json:
schema:
$ref: '#/components/schemas/CustodianAccountData'
'403':
description: >-
If you are authenticated but forbidden to modify new custodian
account
delete:
tags:
- Custodians
summary: Delete store custodian account
operationId: Custodians_DeleteStoreCustodianAccount
description: Deletes a custodial account
parameters:
- description: The Custodian Account ID
name: accountId
in: path
required: true
schema:
type: string
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
responses:
'200':
description: Custodian account deleted
'403':
description: >-
If you are authenticated but forbidden to delete the custodian
account
/api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/quote:
get:
tags:
- Custodians
summary: Get quote for trading one asset for another
operationId: Custodians_GetStoreCustodianAccountTradeQuote
security:
- API_Key:
- btcpay.store.canviewcustodianaccounts
Basic: []
description: Get the current bid and ask price for converting one asset into another.
parameters:
- description: The Custodian Account ID.
name: accountId
in: path
required: true
schema:
type: string
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
- description: The asset to convert.
name: fromAsset
in: query
required: true
schema:
type: string
- description: The asset you want.
name: toAsset
in: query
required: true
schema:
type: string
responses:
'200':
description: The quote for converting one asset to another.
content:
application/json:
schema:
$ref: '#/components/schemas/QuoteResultData'
'403':
description: If you are authenticated but forbidden to create trades
'404':
description: No tradable asset pair found for this trade.
/api/v1/stores/{storeId}/custodian-accounts/{accountId}/trades/market:
post:
tags:
- Custodians
summary: Trade one asset for another
operationId: Custodians_StoreCustodianAccountTradeMarket
security:
- API_Key:
- btcpay.store.cantradecustodianaccounts
Basic: []
description: >-
Trade one asset for another using a market order (=instant purchase with
instant result or failure). A suitable asset pair will automatically be
selected. If no asset pair is available, the call will fail.
parameters:
- description: The Custodian Account ID.
name: accountId
in: path
required: true
schema:
type: string
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
requestBody:
x-name: request
content:
application/json:
schema:
$ref: '#/components/schemas/TradeRequestData'
responses:
'200':
description: Information about the trade that was executed
content:
application/json:
schema:
$ref: '#/components/schemas/TradeResultData'
'403':
description: If you are authenticated but forbidden to create trades
'404':
description: No tradable asset pair found for this trade.
/api/v1/stores/{storeId}/custodian-accounts/{accountId}/addresses/{paymentMethod}:
get:
tags:
- Custodians
summary: Get a deposit address for custodian
operationId: Custodians_GetStoreCustodianAccountDepositAddress
security:
- API_Key:
- btcpay.store.candeposittocustodianaccounts
Basic: []
description: >-
Get a new deposit address for the custodian using the specified payment
method (network + crypto code).
parameters:
- description: The Custodian Account ID.
name: accountId
in: path
required: true
schema:
type: string
- description: The Store ID
name: storeId
in: path
required: true
schema:
type: string
- description: >-
The payment method to use for the deposit. Example: "BTC-OnChain" or
"BTC-Lightning"