forked from interledger/open-payments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-api-spec.yaml
1378 lines (1356 loc) · 55 KB
/
open-api-spec.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.1.0
info:
title: Open Payments
version: '1.0'
license:
name: Apache 2.0
identifier: Apache-2.0
description: |-
The Open Payments API is a simple REST API with 5 resource types: **account**, **quote**, **connection**, **incoming payment** and **outgoing payment**.
The *service endpoint* for the API is always the URL of the account resource and all other resources (except connections) are sub-resources of the account.
An incoming payment defines meta data that is automatically attached to payments made into the account under that incoming payment. This facilitates automation of processes like reconciliation of payment into the account with external systems.
An outgoing payment is an instruction to make a payment out of the account.
A quote is a commitment from the account provider to deliver a particular amount to a receiver when sending a particular amount from the account. It is only valid for a limited time.
For privacy reasons a connection resource is not a sub-resource of an account.
All resource and collection resource representations use JSON and the media-type `application/json`.
The `account` resource has three collections of sub-resources and a single **account holder** sub-resource:
1. `/incoming-payments` contains the **incoming payment** sub-resources
2. `/outgoing-payments` contains the **outgoing payment** sub-resources
3. `/quotes` contains the **quote** sub-resources
There is no normative path for **connection** resources. In this documentation we use the path `/connections` but implementations may use any arbitrary path.
Access to resources and permission to execute the methods exposed by the API is determined by the grants given to the client represented by an access token used in API requests.
summary: An API for open access to financial accounts to send and receive payments.
contact:
email: tech@interledger.org
servers:
- url: 'https://openpayments.guide'
tags:
- name: account
description: account operations
- name: incoming-payment
description: incoming payment operations
- name: outgoing-payment
description: outgoing payment operations
- name: quote
description: quote operations
- name: stream-connection
description: interledger STREAM connections
paths:
'/{accountId}':
get:
summary: Get a Payment Pointer
tags:
- account
responses:
'200':
description: Account Found
content:
application/json:
schema:
$ref: '#/components/schemas/account'
examples:
Get account for $openpayments.guide/alice:
value:
id: 'https://openpayments.guide/alice'
publicName: Alice
assetCode: USD
assetScale: 2
authServer: 'https://openpayments.guide/auth'
'404':
description: Account Not Found
operationId: get-public-account
description: |-
Retrieve the public information of the account represented by the Payment Pointer.
This end-point should be open to anonymous requests as it allows clients to verify a Payment Pointer URL and get the basic information required to construct new transactions and discover the grant request URL.
The content should be slow changing and cacheable for long periods. Servers SHOULD use cache control headers.
security: []
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
'/connections/{connectionId}':
get:
summary: Get ILP STREAM credentials for a connection
tags:
- stream-connection
responses:
'200':
description: Connection Found
content:
application/json:
schema:
$ref: '#/components/schemas/ilp-stream-connection'
examples:
Get connection:
value:
id: 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8'
ilpAddress: g.ilp.iwuyge987y.98y0f34tsrt8y
sharedSecret: 6jR5iNIVRvqeasJeCty6C+YB5X9FhSOUPCL/5nha5Vs=
'404':
description: Connection Not Found
operationId: get-ilp-stream-connection
description: |-
Fetch new connection credentials for an ILP STREAM connection.
A connection is an ephemeral resource that is created to accommodate new incoming payments.
A new set of credential will be generated each time this API is called.
security: []
parameters:
- schema:
type: string
name: connectionId
in: path
required: true
description: Connection identifier
'/{accountId}/incoming-payments':
post:
summary: Create an Incoming Payment
tags:
- incoming-payment
operationId: create-incoming-payment
responses:
'201':
description: Incoming Payment Created
content:
application/json:
schema:
$ref: '#/components/schemas/incoming-payment'
examples:
New Incoming Payment for $25:
value:
id: 'http://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c'
accountId: 'http://openpayments.guide/alice/'
incomingAmount:
value: '2500'
assetCode: USD
assetScale: 2
receivedAmount:
value: '0'
assetCode: USD
assetScale: 2
completed: false
expiresAt: '2022-02-03T23:20:50.52Z'
externalRef: INV2022-02-0137
ilpStreamConnection:
id: 'http://openpayments.guide/connections/ff394f02-7b7b-45e2-b645-51d04e7c345c'
ilpAddress: g.ilp.iwuyge987y.98y08y
sharedSecret: 6jR5iNIVRvqeasJeCty6C+YB5X9FhSOUPCL/5nha5Vs=
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
requestBody:
content:
application/json:
schema:
type: object
properties:
incomingAmount:
description: The maximum amount that should be paid into the account under this incoming payment.
allOf:
- $ref: '#/components/schemas/amount'
expiresAt:
type: string
description: The date and time when payments into the incoming payment must no longer be accepted.
format: date-time
writeOnly: true
description:
type: string
description: Human readable description of the incoming payment that will be visible to the account holder.
externalRef:
type: string
description: A reference that can be used by external systems to reconcile this payment with their systems. E.g. An invoice number. (Optional)
additionalProperties: false
examples:
Create incoming payment for $25 to pay invoice INV2022-02-0137:
value:
incomingAmount:
value: '2500'
assetCode: USD
assetScale: 2
externalRef: INV2022-02-0137
description: |-
A subset of the incoming payments schema is accepted as input to create a new incoming payment.
The `incomingAmount` must use the same `assetCode` and `assetScale` as the account.
required: true
description: |-
A client MUST create an **incoming payment** resource before it is possible to send any payments to the account.
All of the input parameters are _optional_.
get:
summary: List Incoming Payments
operationId: list-incoming-payments
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: '#/components/schemas/page-info'
result:
type: array
items:
$ref: '#/components/schemas/incoming-payment'
examples:
forward pagination:
value:
pagination:
startCursor: 241de237-f989-42be-926d-c0c1fca57708
endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414
hasPreviousPage: false
hasNextPage: true
result:
- id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8'
accountId: 'https://openpayments.guide/alice/'
incomingAmount:
value: '250'
assetCode: USD
assetScale: 2
receivedAmount:
value: '250'
assetCode: USD
assetScale: 2
ilpStreamConnection: 'https://openpayments.guide/connections/376df9d5-c9a4-4c80-a354-86b915a04ff8'
expiresAt: '2022-04-12T23:20:50.52Z'
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: 'Hi Mo, this is for the cappuccino I bought for you the other day.'
externalRef: Coffee w/ Mo on 10 March 22
completed: true
- id: 'https://openpayments.guide/alice/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa'
accountId: 'https://openpayments.guide/alice/'
receivedAmount:
value: '100'
assetCode: USD
assetScale: 2
ilpStreamConnection: 'https://openpayments.guide/connections/1f6df9d5-c9a4-4c80-a354-86b915a04ff8'
expiresAt: '2022-04-12T23:20:50.52Z'
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: 'I love your website, Alice! Thanks for the great content'
completed: false
backward pagination:
value:
pagination:
startCursor: 241de237-f989-42be-926d-c0c1fca57708
endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414
hasPreviousPage: true
hasNextPage: false
result:
- id: 'https://openpayments.guide/alice/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa'
accountId: 'https://openpayments.guide/alice/'
receivedAmount:
value: '100'
assetCode: USD
assetScale: 2
completed: true
expiresAt: '2022-04-12T23:20:50.52Z'
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: 'I love your website, Alice! Thanks for the great content'
- id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8'
accountId: 'https://openpayments.guide/alice/'
incomingAmount:
value: '250'
assetCode: USD
assetScale: 2
receivedAmount:
value: '250'
assetCode: USD
assetScale: 2
completed: true
expiresAt: '2022-04-12T23:20:50.52Z'
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: 'Hi Mo, this is for the cappuccino I bought for you the other day.'
externalRef: Coffee w/ Mo on 10 March 22
headers: {}
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
description: List all incoming payments on the account
parameters:
- schema:
$ref: '#/components/schemas/pagination'
in: query
name: pagination
description: Pagination parameters
tags:
- incoming-payment
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
'/{accountId}/outgoing-payments':
post:
summary: Create an Outgoing Payment
tags:
- outgoing-payment
operationId: create-outgoing-payment
responses:
'201':
description: Outgoing Payment Created
content:
application/json:
schema:
$ref: '#/components/schemas/outgoing-payment'
examples:
New Fixed Send Outgoing Payment for $25:
value:
id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf'
accountId: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2'
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
receiveAmount:
value: '2500'
assetCode: USD
assetScale: 2
sentAmount:
value: '0'
assetCode: USD
assetScale: 2
description: Thank you for the shoes.
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
requestBody:
content:
application/json:
examples:
Create an outgoing payment based on a quote:
value:
quoteId: 'https://openpayments.guide/alice/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d'
externalRef: INV2022-02-0137
schema:
type: object
properties:
quoteId:
type: string
format: uri
description: The URL of the quote defining this payment's amounts.
description:
type: string
description: Human readable description of the outgoing payment that will be visible to the account holder and shared with the receiver.
externalRef:
type: string
description: A reference that can be used by external systems to reconcile this payment with their systems. E.g. An invoice number. (Optional)
required:
- quoteId
additionalProperties: false
description: |-
A subset of the outgoing payments schema is accepted as input to create a new outgoing payment.
The `sendAmount` must use the same `assetCode` and `assetScale` as the account.
required: true
description: An **outgoing payment** is a sub-resource of an account. It represents a payment from the account.
description: Create a new outgoing payment at the account.
get:
summary: List Outgoing Payments
operationId: list-outgoing-payments
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: '#/components/schemas/page-info'
result:
type: array
items:
$ref: '#/components/schemas/outgoing-payment'
examples:
forward pagination:
value:
pagination:
startCursor: 241de237-f989-42be-926d-c0c1fca57708
endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414
hasPreviousPage: false
hasNextPage: true
result:
- id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf'
accountId: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e'
receiveAmount:
value: '2500'
assetCode: USD
assetScale: 2
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
sentAmount:
value: '2500'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: APlusVideo subscription
externalRef: 'customer: 847458475'
- id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c'
accountId: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/shoeshop/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
sendAmount:
value: '7026'
assetCode: USD
assetScale: 2
receiveAmount:
value: '7026'
assetCode: USD
assetScale: 2
sentAmount:
value: '7026'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: Thank you for your purchase at ShoeShop!
externalRef: INV2022-8943756
backward pagination:
value:
pagination:
startCursor: 241de237-f989-42be-926d-c0c1fca57708
endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414
hasPreviousPage: true
hasNextPage: false
result:
- id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c'
accountId: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/shoeshop/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
sendAmount:
value: '7026'
assetCode: USD
assetScale: 2
receiveAmount:
value: '7026'
assetCode: USD
assetScale: 2
sentAmount:
value: '7026'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: Thank you for your purchase at ShoeShop!
externalRef: INV2022-8943756
- id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf'
accountId: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e'
receiveAmount:
value: '2500'
assetCode: USD
assetScale: 2
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
sentAmount:
value: '2500'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: APlusVideo subscription
externalRef: 'customer: 847458475'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
description: List all outgoing payments on the account
parameters:
- schema:
$ref: '#/components/schemas/pagination'
in: query
name: pagination
description: Pagination parameters
tags:
- outgoing-payment
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
'/{accountId}/quotes':
post:
summary: Create a Quote
tags:
- quote
operationId: create-quote
responses:
'201':
description: Quote Created
content:
application/json:
schema:
$ref: '#/components/schemas/quote'
examples:
New Fixed Send Quote for $25:
value:
id: 'https://openpayments.guide/alice/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf'
accountId: 'https://openpayments.guide/alice/'
receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e'
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
receiveAmount:
value: '2198'
assetCode: EUR
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
expiresAt: '2022-04-12T23:20:50.52Z'
'400':
description: No amount was provided and no amount could be inferred from the receiver.
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
requestBody:
content:
application/json:
examples:
Create fixed-send-amount quote for $25 to an ILP STREAM connection:
value:
receiver: 'https://openpayments.guide/connections/45a0d0ee-26dc-4c66-89e0-01fbf93156f7'
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
Create fixed-receive-amount quote for $25:
value:
receiver: 'https://openpayments.guide/alice/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7'
receiveAmount:
value: '2500'
assetCode: USD
assetScale: 2
schema:
type: object
properties:
receiver:
type: string
format: uri
description: The URL of the incoming payment or ILP STREAM connection that is being paid.
receiveAmount:
$ref: '#/components/schemas/amount'
sendAmount:
$ref: '#/components/schemas/amount'
required:
- receiver
additionalProperties: false
description: |-
A subset of the quotes schema is accepted as input to create a new quote.
The quote must be created with a (`sendAmount` xor `receiveAmount`) unless the `receiver` is an Incoming Payment which has an `incomingAmount`.
required: true
description: A **quote** is a sub-resource of an account. It represents a quote for a payment from the account.
description: Create a new quote at the account.
get:
summary: List Quotes
operationId: list-quotes
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: '#/components/schemas/page-info'
result:
type: array
items:
$ref: '#/components/schemas/quote'
additionalProperties: false
examples:
forward pagination:
value:
pagination:
startCursor: 241de237-f989-42be-926d-c0c1fca57708
endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414
hasPreviousPage: false
hasNextPage: true
result:
- id: 'https://openpayments.guide/alice/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf'
accountId: 'https://openpayments.guide/alice/'
receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e'
receiveAmount:
value: '2500'
assetCode: USD
assetScale: 2
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
expiresAt: '2022-04-12T23:20:50.52Z'
- id: 'https://openpayments.guide/alice/quotes/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c'
accountId: 'https://openpayments.guide/alice/'
receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
receiveAmount:
value: '2198'
assetCode: EUR
assetScale: 2
createdAt: '2022-04-01T10:24:36.11Z'
expiresAt: '2022-05-01T10:24:36.11Z'
backward pagination:
value:
pagination:
startCursor: 241de237-f989-42be-926d-c0c1fca57708
endCursor: 315581f8-9967-45a0-9cd3-87b60b6d6414
hasPreviousPage: true
hasNextPage: false
result:
- id: 'https://openpayments.guide/alice/quotes/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c'
accountId: 'https://openpayments.guide/alice/'
receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
sendAmount:
value: '7026'
assetCode: USD
assetScale: 2
receiveAmount:
value: '7026'
assetCode: USD
assetScale: 2
createdAt: '2022-04-01T10:24:36.11Z'
expiresAt: '2022-05-01T10:24:36.11Z'
- id: 'https://openpayments.guide/alice/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf'
accountId: 'https://openpayments.guide/alice/'
receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e'
receiveAmount:
value: '2500'
assetCode: USD
assetScale: 2
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
expiresAt: '2022-04-12T23:20:50.52Z'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
description: List all quotes on the account
parameters:
- schema:
$ref: '#/components/schemas/pagination'
in: query
name: pagination
description: Pagination parameters
tags:
- quote
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
'/{accountId}/incoming-payments/{incomingPaymentId}':
get:
summary: Get an Incoming Payment
tags:
- incoming-payment
operationId: get-incoming-payment
responses:
'200':
description: Incoming Payment Found
content:
application/json:
schema:
$ref: '#/components/schemas/incoming-payment'
examples:
Incoming Payment for $25 with $12.34 received so far:
value:
id: 'https://openpayments.guide/alice/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff'
accountId: 'https://openpayments.guide/alice/'
incomingAmount:
value: '2500'
assetCode: USD
assetScale: 2
receivedAmount:
value: '1234'
assetCode: USD
assetScale: 2
completed: false
expiresAt: '2022-04-12T23:20:50.52Z'
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: Thanks for the flowers!
externalRef: INV-12876
ilpStreamConnection:
id: 'https://openpayments.guide/connections/4a1b0150-db73-49e8-8713-628baa4a17ff'
ilpAddress: g.ilp.iwuyge987y.98y08y
sharedSecret: 6jR5iNIVRvqeasJeCty6C+YB5X9FhSOUPCL/5nha5Vs=
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
description: Incoming Payment Not Found
description: A client can fetch the latest state of an incoming payment to determine the amount received into the account.
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
- schema:
type: string
format: uuid
name: incomingPaymentId
in: path
required: true
description: Incoming Payment identifier
'/{accountId}/incoming-payments/{incomingPaymentId}/complete':
post:
summary: Complete an Incoming Payment
tags:
- incoming-payment
operationId: complete-incoming-payment
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/incoming-payment'
examples:
Completed Incoming Payment:
value:
id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8'
accountId: 'https://openpayments.guide/alice/'
incomingAmount:
value: '250'
assetCode: USD
assetScale: 2
receivedAmount:
value: '250'
assetCode: USD
assetScale: 2
completed: true
expiresAt: '2022-04-12T23:20:50.52Z'
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: 'Hi Mo, this is for the cappuccino I bought for you the other day.'
externalRef: Coffee w/ Mo on 10 March 22
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
description: Incoming Payment Not Found
description: |-
A client with the appropriate permissions MAY mark a non-expired **incoming payment** as `completed` if it has not yet received `incomingAmount`.
This indicates to the receiving account provider that it can begin any post processing of the payment such as generating account statements or notifying the account holder of the completed payment.
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
- schema:
type: string
format: uuid
name: incomingPaymentId
in: path
required: true
description: Incoming Payment identifier
'/{accountId}/outgoing-payments/{outgoingPaymentId}':
get:
summary: Get an Outgoing Payment
tags:
- outgoing-payment
operationId: get-outgoing-payment
responses:
'200':
description: Outgoing Payment Found
content:
application/json:
schema:
$ref: '#/components/schemas/outgoing-payment'
examples:
Outgoing Payment with a fixed send amount of $25:
value:
id: 'https://openpayments.guide/bob/outgoing-payments/3859b39e-4666-4ce5-8745-72f1864c5371'
accountId: 'https://openpayments.guide/bob/'
failed: false
receiver: 'http://openpayments.guide/alice/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff'
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
receiveAmount:
value: '2198'
assetCode: EUR
assetScale: 2
sentAmount:
value: '1205'
assetCode: USD
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
updatedAt: '2022-04-01T10:24:36.11Z'
description: Thanks for the flowers!
externalRef: INV-12876
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
description: Outgoing Payment Not Found
description: A client can fetch the latest state of an outgoing payment.
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
- schema:
type: string
format: uuid
name: outgoingPaymentId
in: path
required: true
description: Outgoing Payment identifier
'/{accountId}/quotes/{quoteId}':
get:
summary: Get a Quote
tags:
- quote
operationId: get-quote
responses:
'200':
description: Quote Found
content:
application/json:
schema:
$ref: '#/components/schemas/quote'
examples:
Quote with a fixed send amount of $25:
value:
id: 'https://openpayments.guide/bob/quotes/3859b39e-4666-4ce5-8745-72f1864c5371'
accountId: 'https://openpayments.guide/bob/'
receiver: 'http://openpayments.guide/alice/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff'
sendAmount:
value: '2500'
assetCode: USD
assetScale: 2
receiveAmount:
value: '2198'
assetCode: EUR
assetScale: 2
createdAt: '2022-03-12T23:20:50.52Z'
expiresAt: '2022-04-12T23:20:50.52Z'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
description: Quote Not Found
description: A client can fetch the latest state of a quote.
parameters:
- schema:
type: string
name: accountId
in: path
required: true
description: Account identifier
- schema:
type: string
format: uuid
name: quoteId
in: path
required: true
description: Quote identifier
components:
schemas:
account:
title: Account
type: object
description: An **account** resource is the root of the API and contains the public details of the financial account represented by the Payment Pointer that is also the service endpoint URL.
properties:
id:
type: string
format: uri
description: The URL identifying the incoming payment.
readOnly: true
publicName:
type: string
description: A public name for the account. This should be set by the account holder with their provider to provide a hint to counterparties as to the identity of the account holder.
readOnly: true
assetCode:
type: string
description: The asset code of the account. This SHOULD be an ISO4217 currency code.
readOnly: true
assetScale:
type: integer
minimum: 0
maximum: 255
description: The scale of the account.
readOnly: true
authServer:
type: string
format: uri
description: The URL of the authorization server endpoint for getting grants and access tokens for this account.
readOnly: true
required:
- id
- assetCode
- assetScale
- authServer
additionalProperties: false
examples:
- id: 'https://openpayments.guide/alice'
publicName: Alice
assetCode: USD
assetScale: 2
authServer: 'https://openpayments.guide/auth'
ilp-stream-connection:
title: ILP Stream Connection
type: object
description: An **ILP STREAM Connection** is an endpoint that returns unique STREAM connection credentials to establish a STREAM connection to the underlying account.
properties:
id:
type: string
format: uri
description: The URL identifying the endpoint.
readOnly: true
ilpAddress:
type: string
description: The ILP address to use when establishing a STREAM connection.
readOnly: true
sharedSecret:
type: string
description: The shared secret to use when establishing a STREAM connection.
readOnly: true
required:
- id
- ilpAddress
- sharedSecret
additionalProperties: false
examples:
- id: 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8'
ilpApddress: g.ilp.iwuyge987y.98y08y
sharedSecret: 6jR5iNIVRvqeasJeCty6C+YB5X9FhSOUPCL/5nha5Vs=
incoming-payment:
title: Incoming Payment
description: 'An **incoming payment** resource represents a payment that will be, is currently being, or has been received by the account.'
type: object
examples:
- id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8'
accountId: 'https://openpayments.guide/alice/'
incomingAmount:
value: '250'
assetCode: USD
assetScale: 2
receivedAmount:
value: '250'
assetCode: USD
assetScale: 2
completed: true
expiresAt: '2022-04-12T23:20:50.52Z'