-
Notifications
You must be signed in to change notification settings - Fork 3
/
protocol.html
796 lines (795 loc) · 47.2 KB
/
protocol.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>SimpleFIN Protocol</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ color: #cccccc; background-color: #303030; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ffcfaf; } /* Alert */
code span.an { color: #7f9f7f; font-weight: bold; } /* Annotation */
code span.at { } /* Attribute */
code span.bn { color: #dca3a3; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #f0dfaf; } /* ControlFlow */
code span.ch { color: #dca3a3; } /* Char */
code span.cn { color: #dca3a3; font-weight: bold; } /* Constant */
code span.co { color: #7f9f7f; } /* Comment */
code span.cv { color: #7f9f7f; font-weight: bold; } /* CommentVar */
code span.do { color: #7f9f7f; } /* Documentation */
code span.dt { color: #dfdfbf; } /* DataType */
code span.dv { color: #dcdccc; } /* DecVal */
code span.er { color: #c3bf9f; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #c0bed1; } /* Float */
code span.fu { color: #efef8f; } /* Function */
code span.im { } /* Import */
code span.in { color: #7f9f7f; font-weight: bold; } /* Information */
code span.kw { color: #f0dfaf; } /* Keyword */
code span.op { color: #f0efd0; } /* Operator */
code span.ot { color: #efef8f; } /* Other */
code span.pp { color: #ffcfaf; font-weight: bold; } /* Preprocessor */
code span.sc { color: #dca3a3; } /* SpecialChar */
code span.ss { color: #cc9393; } /* SpecialString */
code span.st { color: #cc9393; } /* String */
code span.va { } /* Variable */
code span.vs { color: #cc9393; } /* VerbatimString */
code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */
</style>
<link rel="stylesheet" href="style.css">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<h1 class="title">SimpleFIN Protocol</h1>
</header>
<div class="layout">
<nav class="toc">
<ul>
<li><a href="/">Home</a></li>
</ul>
<ul>
<li><a href="#introduction">Introduction</a>
<ul>
<li><a href="#flow">Flow</a></li>
<li><a href="#simplefin-bridge">SimpleFIN Bridge</a></li>
</ul></li>
<li><a href="#app-quickstart">App Quickstart</a>
<ul>
<li><a href="#start-a-connection">1. Start a connection</a></li>
<li><a href="#receive-a-simplefin-token">2. Receive a SimpleFIN Token</a></li>
<li><a href="#claim-the-access-url">3. Claim the Access URL</a></li>
<li><a href="#get-data">4. Get Data</a></li>
<li><a href="#checklist">Checklist</a></li>
</ul></li>
<li><a href="#data">Data</a>
<ul>
<li><a href="#account-set">Account Set</a></li>
<li><a href="#account">Account</a></li>
<li><a href="#transaction">Transaction</a></li>
<li><a href="#organization">Organization</a></li>
</ul></li>
<li><a href="#http-endpoints">HTTP Endpoints</a>
<ul>
<li><a href="#get-info">GET /info</a></li>
<li><a href="#get-create">GET /create</a></li>
<li><a href="#post-claimtoken">POST /claim/:token</a></li>
<li><a href="#get-accounts">GET /accounts</a></li>
</ul></li>
</ul>
</nav>
<div class="page-wrap">
<div class="right-column"></div>
<div class="main-column">
<p><img src="img/logo.svg" style="width: 32px; height: 32px;" align="center"> SimpleFIN Protocol</p>
<ul>
<li>Version: 1.0-draft.6</li>
<li>Last modified: 08 Feb 2024</li>
</ul>
<h1 id="introduction">Introduction</h1>
<p>The SimpleFIN protocol allows users to share read-only financial data with third parties. It’s similar to RSS, but for financial data.</p>
<p>Though intended mostly for banks, it can also be used for reward points or gift certificate balances (e.g. Frequent Flyer Miles, Amazon gift card balance, etc…)</p>
<p>Three parties are involved in SimpleFIN:</p>
<table>
<thead>
<tr class="header">
<th>Party</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>User</td>
<td>A person using a web browser. They have an account at a bank or other institution.</td>
</tr>
<tr class="even">
<td>Application</td>
<td>Third party software that wants read-only access to a <em>User</em>’s financial data.</td>
</tr>
<tr class="odd">
<td>Server</td>
<td>A SimpleFIN Server operated by a bank or other financial institution.</td>
</tr>
</tbody>
</table>
<p>Application developers should start with the <a href="#app-quickstart">App Quickstart</a>.</p>
<p>Banks or financial institutions wanting to host their own SimpleFIN Server should start at the <a href="#server-implementation-guide">Server Implementation Guide</a>.</p>
<p>Users should visit the <a href="https://bridge.simplefin.org">SimpleFIN Bridge</a>.</p>
<h2 id="flow">Flow</h2>
<p>This diagram shows how a User gives read-only bank account access to an App:</p>
<p><img src="img/connect-flow.svg" /></p>
<p>And this diagram shows how a User can revoke an App’s access:</p>
<p><img src="img/revoke-flow.svg" /></p>
<h2 id="simplefin-bridge">SimpleFIN Bridge</h2>
<p>For optimal privacy, banks ought to implement SimpleFIN Servers. In some cases, where banks haven’t yet implemented SimpleFIN, the <a href="https://bridge.simplefin.org">SimpleFIN Bridge</a> can be used.</p>
<h1 id="app-quickstart">App Quickstart</h1>
<p>This section is for application developers that want to integrate financial data (bank account balances/transactions) into their application.</p>
<p>If you are a programmer, and want programmatic access to your financial data, you’re in the right place.</p>
<h2 id="start-a-connection">1. Start a connection</h2>
<section>
<div class="main">
<p>First, direct your user to create a SimpleFIN Token. Do this by sending them to their institution’s SimpleFIN Server <code>/create</code> URL. If their institution doesn’t have a SimpleFIN Server, you can use the <a href="https://bridge.simplefin.org/simplefin/create">SimpleFIN Bridge</a>.</p>
</div>
<div class="example">
<p>Here’s an example HTML snippet:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a>Connect your bank account to this app, by</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a><span class="kw"><a</span><span class="ot"> href=</span><span class="st">"https://bridge.simplefin.org/simplefin/create"</span><span class="kw">></span>clicking here.<span class="kw"></a></span></span></code></pre></div>
</div>
</section>
<h2 id="receive-a-simplefin-token">2. Receive a SimpleFIN Token</h2>
<section>
<div class="main">
<p>The user will return to your app with a SimpleFIN Token in their clipboard. Provide a location for them to paste the token into your app – perhaps on the same page they left from.</p>
</div>
<div class="example">
<p>Here’s an example HTML form that receives a SimpleFIN Token:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="kw"><form</span><span class="ot"> method=</span><span class="st">"post"</span><span class="kw">></span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a> SimpleFIN Token: <span class="kw"><textarea</span><span class="ot"> name=</span><span class="st">"token"</span><span class="kw">></textarea></span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true"></a> <span class="kw"><button</span><span class="ot"> type=</span><span class="st">"submit"</span><span class="kw">></span>Connect Bank<span class="kw"></button></span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true"></a><span class="kw"></form></span></span></code></pre></div>
</div>
</section>
<h2 id="claim-the-access-url">3. Claim the Access URL</h2>
<section>
<div class="main">
<p>The SimpleFIN Token you receive from users is a Base64-encoded URL. Make an HTTP POST to that URL to claim an Access URL.</p>
<p>Securely store the Access URL for later use.</p>
</div>
<div class="example">
<p>Here’s a command line example. Obtain a SimpleFIN Token:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true"></a><span class="va">SIMPLEFIN_TOKEN=</span><span class="st">"aHR0cHM6Ly9icmlkZ2Uuc2ltcGxlZmluLm9yZy9zaW1wbGVmaW4vY2xhaW0vZGVtbw=="</span></span></code></pre></div>
<p>Base64 decode the SimpleFIN Token to get a URL:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true"></a><span class="va">CLAIM_URL=$(</span><span class="bu">echo</span> <span class="st">"</span><span class="va">${SIMPLEFIN_TOKEN}</span><span class="st">"</span> <span class="kw">|</span> <span class="ex">base64</span> --decode<span class="va">)</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true"></a><span class="co"># https://bridge.simplefin.org/simplefin/claim/demo</span></span></code></pre></div>
<p>Make a POST request to the decoded URL to get an Access URL:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true"></a><span class="va">ACCESS_URL=$(</span><span class="ex">curl</span> -X POST <span class="st">"</span><span class="va">${CLAIM_URL}</span><span class="st">"</span><span class="va">)</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a><span class="co"># https://user123:pass456@bridge.simplefin.org/simplefin</span></span></code></pre></div>
</div>
</section>
<h2 id="get-data">4. Get Data</h2>
<section>
<div class="main">
<p>Issue GET requests to the Access URL’s <code>/accounts</code> resource to get account and transaction information.</p>
<p>Successful responses will be a JSON <a href="#account-set">Account Set</a>.</p>
<p>See <a href="#get-accounts">GET /accounts</a> for more information.</p>
</div>
<div class="example">
<p>Request:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true"></a><span class="ex">curl</span> <span class="st">"</span><span class="va">${ACCESS_URL}</span><span class="st">/accounts"</span></span></code></pre></div>
<p>Sample response:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true"></a> <span class="dt">"errors"</span><span class="fu">:</span> <span class="ot">[</span><span class="st">"You must reauthenticate."</span><span class="ot">]</span><span class="fu">,</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true"></a> <span class="dt">"accounts"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true"></a> <span class="fu">{</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true"></a> <span class="dt">"org"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true"></a> <span class="dt">"domain"</span><span class="fu">:</span> <span class="st">"mybank.com"</span><span class="fu">,</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true"></a> <span class="dt">"sfin-url"</span><span class="fu">:</span> <span class="st">"https://sfin.mybank.com"</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true"></a> <span class="fu">},</span></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"2930002"</span><span class="fu">,</span></span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"Savings"</span><span class="fu">,</span></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true"></a> <span class="dt">"currency"</span><span class="fu">:</span> <span class="st">"USD"</span><span class="fu">,</span></span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true"></a> <span class="dt">"balance"</span><span class="fu">:</span> <span class="st">"100.23"</span><span class="fu">,</span></span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true"></a> <span class="dt">"available-balance"</span><span class="fu">:</span> <span class="st">"75.23"</span><span class="fu">,</span></span>
<span id="cb7-14"><a href="#cb7-14" aria-hidden="true"></a> <span class="dt">"balance-date"</span><span class="fu">:</span> <span class="dv">978366153</span><span class="fu">,</span></span>
<span id="cb7-15"><a href="#cb7-15" aria-hidden="true"></a> <span class="dt">"transactions"</span><span class="fu">:</span> <span class="ot">[]</span></span>
<span id="cb7-16"><a href="#cb7-16" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb7-17"><a href="#cb7-17" aria-hidden="true"></a> <span class="ot">]</span></span>
<span id="cb7-18"><a href="#cb7-18" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h2 id="checklist">Checklist</h2>
<section>
<div class="main">
<p>The following checklists can help make sure your SimpleFIN-capable application is implemented correctly:</p>
<h3 id="required">Required</h3>
<p>The application:</p>
<ol type="1">
<li>Handles a 403 response when claiming an Access URL.</li>
<li>When claiming an Access URL fails, notifies the customer that the token may be compromised so they can disable the token.</li>
<li>Only makes requests to SSL/TLS URLs (i.e. HTTPS and never HTTP).</li>
<li>Stores Access URLs at least as securely as the user’s financial data.</li>
<li>Handles a 403 response from <code>/accounts</code>.</li>
<li>Displays error messages from <code>/accounts</code> to the user.</li>
<li>Sanitizes all error messages from <code>/accounts</code> that are displayed to the user.</li>
<li>Verifies all SSL/TLS certificates when making HTTPS requests.</li>
</ol>
<h3 id="recommended">Recommended</h3>
<p>The application:</p>
<ol type="1">
<li>Handles <a href="#custom-currencies">custom currencies</a>.</li>
</ol>
</div>
</section>
<h1 id="data">Data</h1>
<h2 id="account-set">Account Set</h2>
<section>
<div class="main">
<table>
<thead>
<tr class="header">
<th>Attribute</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>errors</td>
<td>array</td>
<td><strong>yes</strong></td>
<td>Array of strings suitable for displaying to a user.</td>
</tr>
<tr class="even">
<td>accounts</td>
<td>array of <a href="#accounts">Accounts</a></td>
<td><strong>yes</strong></td>
<td>List of accounts.</td>
</tr>
</tbody>
</table>
<warning>
Though the array of strings are meant for users, you <strong>must</strong> sanitize the strings when displaying them.
</warning>
</div>
<div class="example">
<div class="sourceCode" id="cb8"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true"></a> <span class="dt">"errors"</span><span class="fu">:</span> <span class="ot">[]</span><span class="fu">,</span></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true"></a> <span class="dt">"accounts"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true"></a> <span class="fu">{</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true"></a> <span class="dt">"org"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true"></a> <span class="dt">"domain"</span><span class="fu">:</span> <span class="st">"mybank.com"</span><span class="fu">,</span></span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true"></a> <span class="dt">"sfin-url"</span><span class="fu">:</span> <span class="st">"https://sfin.mybank.com"</span></span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true"></a> <span class="fu">},</span></span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"2930002"</span><span class="fu">,</span></span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"Savings"</span><span class="fu">,</span></span>
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true"></a> <span class="dt">"currency"</span><span class="fu">:</span> <span class="st">"USD"</span><span class="fu">,</span></span>
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true"></a> <span class="dt">"balance"</span><span class="fu">:</span> <span class="st">"100.23"</span><span class="fu">,</span></span>
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true"></a> <span class="dt">"available-balance"</span><span class="fu">:</span> <span class="st">"75.23"</span><span class="fu">,</span></span>
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true"></a> <span class="dt">"balance-date"</span><span class="fu">:</span> <span class="dv">978366153</span><span class="fu">,</span></span>
<span id="cb8-15"><a href="#cb8-15" aria-hidden="true"></a> <span class="dt">"transactions"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb8-16"><a href="#cb8-16" aria-hidden="true"></a> <span class="fu">{</span></span>
<span id="cb8-17"><a href="#cb8-17" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"12394832938403"</span><span class="fu">,</span></span>
<span id="cb8-18"><a href="#cb8-18" aria-hidden="true"></a> <span class="dt">"posted"</span><span class="fu">:</span> <span class="dv">793090572</span><span class="fu">,</span></span>
<span id="cb8-19"><a href="#cb8-19" aria-hidden="true"></a> <span class="dt">"amount"</span><span class="fu">:</span> <span class="st">"-33293.43"</span><span class="fu">,</span></span>
<span id="cb8-20"><a href="#cb8-20" aria-hidden="true"></a> <span class="dt">"description"</span><span class="fu">:</span> <span class="st">"Uncle Frank's Bait Shop"</span><span class="fu">,</span></span>
<span id="cb8-21"><a href="#cb8-21" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb8-22"><a href="#cb8-22" aria-hidden="true"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb8-23"><a href="#cb8-23" aria-hidden="true"></a> <span class="dt">"extra"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb8-24"><a href="#cb8-24" aria-hidden="true"></a> <span class="dt">"account-open-date"</span><span class="fu">:</span> <span class="dv">978360153</span><span class="fu">,</span></span>
<span id="cb8-25"><a href="#cb8-25" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb8-26"><a href="#cb8-26" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb8-27"><a href="#cb8-27" aria-hidden="true"></a> <span class="ot">]</span></span>
<span id="cb8-28"><a href="#cb8-28" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h2 id="account">Account</h2>
<section>
<div class="main">
<table>
<thead>
<tr class="header">
<th>Attribute</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>org</td>
<td><a href="#organization">Organization</a></td>
<td><strong>yes</strong></td>
<td>Organization from which this account originates.</td>
</tr>
<tr class="even">
<td>id</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>String that uniquely identifies the account within the organization. It is recommended that this id be chosen such that it does not reveal any sensitive data (login information for the bank’s web banking portal, for instance).</td>
</tr>
<tr class="odd">
<td>name</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>A name that uniquely describes an account among all the users other accounts. This name should be chosen so that a person can easily associate it with only one of their accounts within an organization.</td>
</tr>
<tr class="even">
<td>currency</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>If the currency is a standard currency, this is the currency code from the official ISO 4217. For example <code>"ZMW"</code> or <code>"USD"</code>. If this is a custom currency, see the <a href="#custom-currencies">Custom Currencies section</a> below.</td>
</tr>
<tr class="odd">
<td>balance</td>
<td>numeric string</td>
<td><strong>yes</strong></td>
<td>The balance of the account as of <code>balance-date</code>.</td>
</tr>
<tr class="even">
<td>available-balance</td>
<td>numeric string</td>
<td>optional</td>
<td>The available balance of the account as of balance-date. This may be omitted if it is the same as balance.</td>
</tr>
<tr class="odd">
<td>balance-date</td>
<td>UNIX epoch timestamp</td>
<td><strong>yes</strong></td>
<td>The timestamp when the balance and available-balance became what they are.</td>
</tr>
<tr class="even">
<td>transactions</td>
<td>array of <a href="#transaction">Transactions</a></td>
<td>optional</td>
<td>List of a subset of <a href="#transaction">Transactions</a> for this account, ordered by <code>posted</code>.</td>
</tr>
<tr class="odd">
<td>extra</td>
<td>object</td>
<td>optional</td>
<td>This optional attribute may be used to include extra account-specific data that is not defined in this standard. It is up to the Server to decide whether or not to include data in here.</td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<div class="sourceCode" id="cb9"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true"></a> <span class="dt">"org"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true"></a> <span class="dt">"domain"</span><span class="fu">:</span> <span class="st">"mybank.com"</span><span class="fu">,</span></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true"></a> <span class="dt">"sfin-url"</span><span class="fu">:</span> <span class="st">"https://sfin.mybank.com"</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true"></a> <span class="fu">},</span></span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"2930002"</span><span class="fu">,</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"Savings"</span><span class="fu">,</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true"></a> <span class="dt">"currency"</span><span class="fu">:</span> <span class="st">"USD"</span><span class="fu">,</span></span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true"></a> <span class="dt">"balance"</span><span class="fu">:</span> <span class="st">"100.23"</span><span class="fu">,</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true"></a> <span class="dt">"available-balance"</span><span class="fu">:</span> <span class="st">"75.23"</span><span class="fu">,</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true"></a> <span class="dt">"balance-date"</span><span class="fu">:</span> <span class="dv">978366153</span><span class="fu">,</span></span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true"></a> <span class="dt">"transactions"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true"></a> <span class="fu">{</span></span>
<span id="cb9-14"><a href="#cb9-14" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"12394832938403"</span><span class="fu">,</span></span>
<span id="cb9-15"><a href="#cb9-15" aria-hidden="true"></a> <span class="dt">"posted"</span><span class="fu">:</span> <span class="dv">793090572</span><span class="fu">,</span></span>
<span id="cb9-16"><a href="#cb9-16" aria-hidden="true"></a> <span class="dt">"amount"</span><span class="fu">:</span> <span class="st">"-33293.43"</span><span class="fu">,</span></span>
<span id="cb9-17"><a href="#cb9-17" aria-hidden="true"></a> <span class="dt">"description"</span><span class="fu">:</span> <span class="st">"Uncle Frank's Bait Shop"</span><span class="fu">,</span></span>
<span id="cb9-18"><a href="#cb9-18" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb9-19"><a href="#cb9-19" aria-hidden="true"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true"></a> <span class="dt">"extra"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb9-21"><a href="#cb9-21" aria-hidden="true"></a> <span class="dt">"account-open-date"</span><span class="fu">:</span> <span class="dv">978360153</span><span class="fu">,</span></span>
<span id="cb9-22"><a href="#cb9-22" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb9-23"><a href="#cb9-23" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h3 id="custom-currencies">Custom Currencies</h3>
<section>
<div class="main">
<p>SimpleFIN supports custom currencies such as: Frequent Flyer Miles, Rewards Points, brownie points, etc…</p>
<p>Custom currencies are identified by a unique URL. When an HTTP GET request is made to the URL, it should return a JSON object with the following attributes:</p>
<table>
<thead>
<tr class="header">
<th>Attribute</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>name</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>Human-readable name of the currency.</td>
</tr>
<tr class="even">
<td>abbr</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>Human-readable short name of the currency.</td>
</tr>
</tbody>
</table>
<warning>
All strings obtained from these requests <strong>must</strong> be sanitized when displaying them to users.
</warning>
</div>
<div class="example">
<p>The following Account’s currency is <code>https://www.example.com/fake-currency</code></p>
<div class="sourceCode" id="cb10"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true"></a> <span class="er">...</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"2930002"</span><span class="fu">,</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"Savings"</span><span class="fu">,</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true"></a> <span class="dt">"currency"</span><span class="fu">:</span> <span class="st">"https://www.example.com/flight-miles"</span><span class="fu">,</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true"></a> <span class="dt">"balance"</span><span class="fu">:</span> <span class="st">"100.23"</span><span class="fu">,</span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true"></a> <span class="dt">"available-balance"</span><span class="fu">:</span> <span class="st">"75.23"</span><span class="fu">,</span></span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true"></a> <span class="dt">"balance-date"</span><span class="fu">:</span> <span class="dv">978366153</span><span class="fu">,</span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true"></a> <span class="dt">"transactions"</span><span class="fu">:</span> <span class="ot">[]</span></span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
<p>Making a request to the currency URL:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true"></a><span class="ex">curl</span> https://www.example.com/flight-miles</span></code></pre></div>
<p>Returns the following:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"Example Airline Miles"</span><span class="fu">,</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true"></a> <span class="dt">"abbr"</span><span class="fu">:</span> <span class="st">"miles"</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h2 id="transaction">Transaction</h2>
<section>
<div class="main">
<table>
<thead>
<tr class="header">
<th>Attribute</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>id</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>An ID that uniquely describes a transaction within an Account. An organization may reuse transaction ids for different accounts, but may never reuse a transaction id within an account.</td>
</tr>
<tr class="even">
<td>posted</td>
<td>UNIX epoch timestamp</td>
<td><strong>yes</strong></td>
<td>This is when the transaction posted to the account. If the transaction is pending, this may be <code>0</code>.</td>
</tr>
<tr class="odd">
<td>amount</td>
<td>numeric string</td>
<td><strong>yes</strong></td>
<td>Amount of transaction. Positive numbers indicate money being deposited into the account.</td>
</tr>
<tr class="even">
<td>description</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>A human-readable description of what the transaction was for.</td>
</tr>
<tr class="odd">
<td>transacted_at</td>
<td>UNIX epoch timestamp</td>
<td>optional</td>
<td>This is when the transaction happened.</td>
</tr>
<tr class="even">
<td>pending</td>
<td>boolean</td>
<td>optional</td>
<td><code>true</code> indicates that this transaction has not yet posted. Default is <code>false</code> (or absent), meaning the transaction has posted.</td>
</tr>
<tr class="odd">
<td>extra</td>
<td>object</td>
<td>optional</td>
<td>This optional attribute may be used to include extra transaction-specific data that is not defined in this standard. It is up to the Server to decide whether or not to include data in here.</td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<div class="sourceCode" id="cb13"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"12394832938403"</span><span class="fu">,</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true"></a> <span class="dt">"posted"</span><span class="fu">:</span> <span class="dv">793090572</span><span class="fu">,</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true"></a> <span class="dt">"amount"</span><span class="fu">:</span> <span class="st">"-33293.43"</span><span class="fu">,</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true"></a> <span class="dt">"description"</span><span class="fu">:</span> <span class="st">"Uncle Frank's Bait Shop"</span><span class="fu">,</span></span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true"></a> <span class="dt">"pending"</span><span class="fu">:</span> <span class="kw">true</span><span class="fu">,</span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true"></a> <span class="dt">"extra"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true"></a> <span class="dt">"category"</span><span class="fu">:</span> <span class="st">"food"</span></span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h2 id="organization">Organization</h2>
<section>
<div class="main">
<note>
Either <code>domain</code> or <code>name</code> is required. Both may be specified.
</note>
<table>
<thead>
<tr class="header">
<th>Attribute</th>
<th>Type</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>domain</td>
<td>string</td>
<td>maybe</td>
<td>Domain name of the financial institution.</td>
</tr>
<tr class="even">
<td>sfin-url</td>
<td>string</td>
<td><strong>yes</strong></td>
<td>Root URL of organization’s SimpleFIN Server</td>
</tr>
<tr class="odd">
<td>name</td>
<td>string</td>
<td>maybe</td>
<td>Human-friendly name of the financial institution.</td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<div class="sourceCode" id="cb14"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true"></a><span class="er">"org":</span> <span class="fu">{</span></span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true"></a> <span class="dt">"domain"</span><span class="fu">:</span> <span class="st">"mybank.com"</span><span class="fu">,</span></span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"My Bank"</span><span class="fu">,</span></span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true"></a> <span class="dt">"sfin-url"</span><span class="fu">:</span> <span class="st">"https://sfin.mybank.com"</span></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h1 id="http-endpoints">HTTP Endpoints</h1>
<section>
<div class="main">
<p>A SimpleFIN Server has a root URL. All the resources below are relative to this root URL.</p>
<p>Following are all 4 HTTP endpoints a SimpleFIN Server must implement.</p>
<ul>
<li><a href="#get-info"><code>GET /info</code></a></li>
<li><a href="#get-create"><code>GET /create</code></a></li>
<li><a href="#post-claimtoken"><code>POST /claim/:token</code></a></li>
<li><a href="#get-accounts"><code>GET /accounts</code></a></li>
</ul>
</div>
<div class="example">
<p>Here’s an example root URL, set to the shell environment variable <code>ROOT</code>.</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true"></a><span class="va">ROOT=</span><span class="st">"https://bridge.simplefin.org/simplefin"</span></span></code></pre></div>
</div>
</section>
<h2 id="get-info">GET /info</h2>
<section>
<div class="main">
<p>Used by Applications to find out what versions of the SimpleFIN Protocol the server supports.</p>
<h3 id="http-request">HTTP Request</h3>
<p><code>GET /info</code></p>
<h3 id="response-json">Response JSON</h3>
<table>
<thead>
<tr class="header">
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>versions</td>
<td>An array of version strings that this server supports.</td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<p>Request:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true"></a><span class="ex">curl</span> https://bridge.simplefin.org/simplefin/info</span></code></pre></div>
<p>Response:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true"></a> <span class="dt">"versions"</span><span class="fu">:</span> <span class="ot">[</span><span class="st">"1.0-draft"</span><span class="ot">]</span><span class="fu">,</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
<h2 id="get-create">GET /create</h2>
<section>
<div class="main">
<p>An application directs a user to this URL to initiate a bank-app connection. When a user visits this URL the server:</p>
<ol type="1">
<li>Authenticates the user</li>
<li>Guides the user to create a SimpleFIN Token.</li>
<li>Tells the user to give the SimpleFIN Token to the application requesting it.</li>
</ol>
<p>This process could happen all at once with a single response (if the user is already authenticated) or it could be more involved. Either way, the end result is a copyable SimpleFIN Token.</p>
<h3 id="http-request-1">HTTP Request</h3>
<p><code>GET /create</code></p>
</div>
<div class="example">
<p>For example, an application that wants to access a user’s transaction data could present the following in a web page:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true"></a>To connect your bank to this application,</span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true"></a><span class="kw"><a</span><span class="ot"> href=</span><span class="st">"https://bridge.simplefin.org/simplefin/create"</span><span class="kw">></span>click here<span class="kw"></a></span></span></code></pre></div>
<p>An example SimpleFIN Token looks like this:</p>
<pre><code>aHR0cHM6Ly9icmlkZ2Uuc2ltcGxlZmluLm9yZy9zaW1wbGVmaW4vY2xhaW0vZGVtbw==</code></pre>
</div>
</section>
<h2 id="post-claimtoken">POST /claim/:token</h2>
<section>
<div class="main">
<p>An application receives a SimpleFIN Token from a user. SimpleFIN Tokens are Base64-encoded URLs. A decoded SimpleFIN Token will point to this resource.</p>
<h3 id="http-request-2">HTTP Request</h3>
<p><code>POST /claim/:token</code></p>
<table>
<thead>
<tr class="header">
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>:token</td>
<td>A one-time use code embedded within the SimpleFIN Token.</td>
</tr>
</tbody>
</table>
<h3 id="successful-response-body">Successful response body</h3>
<p>Response is an Access URL, which is just a URL with included Basic Auth credentials.</p>
<h3 id="responses">Responses</h3>
<table>
<thead>
<tr class="header">
<th>Code</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>200</td>
<td>Successful response</td>
</tr>
<tr class="even">
<td>403</td>
<td>The claim token either does not exist or has already been used claimed by someone else. Receiving this could mean that the user’s transaction information has been compromised.</td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<p>The following example uses a demo token that can be reused:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true"></a><span class="va">TOKEN=</span><span class="st">"aHR0cHM6Ly9icmlkZ2Uuc2ltcGxlZmluLm9yZy9zaW1wbGVmaW4vY2xhaW0vZGVtbw=="</span></span></code></pre></div>
<p>Decode the token:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true"></a><span class="va">DECODED_TOKEN=$(</span><span class="bu">echo</span> <span class="st">"</span><span class="va">${TOKEN}</span><span class="st">"</span> <span class="kw">|</span> <span class="ex">base64</span> -D<span class="va">)</span></span></code></pre></div>
<p>Claim the Access URL associated with this SimpleFIN Token:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true"></a><span class="va">ACCESS_URL=$(</span><span class="ex">curl</span> -X POST <span class="st">"</span><span class="va">${DECODED_TOKEN}</span><span class="st">"</span><span class="va">)</span></span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true"></a><span class="co"># https://demo:demo@bridge.simplefin.org/simplefin</span></span></code></pre></div>
</div>
</section>
<h2 id="get-accounts">GET /accounts</h2>
<section>
<div class="main">
<p>Retrieve account and transaction data.</p>
<h3 id="http-request-3">HTTP Request</h3>
<p><code>GET /accounts</code></p>
<table>
<thead>
<tr class="header">
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>start-date</td>
<td>optional</td>
<td>If given, transactions will be restricted to those on or after this Unix epoch timestamp.</td>
</tr>
<tr class="even">
<td>end-date</td>
<td>optional</td>
<td>If given, transactions will be restricted to those before (<strong>but not on</strong>) this Unix epoch timestamp.</td>
</tr>
<tr class="odd">
<td>pending</td>
<td>optional</td>
<td>If <code>pending=1</code> is provided, pending transactions will be included (if supported). By default, pending transaction are <strong>NOT</strong> included.</td>
</tr>
</tbody>
</table>
<h3 id="authentication">Authentication</h3>
<p>HTTP Basic Authentication using credentials obtained from the <a href="#post-claimtoken">POST /claim/:token</a> endpoint are used.</p>
<h3 id="successful-response">Successful response</h3>
<p>A successful response will be a JSON <a href="#account-set">Account Set</a>.</p>
<h3 id="responses-1">Responses</h3>
<table>
<thead>
<tr class="header">
<th>Code</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>200</td>
<td>Successful response</td>
</tr>
<tr class="even">
<td>402</td>
<td>Payment required</td>
</tr>
<tr class="odd">
<td>403</td>
<td>Authentication failed. This could be because access has been revoked or if the credentials are incorrect.</td>
</tr>
</tbody>
</table>
</div>
<div class="example">
<p>Request:</p>
<div class="sourceCode" id="cb23"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true"></a><span class="ex">curl</span> <span class="st">"https://demo:demo@bridge.simplefin.org/simplefin/accounts?start-date=978360153"</span></span></code></pre></div>
<p>Sample response:</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true"></a><span class="fu">{</span></span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true"></a> <span class="dt">"errors"</span><span class="fu">:</span> <span class="ot">[]</span><span class="fu">,</span></span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true"></a> <span class="dt">"accounts"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true"></a> <span class="fu">{</span></span>
<span id="cb24-5"><a href="#cb24-5" aria-hidden="true"></a> <span class="dt">"org"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb24-6"><a href="#cb24-6" aria-hidden="true"></a> <span class="dt">"domain"</span><span class="fu">:</span> <span class="st">"mybank.com"</span><span class="fu">,</span></span>
<span id="cb24-7"><a href="#cb24-7" aria-hidden="true"></a> <span class="dt">"sfin-url"</span><span class="fu">:</span> <span class="st">"https://sfin.mybank.com"</span></span>
<span id="cb24-8"><a href="#cb24-8" aria-hidden="true"></a> <span class="fu">},</span></span>
<span id="cb24-9"><a href="#cb24-9" aria-hidden="true"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"2930002"</span><span class="fu">,</span></span>
<span id="cb24-10"><a href="#cb24-10" aria-hidden="true"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"Savings"</span><span class="fu">,</span></span>
<span id="cb24-11"><a href="#cb24-11" aria-hidden="true"></a> <span class="dt">"currency"</span><span class="fu">:</span> <span class="st">"USD"</span><span class="fu">,</span></span>
<span id="cb24-12"><a href="#cb24-12" aria-hidden="true"></a> <span class="dt">"balance"</span><span class="fu">:</span> <span class="st">"100.23"</span><span class="fu">,</span></span>
<span id="cb24-13"><a href="#cb24-13" aria-hidden="true"></a> <span class="dt">"available-balance"</span><span class="fu">:</span> <span class="st">"75.23"</span><span class="fu">,</span></span>
<span id="cb24-14"><a href="#cb24-14" aria-hidden="true"></a> <span class="dt">"balance-date"</span><span class="fu">:</span> <span class="dv">978366153</span><span class="fu">,</span></span>
<span id="cb24-15"><a href="#cb24-15" aria-hidden="true"></a> <span class="dt">"transactions"</span><span class="fu">:</span> <span class="ot">[]</span></span>
<span id="cb24-16"><a href="#cb24-16" aria-hidden="true"></a> <span class="fu">}</span></span>
<span id="cb24-17"><a href="#cb24-17" aria-hidden="true"></a> <span class="ot">]</span></span>
<span id="cb24-18"><a href="#cb24-18" aria-hidden="true"></a><span class="fu">}</span></span></code></pre></div>
</div>
</section>
</div>
</div>
</body>
</html>