-
Notifications
You must be signed in to change notification settings - Fork 124
/
xero-finance.yaml
2497 lines (2497 loc) · 100 KB
/
xero-finance.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
version: 6.3.0
title: Xero Finance API
description: The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
termsOfService: https://developer.xero.com/xero-developer-platform-terms-conditions/
contact:
name: Xero Platform Team
email: [email protected]
url: https://developer.xero.com
license:
name: MIT
url: https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE
servers:
- description: Xero API servers
url: https://api.xero.com/finance.xro/1.0
paths:
/CashValidation:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.cashvalidation.read
tags:
- Finance
summary: Get cash validation
operationId: getCashValidation
description: Summarizes the total cash position for each account for an org
parameters:
- name: balanceDate
x-snake: balance_date
in: query
description: "date, yyyy-MM-dd \r\n\r\nIf no parameter is provided, the current date will be used.\r\n\r\nThe ‘balance date’ will return transactions based on the accounting date entered by the user. Transactions before the balanceDate will be included.\r\nThe user has discretion as to which accounting period the transaction relates to.\r\n\r\nThe ‘balance date’ will control the latest maximum date of transactions included in the aggregate numbers. Balance date does not affect the CurrentStatement object, as this will always return the most recent statement before asAtSystemDate (if specified)"
schema:
type: string
example: "2021-09-15"
- name: asAtSystemDate
x-snake: as_at_system_date
in: query
description: "date, yyyy-MM-dd \r\n\r\nIf no parameter is provided, the current date will be used.\r\n\r\nThe ‘as at’ date will return transactions based on the creation date. It reflects the date the transactions were entered into Xero, not the accounting date.\r\nThe ‘as at’ date can not be overridden by the user. This can be used to estimate a ‘historical frequency of reconciliation’.\r\n\r\nThe ‘as at’ date will affect the current statement in the response, as any candidate statements created after this date will be filtered out. Thus the current statement returned will be the most recent statement prior to the specified ‘as at’ date. Be aware that neither the begin date, nor the balance date, will affect the current statement.\r\n\r\nNote; information is only presented when system architecture allows, meaning historical cash validation information will be an estimate. In addition, delete events are not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted at the time the API is accessed will be considered to always have been deleted."
schema:
type: string
example: "2021-09-15"
- name: beginDate
x-snake: begin_date
in: query
description: "date, yyyy-MM-dd \r\n\r\nIf no parameter is provided, the aggregate results will be drawn from the user’s total history.\r\n\r\nThe ‘begin date’ will return transactions based on the accounting date entered by the user. Transactions after the beginDate will be included.\r\nThe user has discretion as to which accounting period the transaction relates to."
schema:
type: string
example: "2021-09-15"
responses:
"200":
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CashValidationResponse'
example:
- accountId: 73151de8-3676-4887-a021-edec960dd537
statementBalance:
value: 100
type: DEBIT
statementBalanceDate: "2021-03-01"
bankStatement:
statementLines:
unreconciledAmountPos: 4577
unreconciledAmountNeg: -2367
unreconciledLines: 8
avgDaysUnreconciledPos: 112.265531
avgDaysUnreconciledNeg: 149.298992
earliestUnreconciledTransaction: "2019-03-01"
latestUnreconciledTransaction: "2021-03-01"
deletedAmount: 50
totalAmount: 189
dataSource:
directBankFeed: 0
indirectBankFeed: 0
fileUpload: 300
manual: -188
directBankFeedPos: 0
indirectBankFeedPos: 0
fileUploadPos: 2223
manualPos: 0
directBankFeedNeg: 0
indirectBankFeedNeg: 0
fileUploadNeg: -1890
manualNeg: -500
otherPos: 0
otherNeg: 0
other: 100
earliestReconciledTransaction: "2019-03-01"
latestReconciledTransaction: "2020-03-01"
reconciledAmountPos: 0
reconciledAmountNeg: -288
reconciledLines: 3
totalAmountPos: 2245
totalAmountNeg: -1995
currentStatement:
startDate: "2021-03-01"
endDate: "2021-03-01"
startBalance: 0
endBalance: 0
importedDateTimeUtc: "2021-03-09T05:22:14.3Z"
importSourceType: Manual
cashAccount:
unreconciledAmountPos: 1440
unreconciledAmountNeg: -1000
startingBalance: 0
accountBalance: 0
balanceCurrency: NZD
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: 'Invalid BalanceDate: ''2020-01'''
/AccountingActivities/AccountUsage:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.accountingactivity.read
tags:
- Finance
summary: Get account usage
operationId: getAccountingActivityAccountUsage
description: A summary of how each account is being transacted on exposing the level of detail and amounts attributable to manual adjustments.
parameters:
- name: startMonth
x-snake: start_month
in: query
description: "date, yyyy-MM \r\n \r\nIf no parameter is provided, the month 12 months prior to the end month will be used.\r\n \r\nAccount usage for up to 12 months from this date will be returned."
schema:
type: string
example: 2020-09
- name: endMonth
x-snake: end_month
in: query
description: "date, yyyy-MM \r\n \r\nIf no parameter is provided, the current month will be used.\r\n \r\nAccount usage for up to 12 months prior to this date will be returned."
schema:
type: string
example: 2021-09
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/AccountUsageResponse'
example:
organisationId: 73151de8-3676-4887-a021-edec960dd537
startMonth: 2010-03
endMonth: 2010-03
accountUsage:
- month: 2010-03
accountId: 12345678-876b-4eff-901d-e8f4d517453e
currencyCode: CURR/NZD
totalReceived: 0
countReceived: 0
totalPaid: 0
countPaid: 0
totalManualJournal: 0
countManualJournal: 0
accountName: ACME Drawings
reportingCode: ABC
reportingCodeName: ABC funds
- month: 2010-03
accountId: 12345678-9d21-43bc-b20e-d96a370cf31e
currencyCode: CURR/NZD
totalReceived: 0
countReceived: 0
totalPaid: 0
countPaid: 0
totalManualJournal: 0
countManualJournal: 0
accountName: Electricity & Heating
reportingCode: ELC
reportingCodeName: Expense
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation 73151de8-3676-4887-a021-edec960dd537 does not exist
/AccountingActivities/LockHistory:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.accountingactivity.read
tags:
- Finance
operationId: getAccountingActivityLockHistory
description: Provides a history of locking of accounting books. Locking may be an indicator of good accounting practices that could reduce the risk of changes to accounting records in prior periods.
summary: Get lock history
parameters:
- name: endDate
x-snake: end_date
in: query
description: "date, yyyy-MM-dd \r\n \r\nIf no parameter is provided, the current date will be used.\r\n \r\nAny changes to hard or soft lock dates that were made within the period up to 12 months before this date will be returned.\r\n \r\nPlease be aware that there may be a delay of up to 3 days before a change is visible from this API."
schema:
type: string
example: "2021-09-15"
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/LockHistoryResponse'
example:
organisationId: 73151de8-3676-4887-a021-edec960dd537
endDate: "2019-06-20"
lockDates:
- hardLockDate: "2019-01-20"
softLockDate: "2019-01-20"
updatedDateUtc: "2019-01-20T10:50:03Z"
- hardLockDate: "2019-01-21"
softLockDate: "2019-01-21"
updatedDateUtc: "2019-01-21T10:59:33Z"
- hardLockDate: "2019-01-22"
softLockDate: "2019-01-22"
updatedDateUtc: "2019-01-22T10:24:12Z"
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation 73151de8-3676-4887-a021-edec960dd537 does not exist
/AccountingActivities/ReportHistory:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.accountingactivity.read
tags:
- Finance
operationId: getAccountingActivityReportHistory
description: For a specified organisation, provides a summary of all the reports published within a given period, which may be an indicator for good business management and oversight.
summary: Get report history
parameters:
- name: endDate
x-snake: end_date
in: query
description: "date, yyyy-MM-dd \r\n \r\nIf no parameter is provided, the current date will be used.\r\n \r\nAny reports that were published within the period up to 12 months before this date will be returned.\r\n \r\nPlease be aware that there may be a delay of up to 3 days before a published report is visible from this API."
schema:
type: string
example: "2021-09-15"
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ReportHistoryResponse'
example:
organisationId: 73151de8-3676-4887-a021-edec960dd537
endDate: "2019-10-20"
reports:
- reportName: VATReturn
reportDateText: April 2019 to June 2019
publishedDateUtc: "2019-09-23T00:30:17.407+00:00"
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation 73151de8-3676-4887-a021-edec960dd537 does not exist
/AccountingActivities/UserActivities:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.accountingactivity.read
tags:
- Finance
operationId: getAccountingActivityUserActivities
description: For a specified organisation, provides a list of all the users registered, and a history of their accounting transactions. Also identifies the existence of an external accounting advisor and the level of interaction.
summary: Get user activities
parameters:
- name: dataMonth
x-snake: data_month
in: query
description: "date, yyyy-MM \r\n \r\nThe specified month must be complete (in the past); The current month cannot be specified since it is not complete.\r\n \r\nIf no parameter is provided, the month immediately previous to the current month will be used.\r\n \r\nAny user activities occurring within the specified month will be returned.\r\n \r\nPlease be aware that there may be a delay of up to 3 days before a user activity is visible from this API."
schema:
type: string
example: 2021-09
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/UserActivitiesResponse'
example:
organisationId: 73151de8-3676-4887-a021-edec960dd537
dataMonth: 2020-01
users:
- userId: bf3108f9-7449-4b2d-a1d1-41342dc1c991
userCreatedDateUtc: "2016-04-15T04:01:42.8Z"
lastLoginDateUtc: "2020-02-12T23:59:06.42Z"
isExternalPartner: true
hasAccountantRole: true
monthPeriod: 2020-01
numberOfLogins: 0
numberOfDocumentsCreated: 10
netValueDocumentsCreated: -100.99
absoluteValueDocumentsCreated: 100.99
attachedPractices:
- xeroPartnerSince: 2017
tier: Silver
location: New Zealand
organisationCount: 40
staffCertified: true
historyRecords:
- changes: Approved
dateUTCString: 2008-12-19T01:37:59
dateUTC: "2008-12-18T14:37:59.057+00:00"
user: John Doe
details: ""
- changes: Created
dateUTCString: 2008-12-19T01:37:58
dateUTC: "2008-12-18T14:37:58.057+00:00"
user: John Doe
details: ""
- changes: Reconciled
dateUTCString: 2008-12-20T22:50:55
dateUTC: "2008-12-20T11:50:55.09+00:00"
user: John Doe
details: Debit payment to ACME Banking Corporation on 10 October 2008 for -10.00
- changes: Created
dateUTCString: 2008-12-20T16:44:19
dateUTC: "2008-12-20T05:44:19.467+00:00"
user: John Doe
details: ""
"400":
description: BadRequest
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation 73151de8-3676-4887-a021-edec960dd537 does not exist
/FinancialStatements/BalanceSheet:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.statements.read
tags:
- Finance
operationId: getFinancialStatementBalanceSheet
summary: Get Balance Sheet report
description: The balance sheet report is a standard financial report which describes the financial position of an organisation at a point in time.
parameters:
- name: balanceDate
x-snake: balance_date
in: query
description: "Specifies the date for balance sheet report.\r\n\r\nFormat yyyy-MM-dd. If no parameter is provided, the current date will be used."
schema:
type: string
example: "2020-06-30"
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/BalanceSheetResponse'
example:
balanceDate: "2021-05-12"
asset:
accountTypes:
- accountType: INVENTORY
accounts:
- code: "630"
accountID: abcdeabc-80bb-47f5-9418-d1fc2241b838
name: Inventory
reportingCode: ASS.CUR.INY
total: 3
total: 3
- accountType: CURRENT
accounts:
- code: "610"
accountID: abcdeabc-b4d1-45a5-82f7-19deda692a31
name: Accounts Receivable
reportingCode: ASS.CUR.REC.TRA
total: 100
total: 100
- accountType: BANK
accounts:
- accountID: abcdeabc-3a6d-4c53-ba82-ea1c92d02ef4
name: Buz Acc
reportingCode: ASS
total: -42.3
total: -42.3
total: 60.7
liability:
accountTypes:
- accountType: CURRLIAB
accounts:
- code: "820"
accountID: abcdeabc-40f7-49f1-ad89-1930c1366e5b
name: GST
reportingCode: LIA.CUR.TAX.GST
total: 1.59
- code: "860"
accountID: abcdeabc-2877-4c00-be7d-475b1ded30d7
name: Rounding
reportingCode: LIA.CUR
total: -0.1
- code: "800"
accountID: abcdeabc-80ba-4b58-8d72-f8e9ca0f2f00
name: Accounts Payable
reportingCode: LIA.CUR.PAY.TRA
total: 44.4
total: 45.89
total: 45.89
equity:
accountTypes:
- accountType: EQUITY
accounts:
- accountID: 00000000-0000-0000-0000-000000000000
name: Current Year Earnings
total: 14.81
total: 14.81
total: 14.81
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation xxx does not exist
503:
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: service-unavailable
title: ServiceUnavailable
status: 503
detail: Cannot process org xxx at this time. Apologies for inconvenience.
/FinancialStatements/Cashflow:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.statements.read
tags:
- Finance
operationId: getFinancialStatementCashflow
summary: Get Cash flow report
description: The statement of cash flows - direct method, provides the year to date changes in operating, financing and investing cash flow activities for an organisation. Cashflow statement is not available in US region at this stage.
parameters:
- name: startDate
x-snake: start_date
in: query
description: "Date e.g. yyyy-MM-dd\r\n\r\nSpecifies the start date for cash flow report.\r\n\r\nIf no parameter is provided, the date of 12 months before the end date will be used."
schema:
type: string
example: "2020-09-15"
- name: endDate
x-snake: end_date
in: query
description: "Date e.g. yyyy-MM-dd\r\n\r\nSpecifies the end date for cash flow report.\r\n\r\nIf no parameter is provided, the current date will be used."
schema:
type: string
example: "2021-09-15"
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/CashflowResponse'
example:
startDate: "2018-07-01"
endDate: "2019-06-30"
cashBalance:
openingCashBalance: 5000
closingCashBalance: -50000
netCashMovement: -55000
cashflowActivities:
- name: Operating Activities
total: -41000
cashflowTypes:
- name: Receipts from customers
total: 34000
accounts:
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: REVENUE
accountClass: REVENUE
code: "455"
name: Cellar Door - Till Variance
reportingCode: EXP
total: -1000
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: CURRENT
accountClass: ASSET
code: "123"
name: Loan - Darleen's
reportingCode: ASS
total: 35000
- name: Payments to suppliers and employees
total: -75000
accounts:
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: CURRENT
accountClass: ASSET
code: "123"
name: Loan - Darleen's
reportingCode: ASS
total: -75000
- name: Investing Activities
total: -35000
cashflowTypes:
- name: Payment for property, plant and equipment
total: -36000
accounts:
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: FIXED
accountClass: ASSET
code: "138"
name: Motor Vehicles at Cost
reportingCode: ASS
total: -1000
- accountId: abcdefab-5353-9d4b-7cad-51b2c2a2754a
accountType: FIXED
accountClass: ASSET
code: "140"
name: Equipment at cost
reportingCode: ASS
total: -35000
- name: Proceeds from sale of property, plant and equipment
total: 1000
accounts:
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: FIXED
accountClass: ASSET
code: "138"
name: Motor Vehicles at Cost
reportingCode: ASS
total: 1000
- accountId: abcdefab-5353-9d4b-7cad-51b2c2a2754a
accountType: FIXED
accountClass: ASSET
code: "140"
name: Equipment at cost
reportingCode: ASS
total: 0
- name: Financing Activities
total: -14000
cashflowTypes:
- name: Proceeds from borrowings
total: 1000.5
accounts:
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: TERMLIAB
accountClass: LIABILITY
code: "244"
name: Loan - Shellcoll Distribution 2019
reportingCode: LIA.CUR.LOA
total: 1000.5
- name: Repayment of borrowings
total: -15000.5
accounts:
- accountId: abcdefab-4d1e-4d1a-9e4c-68b2c2a278e2
accountType: TERMLIAB
accountClass: LIABILITY
code: "244"
name: Loan - Shellcoll Distribution 2019
reportingCode: LIA.CUR.LOA
total: -15000.5
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation xxx does not exist
503:
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: service-unavailable
title: ServiceUnavailable
status: 503
detail: Cannot process org xxx at this time. Apologies for inconvenience.
/FinancialStatements/ProfitAndLoss:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.statements.read
tags:
- Finance
operationId: getFinancialStatementProfitAndLoss
summary: Get Profit & Loss report
description: The profit and loss statement is a standard financial report providing detailed year to date income and expense detail for an organisation.
parameters:
- name: startDate
x-snake: start_date
in: query
description: "Date e.g. yyyy-MM-dd\r\n\r\nSpecifies the start date for profit and loss report\r\n\r\nIf no parameter is provided, the date of 12 months before the end date will be used."
schema:
type: string
example: "2020-09-15"
- name: endDate
x-snake: end_date
in: query
description: "Date e.g. yyyy-MM-dd\r\n\r\nSpecifies the end date for profit and loss report \r\n\r\nIf no parameter is provided, the current date will be used."
schema:
type: string
example: "2021-09-15"
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ProfitAndLossResponse'
example:
startDate: "2020-07-01"
endDate: "2021-06-30"
netProfitLoss: 123
revenue:
total: 20922.46
accountTypes:
- total: 20825.41
title: Trading Income
accounts:
- accountID: abcdefab-2006-43c2-a5da-3c0e5f43b452
accountType: REVENUE
code: "200"
name: Sales
reportingCode: REV
total: 20825.41
- total: 97.05
title: Other Income
accounts:
- accountID: abcdefab-4d63-4af8-937f-04087ae2e36e
accountType: OTHERINCOME
code: "270"
name: Interest Income
reportingCode: REV.OTH
total: 97.05
expense:
total: 1282.06
accountTypes:
- total: 1137.59
title: Direct Cost
accounts:
- accountID: abcdefab-d381-4bd6-ba47-7af927d25825
accountType: DIRECTCOSTS
code: "300"
name: Purchases
reportingCode: EXP.DC
total: 1137.59
- total: 144.47
title: Operating Expenses
accounts:
- accountID: abcdefab-f897-4168-b5d1-2279bf74bb82
accountType: EXPENSE
code: "453"
name: Office Expenses
reportingCode: EXP
total: 144.47
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation xxx does not exist
/FinancialStatements/TrialBalance:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.statements.read
tags:
- Finance
operationId: getFinancialStatementTrialBalance
summary: Get Trial Balance report
description: The trial balance provides a detailed list of all accounts of an organisation at a point in time, with revenue and expense items being year to date.
parameters:
- name: endDate
x-snake: end_date
in: query
description: "Date e.g. yyyy-MM-dd \r\n\r\nSpecifies the end date for trial balance report \r\n\r\nIf no parameter is provided, the current date will be used."
schema:
type: string
example: "2021-09-15"
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/TrialBalanceResponse'
example:
startDate: "2020-07-01"
endDate: "2021-06-30"
accounts:
- accountId: abcdefab-3bbf-4f2a-9e4c-20ec7b8e6b41
accountType: ASSET
accountCode: ASS
accountClass: BANK
status: ACTIVE
reportingCode: ASS
accountName: Everyday transactions
balance:
value: 100
entryType: DEBIT
signedBalance: -23
accountMovement:
debits: 0
credits: 0
movement:
value: 123
entryType: CREDIT
signedMovement: 0
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation xxx does not exist
/FinancialStatements/contacts/revenue:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.statements.read
tags:
- Finance
operationId: getFinancialStatementContactsRevenue
summary: Get revenue by contacts report
description: The revenue by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information.
parameters:
- name: contactIds
x-snake: contact_ids
in: query
description: "Specifies the customer contacts to be included in the report.\r\n\r\nIf no parameter is provided, all customer contacts will be included"
schema:
type: array
example:
- 00000000-0000-0000-0000-000000000000
- 00000000-0000-0000-0000-000000000000
items:
type: string
format: uuid
- name: includeManualJournals
x-snake: include_manual_journals
in: query
description: "Specifies whether to include the manual journals in the report.\r\n \r\nIf no parameter is provided, manual journals will not be included."
example: true
x-example-python: "True"
schema:
type: boolean
- name: startDate
x-snake: start_date
in: query
description: "Date yyyy-MM-dd\r\n\r\nSpecifies the start date for the report.\r\n \r\nIf no parameter is provided, the date of 12 months before the end date will be used.\r\n \r\nIt is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency."
example: "2020-09-15"
schema:
type: string
- name: endDate
x-snake: end_date
in: query
description: "Date yyyy-MM-dd\r\n\r\nSpecifies the end date for the report.\r\n\r\nIf no parameter is provided, the current date will be used.\r\n \r\nIt is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency."
example: "2020-09-15"
schema:
type: string
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/IncomeByContactResponse'
example:
startDate: "2019-10-17"
endDate: "2020-10-16"
total: 1200
totalDetail:
totalPaid: 400
totalOutstanding: 1000
totalCreditedUnApplied: 200
totalOther:
totalOutstandingAged: 1000
totalVoided: 150
totalCredited: 10
contacts:
- id: 1f580fe2-0659-31ee-eeb4-5c49d15d8bfa
name: FirstContact
total: 1400
totalDetail:
totalPaid: 400
totalOutstanding: 1000
totalCreditedUnApplied: 0
totalOther:
totalOutstandingAged: 1000
totalVoided: 150
totalCredited: 0
transactionCount: 3
accountCodes:
- "090"
- "200"
- 09-BANK
- id: 20e94281-4751-fb7e-ee5e-96b43ae93c8a
name: SecondContact
total: -200
totalDetail:
totalPaid: 10
totalOutstanding: 20
totalCreditedUnApplied: 200
totalOther:
totalOutstandingAged: 2
totalVoided: 3
totalCredited: 4
transactionCount: 1
accountCodes:
- "900"
manualJournals:
total: -100
"400":
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'
example:
type: invalid-request
title: InvalidRequest
status: 400
detail: Organisation xxx does not exist
/FinancialStatements/contacts/expense:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- finance.statements.read
tags:
- Finance
operationId: getFinancialStatementContactsExpense
summary: Get expense by contacts report
description: The expense by contact report provides a year to date profit and loss for customers and suppliers for a given organisation, including detailed contact information.
parameters:
- name: contactIds
x-snake: contact_ids
in: query
description: "Specifies the customer contacts to be included in the report.\r\n\r\nIf no parameter is provided, all customer contacts will be included"
schema:
type: array
example:
- 00000000-0000-0000-0000-000000000000
- 00000000-0000-0000-0000-000000000000
items:
type: string
format: uuid
- name: includeManualJournals
x-snake: include_manual_journals
in: query
description: "Specifies whether to include the manual journals in the report.\r\n \r\nIf no parameter is provided, manual journals will not be included."
example: true
x-example-python: "True"
schema:
type: boolean
- name: startDate
x-snake: start_date
in: query
description: "Date yyyy-MM-dd\r\n\r\nSpecifies the start date for the report.\r\n \r\nIf no parameter is provided, the date of 12 months before the end date will be used.\r\n \r\nIt is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency."
example: "2020-09-15"
schema:
type: string
- name: endDate
x-snake: end_date
in: query
description: "Date yyyy-MM-dd\r\n\r\nSpecifies the end date for the report.\r\n\r\nIf no parameter is provided, the current date will be used.\r\n \r\nIt is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency."
example: "2020-09-15"
schema:
type: string
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/IncomeByContactResponse'
example:
startDate: "2019-10-17"
endDate: "2020-10-16"
total: 1200
totalDetail:
totalPaid: 400
totalOutstanding: 1000
totalCreditedUnApplied: 200
totalOther:
totalOutstandingAged: 1000
totalVoided: 150
totalCredited: 10
contacts:
- id: 1f580fe2-0659-31ee-eeb4-5c49d15d8bfa
name: FirstContact
total: 1400
totalDetail:
totalPaid: 400
totalOutstanding: 1000
totalCreditedUnApplied: 0
totalOther:
totalOutstandingAged: 1000
totalVoided: 150
totalCredited: 0
transactionCount: 3
accountCodes:
- "090"
- "200"
- 09-BANK
- id: 20e94281-4751-fb7e-ee5e-96b43ae93c8a
name: SecondContact
total: -200
totalDetail:
totalPaid: 0
totalOutstanding: 0
totalCreditedUnApplied: 200
totalOther:
totalOutstandingAged: 2
totalVoided: 3
totalCredited: 4
transactionCount: 1
accountCodes:
- "900"
manualJournals:
total: -100
"400":
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Problem'