-
Notifications
You must be signed in to change notification settings - Fork 125
/
xero_accounting.yaml
25375 lines (25375 loc) · 897 KB
/
xero_accounting.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Xero Accounting API
version: 6.3.0
termsOfService: https://developer.xero.com/xero-developer-platform-terms-conditions/
contact:
name: Xero Platform Team
email: [email protected]
url: https://developer.xero.com
servers:
- description: The Xero Accounting API exposes accounting and related functions of the main Xero application and can be used for a variety of purposes such as creating transactions like invoices and credit notes, right through to extracting accounting data via our reports endpoint.
url: https://api.xero.com/api.xro/2.0
paths:
/Accounts:
parameters:
- $ref: '#/components/parameters/requiredHeader'
type: string
get:
security:
- OAuth2:
- accounting.settings
- accounting.settings.read
tags:
- Accounting
operationId: getAccounts
summary: Retrieves the full chart of accounts
parameters:
- $ref: '#/components/parameters/ifModifiedSince'
- in: query
name: where
description: Filter by an any element
example: Status=="ACTIVE" AND Type=="BANK"
x-example-csharp: Status==\"ACTIVE\"
x-example-java: Status=="' + Account.StatusEnum.ACTIVE+ '"
x-example-php: Status=="' . \XeroAPI\XeroPHP\Models\Accounting\Account::STATUS_ACTIVE . '"
x-example-ruby: Status==#{XeroRuby::Accounting::Account::ACTIVE}
schema:
type: string
- in: query
name: order
description: Order by an any element
example: Name ASC
schema:
type: string
responses:
"200":
description: Success - return response of type Accounts array with 0 to n Account
content:
application/json:
schema:
$ref: '#/components/schemas/Accounts'
example:
Accounts:
- AccountID: ebd06280-af70-4bed-97c6-7451a454ad85
Code: "091"
Name: Business Savings Account
Type: BANK
TaxType: NONE
EnablePaymentsToAccount: false
BankAccountNumber: "0209087654321050"
BankAccountType: BANK
CurrencyCode: NZD
- AccountID: 7d05a53d-613d-4eb2-a2fc-dcb6adb80b80
Code: "200"
Name: Sales
Type: REVENUE
TaxType: OUTPUT2
Description: Income from any normal business activity
EnablePaymentsToAccount: false
put:
security:
- OAuth2:
- accounting.settings
tags:
- Accounting
operationId: createAccount
summary: Creates a new chart of accounts
parameters:
- $ref: '#/components/parameters/idempotencyKey'
x-hasAccountingValidationError: true
x-example:
- object:
is_object: true
key: account
keyPascal: Account
- code:
key: code
keyPascal: Code
default: 123456
object: account
- name:
key: name
keyPascal: Name
default: FooBar
object: account
- type:
key: type
keyPascal: Type
default: EXPENSE
nonString: true
php: XeroAPI\XeroPHP\Models\Accounting\AccountType::EXPENSE
node: AccountType.EXPENSE
ruby: XeroRuby::Accounting::AccountType::EXPENSE
python: AccountType.EXPENSE
java: com.xero.models.accounting.AccountType.EXPENSE
csharp: AccountType.EXPENSE
object: account
- description:
is_last: true
key: description
keyPascal: Description
default: Hello World
object: account
responses:
"200":
description: Success - created new Account and return response of type Accounts array with new Account
content:
application/json:
schema:
$ref: '#/components/schemas/Accounts'
example:
Id: 11814c9d-3b5e-492e-93b0-fad16bf3244f
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550793549392)/
Accounts:
- AccountID: 66b262e2-561e-423e-8937-47d558f13442
Code: "123456"
Name: Foobar
Status: ACTIVE
Type: EXPENSE
TaxType: INPUT
Description: Hello World
Class: EXPENSE
EnablePaymentsToAccount: false
ShowInExpenseClaims: false
ReportingCode: EXP
ReportingCodeName: Expense
UpdatedDateUTC: /Date(1550793549320+0000)/
"400":
description: Validation Error - some data was incorrect returns response of type Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
ErrorNumber: 10
Type: ValidationException
Message: A validation exception occurred
Elements:
- AccountID: 00000000-0000-0000-0000-000000000000
Code: "123456"
Name: Foobar
Type: EXPENSE
Description: Hello World
ValidationErrors:
- Message: Please enter a unique Name.
requestBody:
required: true
description: Account object in body of request
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
example:
Code: "123456"
Name: Foobar
Type: EXPENSE
Description: Hello World
/Accounts/{AccountID}:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- accounting.settings
- accounting.settings.read
tags:
- Accounting
operationId: getAccount
summary: Retrieves a single chart of accounts by using a unique account Id
parameters:
- $ref: '#/components/parameters/AccountID'
responses:
"200":
description: Success - return response of type Accounts array with one Account
content:
application/json:
schema:
$ref: '#/components/schemas/Accounts'
example:
Id: 323455cc-9511-4451-a873-248d2983f38e
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550797359081)/
Accounts:
- AccountID: 99ce6032-0678-4aa0-8148-240c75fee33a
Code: "123456"
Name: FooBar
Status: ACTIVE
Type: EXPENSE
TaxType: INPUT
Description: Hello World
Class: EXPENSE
EnablePaymentsToAccount: false
ShowInExpenseClaims: false
ReportingCode: EXP
ReportingCodeName: Expense
UpdatedDateUTC: /Date(1550797359120+0000)/
post:
security:
- OAuth2:
- accounting.settings
tags:
- Accounting
operationId: updateAccount
summary: Updates a chart of accounts
x-hasAccountingValidationError: true
x-example:
- account:
is_object: true
key: account
keyPascal: Account
- code:
key: code
keyPascal: Code
default: 123456
object: account
- name:
key: name
keyPascal: Name
default: BarFoo
object: account
- type:
key: type
keyPascal: Type
default: EXPENSE
nonString: true
php: XeroAPI\XeroPHP\Models\Accounting\AccountType::EXPENSE
node: AccountType.EXPENSE
ruby: XeroRuby::Accounting::AccountType::EXPENSE
python: AccountType.EXPENSE
java: com.xero.models.accounting.AccountType.EXPENSE
csharp: AccountType.EXPENSE
object: account
- description:
key: description
keyPascal: Description
default: Hello World
object: account
- taxType:
is_last: true
key: taxType
keyPascal: TaxType
keySnake: tax_type
default: NONE
object: account
- accounts:
is_object: true
key: accounts
keyPascal: Accounts
- accounts:
is_last: true
is_array_add: true
key: accounts
keyPascal: Accounts
java: Accounts
csharp: Account
object: account
parameters:
- $ref: '#/components/parameters/AccountID'
- $ref: '#/components/parameters/idempotencyKey'
responses:
"200":
description: Success - update existing Account and return response of type Accounts array with updated Account
content:
application/json:
schema:
$ref: '#/components/schemas/Accounts'
example:
Id: 9012e75c-ec08-40a9-ae15-153fc1f35c4d
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550795389340)/
Accounts:
- AccountID: 99ce6032-0678-4aa0-8148-240c75fee33a
Code: "654321"
Name: BarFoo
Status: ACTIVE
Type: EXPENSE
TaxType: INPUT
Description: Good Bye World
Class: EXPENSE
EnablePaymentsToAccount: false
ShowInExpenseClaims: false
ReportingCode: EXP
ReportingCodeName: Expense
UpdatedDateUTC: /Date(1550795389333+0000)/
"400":
description: Validation Error - some data was incorrect returns response of type Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
ErrorNumber: 10
Type: ValidationException
Message: A validation exception occurred
Elements:
- AccountID: 00000000-0000-0000-0000-000000000000
Code: "123456"
Name: Foobar
Type: EXPENSE
Description: Hello World
ValidationErrors:
- Message: Please enter a unique Name.
requestBody:
required: true
description: Request of type Accounts array with one Account
content:
application/json:
schema:
$ref: '#/components/schemas/Accounts'
example:
Accounts:
- Code: "123456"
Name: BarFoo
AccountID: 99ce6032-0678-4aa0-8148-240c75fee33a
Type: EXPENSE
Description: GoodBye World
TaxType: INPUT
EnablePaymentsToAccount: false
ShowInExpenseClaims: false
Class: EXPENSE
ReportingCode: EXP
ReportingCodeName: Expense
UpdatedDateUTC: "2019-02-21T16:29:47.96-08:00"
delete:
security:
- OAuth2:
- accounting.settings
tags:
- Accounting
operationId: deleteAccount
x-hasAccountingValidationError: true
summary: Deletes a chart of accounts
parameters:
- $ref: '#/components/parameters/AccountID'
responses:
"200":
description: Success - delete existing Account and return response of type Accounts array with deleted Account
content:
application/json:
schema:
$ref: '#/components/schemas/Accounts'
example:
Id: 76bb0543-8efe-4acc-b7f6-67dfcdec37b4
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550798217216)/
Accounts:
- AccountID: 7f3c0bec-f3e7-4073-b4d6-cc56dd027ef1
Code: "123456"
Name: FooBar
Status: DELETED
Type: EXPENSE
TaxType: INPUT
Description: Hello World
Class: EXPENSE
EnablePaymentsToAccount: false
ShowInExpenseClaims: false
ReportingCode: EXP
ReportingCodeName: Expense
UpdatedDateUTC: /Date(1550798217210+0000)/
"400":
description: Validation Error - some data was incorrect returns response of type Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
ErrorNumber: 10
Type: ValidationException
Message: A validation exception occurred
Elements:
- AccountID: 00000000-0000-0000-0000-000000000000
Code: "123456"
Name: Foobar
Type: EXPENSE
Description: Hello World
ValidationErrors:
- Message: Please enter a unique Name.
/Accounts/{AccountID}/Attachments:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- accounting.attachments
- accounting.attachments.read
tags:
- Accounting
operationId: getAccountAttachments
summary: Retrieves attachments for a specific accounts by using a unique account Id
parameters:
- $ref: '#/components/parameters/AccountID'
responses:
"200":
description: Success - return response of type Attachments array of Attachment
x-isAttachment: true
content:
application/json:
schema:
$ref: '#/components/schemas/Attachments'
example:
Id: 439c1573-3cd8-4697-a9f6-81fa651ee8f3
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550852630329)/
Attachments:
- AttachmentID: 52a643be-cd5c-489f-9778-53a9fd337756
FileName: sample5.jpg
Url: https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg
MimeType: image/jpg
ContentLength: 2878711
/Accounts/{AccountID}/Attachments/{AttachmentID}:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- accounting.attachments
- accounting.attachments.read
tags:
- Accounting
operationId: getAccountAttachmentById
summary: Retrieves a specific attachment from a specific account using a unique attachment Id
parameters:
- $ref: '#/components/parameters/AccountID'
- $ref: '#/components/parameters/AttachmentID'
- $ref: '#/components/parameters/ContentType'
responses:
"200":
description: Success - return response of attachment for Account as binary data
content:
application/octet-stream:
schema:
type: string
format: binary
/Accounts/{AccountID}/Attachments/{FileName}:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- accounting.attachments
- accounting.attachments.read
tags:
- Accounting
operationId: getAccountAttachmentByFileName
summary: Retrieves an attachment for a specific account by filename
parameters:
- $ref: '#/components/parameters/AccountID'
- $ref: '#/components/parameters/FileName'
- $ref: '#/components/parameters/ContentType'
responses:
"200":
description: Success - return response of attachment for Account as binary data
content:
application/octet-stream:
schema:
type: string
format: binary
post:
security:
- OAuth2:
- accounting.attachments
tags:
- Accounting
operationId: updateAccountAttachmentByFileName
x-hasAccountingValidationError: true
summary: Updates attachment on a specific account by filename
parameters:
- $ref: '#/components/parameters/AccountID'
- $ref: '#/components/parameters/FileName'
- $ref: '#/components/parameters/idempotencyKey'
responses:
"200":
description: Success - return response of type Attachments array of Attachment
x-isAttachment: true
content:
application/json:
schema:
$ref: '#/components/schemas/Attachments'
example:
Id: c8d6413a-1da2-4faa-9848-21f60443e906
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550859714477)/
Attachments:
- AttachmentID: 3fa85f64-5717-4562-b3fc-2c963f66afa6
FileName: sample5.jpg
Url: https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg
MimeType: image/jpg
ContentLength: 2878711
"400":
description: Validation Error - some data was incorrect returns response of type Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
requestBody:
required: true
description: Byte array of file in body of request
content:
application/octet-stream:
schema:
type: string
format: binary
put:
security:
- OAuth2:
- accounting.attachments
tags:
- Accounting
operationId: createAccountAttachmentByFileName
x-hasAccountingValidationError: true
summary: Creates an attachment on a specific account
parameters:
- $ref: '#/components/parameters/AccountID'
- $ref: '#/components/parameters/FileName'
- $ref: '#/components/parameters/idempotencyKey'
responses:
"200":
description: Success - return response of type Attachments array of Attachment
x-isAttachment: true
content:
application/json:
schema:
$ref: '#/components/schemas/Attachments'
example:
Id: 724cdff5-bcd1-4c5c-977e-e864c24258e0
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550856817769)/
Attachments:
- AttachmentID: ab95b276-9dce-4925-9077-439818ba270f
FileName: sample5.jpg
Url: https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg
MimeType: image/jpg
ContentLength: 2878711
"400":
$ref: '#/components/responses/400Error'
requestBody:
required: true
description: Byte array of file in body of request
content:
application/octet-stream:
schema:
type: string
format: binary
/BatchPayments:
parameters:
- $ref: '#/components/parameters/requiredHeader'
description: Batch payments allow you to bundle multiple bills or invoices into one payment transaction. This means a single payment in Xero can be reconciled with a single transaction on the bank statement making for a much simpler bank reconciliation experience.
get:
security:
- OAuth2:
- accounting.transactions
- accounting.transactions.read
tags:
- Accounting
operationId: getBatchPayments
summary: Retrieves either one or many batch payments for invoices
parameters:
- $ref: '#/components/parameters/ifModifiedSince'
- in: query
name: where
description: Filter by an any element
example: Status=="AUTHORISED"
x-example-csharp: Status==\"AUTHORISED\"
x-example-java: Status=="' + BatchPayment.StatusEnum.AUTHORISED + '"
x-example-php: Status=="' . XeroAPI\XeroPHP\Models\Accounting\BatchPayment::STATUS_AUTHORISED . '"
x-example-ruby: Status==#{XeroRuby::Accounting::BatchPayment::AUTHORISED}
schema:
type: string
- in: query
name: order
description: Order by an any element
example: Date ASC
schema:
type: string
responses:
"200":
description: Success - return response of type BatchPayments array of BatchPayment objects
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPayments'
example:
Id: 6ab84949-4fe5-4788-a135-4d8f690d24d7
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550866184006)/
BatchPayments:
- Account:
AccountID: 6f7594f2-f059-4d56-9e67-47ac9733bfe9
Reference: Hello World
BatchPaymentID: d0e9bbbf-5b8a-48b6-906a-035591fcb061
DateString: 2017-11-28T00:00:00
Date: /Date(1511827200000+0000)/
Payments:
- Invoice:
InvoiceID: 0975dec2-0cf6-498d-9c9f-c6775b45c61d
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: 97ec2ef8-f4d6-4de5-9f2a-385d41cdc2fc
Amount: 200.00
- Invoice:
InvoiceID: 600982d9-6605-4e11-afa1-d8dec2be7b52
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: e232795f-b919-4865-a754-12f6ae8402c0
Amount: 200.00
- Invoice:
InvoiceID: 99a2bd54-4ab1-413c-90bb-57f6464fe5d6
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: c2d571a5-38ff-4d37-9d43-dfadb4ad53ff
Amount: 200.00
- Invoice:
InvoiceID: c81942c8-bfc5-4c88-a21a-b892a4a8c1c5
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: 0f3c18dc-49bd-47a4-a875-03c84a29978f
Amount: 200.00
- Invoice:
InvoiceID: 6c9a1d89-8319-42f6-87d6-7690e748af85
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: 43541eed-f3ac-44ac-88cb-9fe1cb7ed8b8
Amount: 200.00
Type: RECBATCH
Status: AUTHORISED
TotalAmount: 1000.00
UpdatedDateUTC: /Date(1511893792820+0000)/
IsReconciled: false
put:
security:
- OAuth2:
- accounting.transactions
tags:
- Accounting
operationId: createBatchPayment
summary: Creates one or many batch payments for invoices
x-hasAccountingValidationError: true
x-example:
- currDate:
is_date: true
key: currDate
keyPascal: CurrDate
keySnake: curr_date
java_datatype: LocalDate
default: LocalDate.now()
java: LocalDate.now()
csharp: DateTime.Now
node: '''2020-12-10'''
php: new DateTime('2020-12-10')
python: dateutil.parser.parse('2020-12-03T00:00:00Z')
ruby: '''YYYY-MM-DD'''
- paymentAccount:
is_object: true
key: paymentAccount
keyPascal: Account
keySnake: payment_account
- accountID:
is_last: true
is_uuid: true
key: accountID
keyPascal: AccountID
keySnake: account_id
default: 00000000-0000-0000-0000-000000000000
object: paymentAccount
- bankAccount:
is_object: true
key: bankAccount
keyPascal: Account
keySnake: bank_account
- accountID:
is_last: true
is_uuid: true
key: accountID
keyPascal: AccountID
keySnake: account_id
default: 00000000-0000-0000-0000-000000000000
object: bankAccount
- invoice:
is_object: true
key: invoice
keyPascal: Invoice
- invoiceID:
is_last: true
is_uuid: true
key: invoiceID
keyPascal: InvoiceID
keySnake: invoice_id
default: 00000000-0000-0000-0000-000000000000
object: invoice
- payment:
is_object: true
key: payment
keyPascal: Payment
- set_bankaccount:
is_variable: true
nonString: true
key: account
keyPascal: Account
default: bankAccount
python: bank_account
ruby: bank_account
object: payment
- date:
is_variable: true
nonString: true
key: date
keyPascal: Date
default: currDate
python: curr_date
ruby: curr_date
object: payment
- amount:
nonString: true
key: amount
keyPascal: Amount
default: 1.00
is_money: true
object: payment
- set_invoice:
is_last: true
is_variable: true
nonString: true
key: invoice
keyPascal: Invoice
default: invoice
object: payment
- payments:
is_list: true
key: payments
keyPascal: Payment
- add_payments:
is_last: true
is_list_add: true
key: payments
keyPascal: Payments
object: payment
- batchPayment:
is_object: true
key: batchPayment
keyPascal: BatchPayment
keySnake: batch_payment
- set_paymentaccount:
is_variable: true
nonString: true
key: account
keyPascal: Account
default: paymentAccount
python: payment_account
ruby: payment_account
object: batchPayment
- reference:
key: reference
keyPascal: Reference
default: hello foobar
object: batchPayment
- date:
is_variable: true
nonString: true
key: date
keyPascal: Date
default: currDate
python: curr_date
ruby: curr_date
object: batchPayment
- set_payments:
is_last: true
is_variable: true
nonString: true
key: payments
keyPascal: Payments
default: payments
object: batchPayment
- batchPayments:
is_object: true
key: batchPayments
keyPascal: BatchPayments
- add_batchPayments:
is_last: true
is_array_add: true
key: batchPayments
keyPascal: BatchPayments
keySnake: batch_payments
java: BatchPayments
python: batch_payment
ruby: batch_payment
csharp: BatchPayment
object: batchPayment
parameters:
- $ref: '#/components/parameters/summarizeErrors'
- $ref: '#/components/parameters/idempotencyKey'
responses:
"200":
description: Success - return response of type BatchPayments array of BatchPayment objects
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPayments'
example:
Id: 424745ed-6356-46ad-87d4-3585f9062fb4
Status: OK
ProviderName: Xero API Partner
DateTimeUTC: /Date(1550865988111)/
BatchPayments:
- Account:
AccountID: 5ec2f302-cd60-4f8b-a915-9229dd45e6fa
Reference: Foobar123
BatchPaymentID: d318c343-208e-49fe-b04a-45642349bcf1
DateString: 2019-02-22T00:00:00
Date: /Date(1550793600000+0000)/
Payments:
- Invoice:
InvoiceID: 3323652c-155e-433b-8a73-4dde7cfbf410
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: c05098fa-ae3c-4f00-80ec-0a9df07dedff
Amount: 1.00
- Invoice:
InvoiceID: e4abafb4-1f5b-4d9f-80b3-9a7b815bc302
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: 96409489-2f7d-4804-9a6d-6b939b0e038a
Amount: 1.00
- Invoice:
InvoiceID: e6039672-b161-40cd-b07b-a0178e7186ad
Payments: []
CreditNotes: []
Prepayments: []
Overpayments: []
HasErrors: false
IsDiscounted: false
LineItems: []
PaymentID: d2796067-bf71-4f06-b386-81f1454fa866
Amount: 1.00
Type: RECBATCH
Status: AUTHORISED
TotalAmount: 3.00
UpdatedDateUTC: /Date(1550865987783+0000)/
IsReconciled: false
"400":
$ref: '#/components/responses/400Error'
requestBody:
required: true
description: BatchPayments with an array of Payments in body of request
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPayments'
example:
BatchPayments:
- Account:
AccountID: 00000000-0000-0000-0000-000000000000
Reference: ref
Date: "2018-08-01"
Payments:
- Account:
Code: "001"
Date: "2019-12-31"
Amount: 500
Invoice:
InvoiceID: 00000000-0000-0000-0000-000000000000
LineItems: []
Contact: {}
Type: ACCPAY
post:
security:
- OAuth2:
- accounting.transactions
tags:
- Accounting
operationId: deleteBatchPayment
summary: Updates a specific batch payment for invoices and credit notes
parameters:
- $ref: '#/components/parameters/idempotencyKey'
x-hasAccountingValidationError: true
x-example:
- batchPaymentDelete:
is_object: true
key: batchPaymentDelete
keyPascal: BatchPaymentDelete
- status:
is_last: true
key: status
keyPascal: Status
default: DELETED
object: batchPaymentDelete
- batchPaymentID:
is_last: true
is_uuid: true
key: batchPaymentID
keyPascal: BatchPaymentID
keySnake: batch_payment_id
default: 00000000-0000-0000-0000-000000000000
object: batchPaymentDelete
responses:
"200":
description: Success - return response of type BatchPayments array for updated BatchPayment
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPayments'
example:
Id: ee23328c-4a8b-4ee7-8fb6-9796ffab9cb0
Status: OK
ProviderName: provider-name
DateTimeUTC: /Date(1583945852489)/
BatchPayments:
- Account:
AccountID: efb6e3a4-3156-4cee-bfe1-a282a3cc1d8f
BatchPaymentID: b649632e-2782-4c74-95a5-d994d7140ed9
DateString: 2022-08-01T00:00:00
Date: /Date(1659312000000+0000)/
Payments: []
Type: PAYBATCH
Status: DELETED
TotalAmount: 18.00
UpdatedDateUTC: /Date(1659377631813+0000)/
IsReconciled: false
"400":
$ref: '#/components/responses/400Error'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchPaymentDelete'
example:
BatchPaymentID: 9bf296e9-0748-4d29-a3dc-24dde1098030
Status: DELETED
/BatchPayments/{BatchPaymentID}:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2:
- accounting.transactions
- accounting.transactions.read
tags:
- Accounting
operationId: getBatchPayment
summary: Retrieves a specific batch payment using a unique batch payment Id
parameters:
- $ref: '#/components/parameters/BatchPaymentID'
responses:
"200":
description: Success - return response of type BatchPayments array with matching batch payment Id
content: