-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopenapi.json
4571 lines (4571 loc) · 138 KB
/
openapi.json
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.1",
"info": {
"title": "PocketSmith",
"description": "The PocketSmith API",
"contact": {
"name": "API Support",
"email": "[email protected]"
},
"version": "2.0"
},
"x-samples-languages": [
"curl",
"node",
"javascript",
"php",
"python"
],
"servers": [
{
"url": "https://api.pocketsmith.com/v2",
"description": "Production"
}
],
"components": {
"securitySchemes": {
"developerKey": {
"type": "apiKey",
"in": "header",
"name": "X-Developer-Key",
"description": "If you want to build a tool just for yourself, be it a desktop widget to display your balances or a tool to import transactions from a bank without a bank feed, you can use our developer keys feature. You can issue yourself a key which will give you persistent API access to just your account. You should rotate your keys regularly."
},
"oauth2": {
"type": "oauth2",
"description": "If you want to a create an app for PocketSmith that other PocketSmith users can use, you'll be using OAuth 2. To register an app with PocketSmith, please email us on [email protected]. Let us know a bit about yourself and what you plan on building. When approved, you will be provided with your client_id and client_secret to start using OAuth. Then, check out our guide for integrating OAuth to get started.",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://my.pocketsmith.com/oauth/authorize",
"tokenUrl": "https://api.pocketsmith.com/v2/oauth/access_token",
"scopes": {
"user.read": "Access the user's details and preferences",
"user.write": "Access to change the user's details and preferences",
"accounts.read": "Access to list and view transaction accounts",
"accounts.write": "Access to update and delete transaction accounts",
"transactions.read": "Access to list and view accounts and transactions",
"transactions.write": "Access to create, update and delete transactions",
"categories.read": "Access to view categories",
"categories.write": "Ability to edit and delete categories",
"attachments.read": "Access to view attachments",
"attachments.write": "Ability to create, update and delete attachments",
"events.read": "Access to view events",
"events.write": "Ability to create, update and delete events"
}
}
}
}
},
"parameters": {
"userId": {
"name": "id",
"in": "path",
"description": "The unique identifier of the user.",
"required": true,
"schema": {
"type": "integer"
},
"example": 42
},
"scenarioId": {
"name": "id",
"in": "path",
"description": "The unique identifier of the scenario.",
"required": true,
"schema": {
"type": "integer"
},
"example": 42
},
"eventId": {
"name": "id",
"in": "path",
"description": "The unique identifier of the event.",
"required": true,
"schema": {
"type": "string"
},
"example": "42-1601942400"
}
},
"responses": {
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Not Allowed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"schemas": {
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The unique identifier of the user.",
"example": 42
},
"login": {
"type": "string",
"description": "The user's username.",
"example": "sampleuser69"
},
"name": {
"type": "string",
"description": "The full name of the user, although not all users will have a name set.",
"example": "Foo Barrington"
},
"email": {
"type": "string",
"description": "The user's email address.",
"example": "[email protected]"
},
"avatar_url": {
"type": "string",
"description": "The URL to the user's avatar.",
"example": "https://image.com/image.png"
},
"beta_user": {
"type": "boolean",
"description": "Whether the user has opted in to beta features.",
"example": true
},
"time_zone": {
"type": "string",
"description": "The user's time zone.",
"example": "Auckland"
},
"week_start_day": {
"type": "integer",
"description": "The day of the week the user wishes their calendars to start on. A number between 0 and 6, where 0 is Sunday and 6 is Saturday.",
"example": 1
},
"is_reviewing_transactions": {
"type": "boolean",
"description": "Whether the user wants to review new transactions, transfer transactions or categorisation.",
"example": true
},
"base_currency_code": {
"type": "string",
"description": "The user's base currency.",
"example": "NZD"
},
"always_show_base_currency": {
"type": "boolean",
"description": "Whether the user wants to see all accounts in their base currency instead of the native account currency.",
"example": false
},
"using_multiple_currencies": {
"type": "boolean",
"description": "Whether the user has multiple currencies in use across their account.",
"example": true
},
"available_accounts": {
"type": "integer",
"description": "The user's total number of available accounts.",
"example": 3
},
"available_budgets": {
"type": "integer",
"description": "The user's total number of available budgets.",
"example": 3
},
"forecast_last_updated_at": {
"type": "string",
"description": "When the user's forecast was last updated.",
"example": "2015-07-02T22:14:49Z"
},
"forecast_last_accessed_at": {
"type": "string",
"description": "When the user's forecast was last accessed.",
"example": "2015-07-02T22:14:49Z"
},
"forecast_start_date": {
"type": "string",
"description": "The date that the user's forecast starts.",
"example": "2015-07-01"
},
"forecast_end_date": {
"type": "string",
"description": "The date that the user's forecast ends.",
"example": "2015-07-15"
},
"forecast_defer_recalculate": {
"type": "boolean",
"description": "Whether the user's forecast recalculation should be deferred.",
"example": false
},
"forecast_needs_recalculate": {
"type": "boolean",
"description": "Whether the user's forecast needs to be recalculated.",
"example": true
},
"last_logged_in_at": {
"type": "string",
"description": "When the user last logged into PocketSmith.",
"example": "2015-07-02T22:14:49Z"
},
"last_activity_at": {
"type": "string",
"description": "When the user last interacted with PocketSmith, via any application or the API.",
"example": "2015-07-02T22:14:49Z"
},
"created_at": {
"type": "string",
"description": "When the user signed up.",
"example": "2015-07-02T22:14:49Z"
},
"updated_at": {
"type": "string",
"description": "When the user was last updated.",
"example": "2015-07-02T22:14:49Z"
}
}
},
"Institution": {
"type": "object",
"properties": {
"currency_code": {
"type": "string",
"description": "The currency code of the institution.",
"example": "NZD"
},
"title": {
"type": "string",
"description": "The title of the institution.",
"example": "Bank of Foo"
},
"updated_at": {
"type": "string",
"description": "When the institution was last updated.",
"example": "2015-04-21T22:42:22Z"
},
"created_at": {
"type": "string",
"description": "When the institution was created.",
"example": "2015-04-21T22:42:22Z"
},
"id": {
"type": "integer",
"description": "The unique identifier of the institution.",
"example": 57
}
}
},
"Account": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The unique identifier of the account.",
"example": 42
},
"title": {
"type": "string",
"description": "The title of the account.",
"example": "Bank of Foo"
},
"currency_code": {
"type": "string",
"description": "The currency code for the account.",
"example": "NZD"
},
"type": {
"type": "string",
"description": "The type of the account.",
"enum": [
"bank",
"credits",
"cash",
"stocks",
"mortgage",
"loans",
"vehicle",
"property",
"insurance",
"other_asset",
"other_liability"
],
"example": "bank"
},
"is_net_worth": {
"type": "boolean",
"description": "Whether the account is a net worth asset.",
"example": false
},
"primary_transaction_account": {
"$ref": "#/components/schemas/TransactionAccount"
},
"primary_scenario": {
"$ref": "#/components/schemas/Scenario"
},
"transaction_accounts": {
"type": "array",
"description": "All transaction accounts that compose the account, including the primary.",
"items": {
"$ref": "#/components/schemas/TransactionAccount"
}
},
"scenarios": {
"type": "array",
"description": "All scenarios that compose the account, including the primary.",
"items": {
"$ref": "#/components/schemas/Scenario"
}
},
"created_at": {
"type": "string",
"description": "When the account was created.",
"example": "2018-02-27"
},
"updated_at": {
"type": "string",
"description": "When the account was last updated.",
"example": "2018-02-27"
},
"current_balance": {
"type": "number",
"description": "The current balance of the account.",
"example": 2694.39
},
"current_balance_date": {
"type": "string",
"description": "The date of the current balance.",
"example": "2018-02-27"
},
"current_balance_in_base_currency": {
"type": "number",
"description": "The current balance of the account in the user's base currency.",
"example": 4041.59
},
"current_balance_exchange_rate": {
"type": "number",
"description": "The exchange rate between the account's currency and the user's base currency, when different. If the currencies are the same, null is returned.",
"example": 1.5
},
"safe_balance": {
"type": "number",
"description": "The current safe balance, if safe balance is activated on the account. If safe balance is not activated, then null is returned.",
"example": 2694.39
},
"safe_balance_in_base_currency": {
"type": "number",
"description": "The current safe balance in the user's base currency, if safe balance is activated on the account. If safe balance is not activated, then null is returned.",
"example": 4041.59
}
}
},
"TransactionAccount": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 96027
},
"name": {
"type": "string",
"example": "Sample Credit"
},
"number": {
"type": "string",
"example": "ASBCRD44554"
},
"current_balance": {
"type": "number",
"example": 2694.39
},
"current_balance_date": {
"type": "string",
"example": "2015-07-03"
},
"current_balance_in_base_currency": {
"type": "number",
"description": "The current balance of the transaction account in the user's base currency.",
"example": 4041.59
},
"current_balance_exchange_rate": {
"type": "number",
"description": "The exchange rate between the transaction account's currency and the user's base currency, when different. If the currencies are the same, null is returned.",
"example": 1.5
},
"safe_balance": {
"type": "number",
"description": "The current safe balance, if safe balance is activated and available for the transaction account. If safe balance is not available, then null is returned.",
"example": 2694.39
},
"safe_balance_in_base_currency": {
"type": "number",
"description": "The current safe balance in the user's base currency, if safe balance is activated and available for the transaction account. If safe balance is not available, then null is returned.",
"example": 4041.59
},
"starting_balance": {
"type": "number",
"example": 3547.45
},
"starting_balance_date": {
"type": "string",
"example": "2015-03-15"
},
"created_at": {
"type": "string",
"example": "2015-03-17T02:42:10Z"
},
"updated_at": {
"type": "string",
"example": "2015-07-02T22:14:49Z"
},
"institution": {
"$ref": "#/components/schemas/Institution"
},
"currency_code": {
"type": "string",
"description": "The currency that the account is in. This is determined by the account that the transaction account belongs to.",
"example": "NZD"
},
"type": {
"type": "string",
"description": "The type of the transaction account.",
"enum": [
"bank",
"credits",
"cash",
"stocks",
"mortgage",
"loans",
"vehicle",
"property",
"insurance",
"other_asset",
"other_liability"
],
"example": "bank"
}
}
},
"Scenario": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The unique identifier of the scenario.",
"example": 42
},
"title": {
"type": "string",
"description": "The title of the scenario.",
"example": "Wedding"
},
"description": {
"type": "string",
"description": "A short description of what the scenario is modelling."
},
"interest_rate": {
"type": "number",
"description": "The amount of interest to apply to the balance. Will apply periodically depending on what `interest_rate_repeat_id` is set to.",
"example": 2.4
},
"interest_rate_repeat_id": {
"type": "integer",
"description": "A number representing how often the interest should be applied. 0 is used for no interest, 2 is weekly, 3 is fortnightly, 4 is monthly, 5 is yearly and 7 for quarterly.",
"example": 4
},
"type": {
"type": "string",
"description": "The type of the scenario.",
"enum": [
"no-interest",
"savings",
"debt"
],
"example": "no-interest"
},
"minimum-value": {
"type": "number",
"example": 4000
},
"maximum-value": {
"type": "number",
"example": 42
},
"achieve_date": {
"type": "string",
"description": "For goals, the date that they should be achieved by."
},
"starting_balance": {
"type": "number",
"description": "The starting balance of the scenario.",
"example": 2450
},
"starting_balance_date": {
"type": "string",
"description": "The date of the starting balance.",
"example": "2018-02-27"
},
"closing_balance": {
"type": "number",
"description": "The closing balance of the scenario.",
"example": 5431.2
},
"closing_balance_date": {
"type": "string",
"description": "The date of the closing balance.",
"example": "2018-02-27"
},
"current_balance": {
"type": "number",
"description": "The current balance of the scenario.",
"example": 5431.2
},
"current_balance_date": {
"type": "string",
"description": "The date of the current balance.",
"example": "2018-02-27"
},
"current_balance_in_base_currency": {
"type": "number",
"description": "The current balance of the scenario in the user's base currency.",
"example": 8146.8
},
"current_balance_exchange_rate": {
"type": "number",
"description": "The exchange rate between the scenario's currency and the user's base currency, when different. If the currencies are the same, null is returned.",
"example": 1.5
},
"safe_balance": {
"type": "number",
"description": "The current safe balance in the user's base currency, if safe balance is activated on the account associated with the scenario. If safe balance is not activated, then null is returned.",
"example": 5431.2
},
"safe_balance_in_base_currency": {
"type": "number",
"description": "The current safe balance in the user's base currency, if safe balance is activated on the account associated with the scenario. If safe balance is not available, then null is returned.",
"example": 8146.8
},
"created_at": {
"type": "string",
"description": "When the scenario was created.",
"example": "2015-04-21T22:42:22Z"
},
"updated_at": {
"type": "string",
"description": "When the scenario was last updated.",
"example": "2015-04-21T22:42:22Z"
}
}
},
"Transaction": {
"type": "object",
"properties": {
"cheque_number": {
"type": "string",
"example": "503113643691"
},
"type": {
"type": "string",
"description": "Whether the transaction is a debit or a credit",
"enum": [
"debit",
"credit"
],
"example": "credit"
},
"memo": {
"type": "string",
"example": "An example memo"
},
"payee": {
"type": "string",
"description": "The payee/merchant of the transaction.",
"example": "St Martins New World"
},
"amount": {
"type": "number",
"example": 34.6
},
"amount_in_base_currency": {
"type": "number",
"description": "The amount of the transaction in the user's base currency.",
"example": 51.9
},
"date": {
"type": "string",
"description": "The date the transaction took place.",
"example": "2018-02-27"
},
"is_transfer": {
"type": "boolean",
"description": "Whether the transaction is a transfer.",
"example": false
},
"category": {
"$ref": "#/components/schemas/Category"
},
"note": {
"type": "string",
"example": "I spent way too much on cheese here"
},
"labels": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"foo",
"bar",
"baz"
]
},
"id": {
"type": "integer",
"description": "The unique identifier of the transaction.",
"example": 42
},
"original_payee": {
"type": "string",
"description": "The payee the transaction was created with.",
"example": "CARD4083ST MARTINS NEW WORLD CHRISTCHURCH"
},
"upload_source": {
"type": "string",
"description": "Where the transaction came from.",
"example": "file"
},
"closing_balance": {
"type": "number",
"description": "The closing balance of the account at the transaction.",
"example": 4312.32
},
"transaction_account": {
"$ref": "#/components/schemas/TransactionAccount"
},
"status": {
"type": "string",
"description": "The status of the transaction. Pending transactions are temporary and may be superseded later by their posted counterparts, which are permanent.",
"enum": [
"pending",
"posted"
]
},
"needs_review": {
"type": "boolean",
"description": "Whether the transaction needs to be reviewed.",
"example": true
},
"created_at": {
"type": "string",
"description": "When the transaction was created.",
"example": "2018-02-27T22:42:22Z"
},
"updated_at": {
"type": "string",
"description": "When the transaction was last updated.",
"example": "2018-02-27T22:42:22Z"
}
}
},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The unique identifier of the category.",
"example": 1438154
},
"title": {
"type": "string",
"description": "The title of the category.",
"example": "Beer"
},
"colour": {
"type": "string",
"description": "The colour for the category.",
"format": "CSS-style hex triplet",
"example": "#00ff00"
},
"children": {
"type": "array",
"description": "The category's child categories.",
"items": {
"$ref": "#/components/schemas/Category"
}
},
"parent_id": {
"type": "integer",
"description": "The unique identifier of the parent category of this category, or null if this category has no parent (i.e. is a top-level category)",
"example": 42
},
"is_transfer": {
"type": "boolean",
"description": "Whether this category has been marked as a transfer category.",
"example": false
},
"is_bill": {
"type": "boolean",
"description": "Whether the category is a bill category. A bill category is when budgeted amounts are normally spent at once, instead of spread across a budgeting period. This category will be included in the bill reminder email when set to true.",
"example": true
},
"roll_up": {
"type": "boolean",
"description": "Whether the category's budget is rolled up into its parent category, if a parent category is present.",
"example": false
},
"refund_behaviour": {
"type": "string",
"nullable": true,
"description": "How the category's refunds or deductions should be reported on.",
"enum": [
"debits_are_deductions",
"credits_are_refunds",
null
],
"example": "credits_are_refunds"
},
"created_at": {
"type": "string",
"description": "When the category was created.",
"format": "ISO 8601 timestamp",
"example": "2015-08-16T02:17:02Z"
},
"updated_at": {
"type": "string",
"description": "When the category was last updated.",
"format": "ISO 8601 timestamp",
"example": "2015-08-16T02:17:02Z"
}
}
},
"CategoryRule": {
"type": "object",
"properties": {
"category": {
"$ref": "#/components/schemas/Category"
},
"id": {
"type": "integer",
"description": "The unique identifier of the category rule.",
"example": 1438154
},
"payee_matches": {
"type": "string",
"description": "The keyword/s to match the transactions payees.",
"example": "Countdown"
},
"created_at": {
"type": "string",
"description": "When the category rule was created.",
"format": "ISO 8601 timestamp",
"example": "2019-07-09T10:06:02Z"
},
"updated_at": {
"type": "string",
"description": "When the category rule was last updated.",
"format": "ISO 8601 timestamp",
"example": "2019-07-09T10:06:02Z"
}
}
},
"BudgetAnalysis": {
"type": "object",
"properties": {
"start_date": {
"type": "string",
"description": "The start date of the budget analysis.",
"example": "2016-11-01"
},
"end_date": {
"type": "string",
"description": "The end date of the budget analysis.",
"example": "2016-11-30"
},
"currency_code": {
"type": "string",
"description": "The currency of the budget analysis.",
"example": "nzd"
},
"total_actual_amount": {
"type": "number",
"description": "The total actual (transactions) amount across all periods.",
"example": -42.3
},
"average_actual_amount": {
"type": "number",
"description": "The average actual (transactions) amount across all periods.",
"example": -42.3
},
"total_forecast_amount": {
"type": "number",
"description": "The total budgeted amount across all periods.",
"example": -60
},
"average_forecast_amount": {
"type": "number",
"description": "The average budgeted amount across all periods.",
"example": -60
},
"total_over_by": {
"type": "number",
"description": "The total amount the budget was exceeded across all periods.",
"example": 0
},
"total_under_by": {
"type": "number",
"description": "The total amount the budget was under by across all periods.",
"example": 17.7
},
"periods": {
"type": "array",
"description": "The period analyses that this budget analysis comprises.",
"items": {
"$ref": "#/components/schemas/Period"
}
}
}
},
"Period": {
"type": "object",
"properties": {
"start_date": {
"type": "string",
"description": "The start date of the period.",
"example": "2016-11-01"
},
"end_date": {
"type": "string",
"description": "The end date of the period.",
"example": "2016-11-30"
},
"currency_code": {
"type": "string",
"description": "The currency of the period.",
"example": "nzd"
},
"actual_amount": {
"type": "number",
"description": "The sum of all actuals (transactions) in the period.",
"example": -42.3
},
"forecast_amount": {
"type": "number",
"description": "The sum of all forecast sources (budget events) in the period, for comparison against the actual amount.",
"example": -60
},
"refund_amount": {
"type": "number",
"description": "This attribute tracks the amount that has been refunded or deducted to the actual amount. When a category is set to \"always expense\", any credit transactions are treated as refunds and when set to \"always income\", any debit transactions are treated as deductions.",
"example": 5.6
},
"current": {
"type": "boolean",
"description": "Whether this period is current, such that the current date (in the user's time zone) falls within the date range.",
"example": true
},
"over_budget": {
"type": "boolean",
"description": "Whether the budget has been exceeded in the period.",
"example": false
},
"under_budget": {
"type": "boolean",
"description": "Whether the budget has not been exceeded in the period.",
"example": true
},
"over_by": {
"type": "number",
"description": "How much the budget has been exceeded by in the period.",
"example": 0
},
"under_by": {
"type": "number",
"description": "How much there is left in the budget for the period.",
"example": 17.7
},
"percentage_used": {
"type": "number",
"description": "The percentage of the budget that has been used in the period.",
"example": 70.5
}
}
},
"BudgetAnalysisPackage": {
"type": "object",
"properties": {
"category": {
"$ref": "#/components/schemas/Category"
},
"is_transfer": {
"type": "boolean",
"description": "Whether the expense budget analysis looks like a transfer to the income budget analysis, based on a number of heuristics.",
"example": false
},
"expense": {
"$ref": "#/components/schemas/BudgetAnalysis"
},
"income": {
"$ref": "#/components/schemas/BudgetAnalysis"
}
}
},
"Event": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the event.",
"example": "42-1601942400"
},
"category": {
"$ref": "#/components/schemas/Category"
},
"scenario": {
"$ref": "#/components/schemas/Scenario"
},
"amount": {
"type": "number",
"description": "The amount of the event.",
"example": 250.5
},
"amount_in_base_currency": {
"type": "number",
"description": "The amount of the event in the user's base currency.",
"example": 375.75
},
"currency_code": {
"type": "string",
"description": "The currency code of the event.",
"example": "nzd"
},
"date": {
"type": "string",
"description": "The date of the event.",
"example": "2020-10-27"
},
"colour": {
"type": "string",
"description": "The CSS hex-style colour of the event.",
"example": "#F63737"
},
"note": {
"type": "string",
"description": "The note of the event.",
"example": "Buy more beer every Friday from the local brewery."
},
"repeat_type": {
"type": "string",
"description": "The repeat type of the event.",
"enum": [
"once",
"daily",