forked from XeroAPI/Xero-OpenAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xero_assets.yaml
1032 lines (1029 loc) · 40.5 KB
/
xero_assets.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: "2.40.3"
title: Xero Assets API
description: The Assets API exposes fixed asset related functions of the Xero Accounting application and can be used for a variety of purposes such as creating assets, retrieving asset valuations etc.
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/assets.xro/1.0
paths:
/Assets:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2: [assets, assets.read]
tags:
- Asset
summary: searches fixed asset
operationId: getAssets
description: By passing in the appropriate options, you can search for
available fixed asset in the system
parameters:
- name: status
in: query
description: Required when retrieving a collection of assets. See Asset Status Codes
schema:
$ref: '#/components/schemas/AssetStatusQueryParam'
required: true
- name: page
in: query
description: Results are paged. This specifies which page of the results to return. The default page is 1.
schema:
type: integer
example: 1
- name: pageSize
x-snake: page_size
in: query
description: The number of records returned per page. By default the number of records returned is 10.
schema:
type: integer
example: 5
- name: orderBy
x-snake: order_by
in: query
description: Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
schema:
type: string
enum:
- AssetType
- AssetName
- AssetNumber
- PurchaseDate
- PurchasePrice
- DisposalDate
- DisposalPrice
example: AssetName
- name: sortDirection
x-snake: sort_direction
in: query
description: ASC or DESC
schema:
type: string
enum:
- asc
- desc
example: ASC
- name: filterBy
x-snake: filter_by
in: query
description: A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.
schema:
type: string
example: "Company Car"
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/Assets'
example: '{
"pagination":{
"page":1,
"pageSize":10,
"pageCount":2,
"itemCount":11,
"links":{
"first":{
"href":"http://asset.favorit.xero.com/v1/assets?status=DRAFT&page=1"
},
"next":{
"href":"http://asset.favorit.xero.com/v1/assets?status=DRAFT&page=2"
},
"last":{
"href":"http://asset.favorit.xero.com/v1/assets?status=DRAFT&page=2"
}
}
},
"items":[
{
"assetId":"68f17094-af97-4f1b-b36b-013b45b6ad3c",
"assetName":"Computer47822",
"assetNumber":"123478074",
"purchaseDate":"2020-01-01T00:00:00",
"purchasePrice":100.0000,
"disposalPrice":0.0,
"assetStatus":"Draft",
"trackingItems":[
],
"bookDepreciationSetting":{
"depreciableObjectId":"68f17094-af97-4f1b-b36b-013b45b6ad3c",
"depreciableObjectType":"Asset",
"bookEffectiveDateOfChangeId":"5da77739-7f22-4109-b0a0-67480fb89af0",
"depreciationMethod":"StraightLine",
"averagingMethod":"ActualDays",
"depreciationRate":0.50,
"depreciationCalculationMethod":"None"
},
"bookDepreciationDetail":{
"depreciationStartDate":"2020-01-02T00:00:00",
"priorAccumDepreciationAmount":0.000000,
"currentAccumDepreciationAmount":0.000000,
"currentCapitalGain":0.000000,
"currentGainLoss":0.000000
},
"taxDepreciationSettings":[
],
"taxDepreciationDetails":[
],
"canRollback":true,
"accountingBookValue":100.000000,
"taxValues":[
],
"isDeleteEnabledForDate":false
},
{
"assetId":"52ea3adf-f04a-4577-8fd2-43c52a256bd5",
"assetName":"Computer4148",
"assetNumber":"123466620",
"purchaseDate":"2020-01-01T00:00:00",
"purchasePrice":100.0000,
"disposalPrice":0.0,
"assetStatus":"Draft",
"trackingItems":[
],
"bookDepreciationSetting":{
"depreciableObjectId":"52ea3adf-f04a-4577-8fd2-43c52a256bd5",
"depreciableObjectType":"Asset",
"bookEffectiveDateOfChangeId":"c0d5280f-28b6-4329-b5b7-36e08c662010",
"depreciationMethod":"StraightLine",
"averagingMethod":"ActualDays",
"depreciationRate":0.50,
"depreciationCalculationMethod":"None"
},
"bookDepreciationDetail":{
"depreciationStartDate":"2020-01-02T00:00:00",
"priorAccumDepreciationAmount":0.000000,
"currentAccumDepreciationAmount":0.000000,
"currentCapitalGain":0.000000,
"currentGainLoss":0.000000
},
"taxDepreciationSettings":[
],
"taxDepreciationDetails":[
],
"canRollback":true,
"accountingBookValue":100.000000,
"taxValues":[
],
"isDeleteEnabledForDate":false
}
]
}'
'400':
description: bad input parameter
post:
security:
- OAuth2: [assets]
tags:
- Asset
summary: adds a fixed asset
parameters:
- $ref: '#/components/parameters/idempotencyKey'
operationId: createAsset
x-hasAssetsValidationError: true
x-example:
- asset:
is_object: true
key: asset
keyPascal: Asset
- assetName:
key: assetname
keyPascal: assetName
keySnake: asset_name
csharp: AssetName
default: "Other Computer"
object: asset
- assetNumber:
key: assetnumber
keyPascal: assetNumber
keySnake: asset_number
csharp: AssetNumber
default: FA-00210
object: asset
- status:
is_last: true
nonString: true
key: status
keyPascal: Status
default: Draft
php: XeroAPI\XeroPHP\Models\Asset\AssetStatus::Draft
node: Asset.StatusEnum.DRAFT
ruby: XeroRuby::Asset::AssetStatus::DRAFT
python_string: DRAFT
java: com.xero.models.assets.AssetStatus.DRAFT
csharp: AssetStatus.Draft
object: asset
description: Adds an asset to the system
responses:
'200':
description: return single object - create new asset
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
example: '{
"assetId":"2257c64a-77ca-444c-a5ea-fa9a588c7039",
"assetName":"Computer74863",
"assetNumber":"123477544",
"purchaseDate":"2020-01-01T00:00:00",
"purchasePrice":100.0000,
"disposalPrice":23.2300,
"assetStatus":"Draft",
"trackingItems":[],
"bookDepreciationSetting":{
"depreciableObjectId":"2257c64a-77ca-444c-a5ea-fa9a588c7039",
"depreciableObjectType":"Asset",
"bookEffectiveDateOfChangeId":"b58a2ace-1213-4681-9f11-2e30f57b5b8c",
"depreciationMethod":"StraightLine",
"averagingMethod":"ActualDays",
"depreciationRate":0.50,
"depreciationCalculationMethod":"None"
},
"bookDepreciationDetail":{
"depreciationStartDate":"2020-01-02T00:00:00",
"priorAccumDepreciationAmount":0.000000,
"currentAccumDepreciationAmount":0.000000,
"currentCapitalGain":0.000000,
"currentGainLoss":0.000000
},
"taxDepreciationSettings":[
],
"taxDepreciationDetails":[],
"canRollback":true,
"accountingBookValue":76.770000,
"taxValues":[],
"isDeleteEnabledForDate":true
}'
'400':
description: 'invalid input, object invalid'
content:
application/json:
example: '{
"resourceValidationErrors":[ ],
"fieldValidationErrors":[
{
"fieldName":"BookDepreciationSetting.DepreciationRate",
"valueProvided":"",
"localisedMessage":"Can''t have both Depreciation Rate and Effective Life",
"type":"http://common.service.xero.com/errors/validation/field",
"title":"Validation Error",
"detail":"Can''t have both Depreciation Rate and Effective Life"
}
],
"type":"http://common.service.xero.com/errors/validation",
"title":"The resource update failed validation.",
"detail":"Validation Errors"
}'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
example: '{
"assetName":"Computer74863",
"assetNumber":"123477544",
"purchaseDate":"2020-01-01",
"purchasePrice":100.0,
"disposalPrice":23.23,
"assetStatus":"Draft",
"bookDepreciationSetting":{
"depreciationMethod":"StraightLine",
"averagingMethod":"ActualDays",
"depreciationRate":0.5,
"depreciationCalculationMethod":"None"
},
"bookDepreciationDetail":{
"currentCapitalGain":5.32,
"currentGainLoss":3.88,
"depreciationStartDate":"2020-01-02",
"costLimit":100.0,
"currentAccumDepreciationAmount":2.25
},
"AccountingBookValue":99.5
}'
description: Fixed asset you are creating
/Assets/{id}:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2: [assets, assets.read]
tags:
- Asset
summary: Retrieves fixed asset by id
operationId: getAssetById
description: |
By passing in the appropriate asset id, you can search for
a specific fixed asset in the system
parameters:
- name: id
in: path
required: true
description: fixed asset id for single object
schema:
type: string
format: uuid
example: "00000000-0000-0000-0000-000000000000"
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/Asset'
example: '{
"assetId":"68f17094-af97-4f1b-b36b-013b45b6ad3c",
"assetName":"Computer47822",
"assetNumber":"123478074",
"purchaseDate":"2020-01-01T00:00:00",
"purchasePrice":100.0000,
"disposalPrice":23.0000,
"assetStatus":"Draft",
"trackingItems":[
],
"bookDepreciationSetting":{
"depreciableObjectId":"68f17094-af97-4f1b-b36b-013b45b6ad3c",
"depreciableObjectType":"Asset",
"bookEffectiveDateOfChangeId":"5da77739-7f22-4109-b0a0-67480fb89af0",
"depreciationMethod":"StraightLine",
"averagingMethod":"ActualDays",
"depreciationRate":0.50,
"depreciationCalculationMethod":"None"
},
"bookDepreciationDetail":{
"depreciationStartDate":"2020-01-02T00:00:00",
"priorAccumDepreciationAmount":0.000000,
"currentAccumDepreciationAmount":0.000000,
"currentCapitalGain":0.000000,
"currentGainLoss":0.000000
},
"taxDepreciationSettings":[
],
"taxDepreciationDetails":[
],
"canRollback":true,
"metaData":{
"bookDepreciationDetailsCanChange":true,
"taxDepreciationDetailsCanChange":true
},
"accountingBookValue":77.000000,
"taxValues":[
],
"isDeleteEnabledForDate":true
}'
'400':
description: bad input parameter
/AssetTypes:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2: [assets, assets.read]
tags:
- Asset
summary: searches fixed asset types
operationId: getAssetTypes
description: By passing in the appropriate options, you can search for
available fixed asset types in the system
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AssetType'
example: '[
{
"assetTypeId":"710255c6-d2ed-4463-b992-06c8685add5e",
"assetTypeName":"Computer Equipment",
"fixedAssetAccountId":"37c35de7-8df0-44bf-8e7c-f1f67cf6a278",
"depreciationExpenseAccountId":"0fbd1820-9dd0-454a-9515-6ec076a84cf7",
"accumulatedDepreciationAccountId":"512eac06-6894-47cd-b421-673b4ca2693a",
"bookDepreciationSetting":{
"depreciableObjectId":"710255c6-d2ed-4463-b992-06c8685add5e",
"depreciableObjectType":"AssetType",
"bookEffectiveDateOfChangeId":"39b9c2e9-62b1-4efc-ab75-fa9152ffaa5f",
"depreciationMethod":"StraightLine",
"averagingMethod":"FullMonth",
"depreciationRate":25.00,
"depreciationCalculationMethod":"None"
},
"taxDepreciationSettings":[
],
"locks":0,
"lockPrivateUseAccount":false
},
{
"assetTypeId":"1a398a67-9d9d-4783-8689-14a8efce89d9",
"assetTypeName":"Machinery97704",
"fixedAssetAccountId":"5c93f577-c48f-44cd-8593-01489e319c2b",
"depreciationExpenseAccountId":"adc14376-c960-43f0-b7f3-4063e5098039",
"accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8",
"bookDepreciationSetting":{
"depreciableObjectId":"1a398a67-9d9d-4783-8689-14a8efce89d9",
"depreciableObjectType":"AssetType",
"bookEffectiveDateOfChangeId":"6d09a96d-7768-4f28-95e8-c9ac870fe36e",
"depreciationMethod":"DiminishingValue100",
"averagingMethod":"ActualDays",
"depreciationRate":40.00,
"depreciationCalculationMethod":"None"
},
"taxDepreciationSettings":[
],
"locks":0,
"lockPrivateUseAccount":false
}
]'
'400':
description: bad input parameter
post:
security:
- OAuth2: [assets]
tags:
- Asset
summary: adds a fixed asset type
parameters:
- $ref: '#/components/parameters/idempotencyKey'
operationId: createAssetType
x-example:
- bookDepreciationSetting:
is_object: true
key: bookDepreciationSetting
keyPascal: BookDepreciationSetting
keySnake: book_depreciation_setting
- depreciationMethod:
key: depreciationMethod
keyPascal: DepreciationMethod
keySnake: depreciation_method
object: bookDepreciationSetting
default: DiminishingValue100
- averagingMethod:
key: averagingMethod
keyPascal: AveragingMethod
keySnake: averaging_method
object: bookDepreciationSetting
default: ActualDays
- depreciationRate:
nonString: true
key: depreciationRate
keyPascal: DepreciationRate
keySnake: deprecitation_rate
object: bookDepreciationSetting
default: 40
- depreciationCalculationMethod:
key: depreciationCalculationMethod
keyPascal: DepreciationCalculationMethod
keySnake: depreciation_calculation_method
object: bookDepreciationSetting
default: None
is_last: true
- assetType:
key: assetType
keyPascal: AssetType
keySnake: asset_type
x-snake: asset_type
is_object: true
- assetTypeName:
key: assetTypeName
keyPascal: AssetTypeName
keySnake: asset_type_name
object: assetType
default: Computer Equipment
- fixedAssetAccountId:
is_uuid: true
key: fixedAssetAccountId
keyPascal: FixedAssetAccountId
keySnake: fixed_asset_account_id
object: assetType
default: 00000000-0000-0000-0000-000000000000
- depreciationExpenseAccountId:
is_uuid: true
key: depreciationExpenseAccountId
keyPascal: DepreciationExpenseAccountId
keySnake: depreciation_expense_account_id
object: assetType
default: 00000000-0000-0000-0000-000000000000
- accumulatedDepreciationAccountId:
is_uuid: true
key: accumulatedDepreciationAccountId
keyPascal: AccumulatedDepreciationAccountId
keySnake: accumulated_depreciation_account_id
object: assetType
default: 00000000-0000-0000-0000-000000000000
- set_bookDepreciationSetting:
is_last: true
is_variable: true
nonString: true
key: bookDepreciationSetting
keyPascal: BookDepreciationSetting
keySnake: book_depreciation_setting
default: bookDepreciationSetting
python: book_depreciation_setting
ruby: book_depreciation_setting
object: assetType
x-hasAssetsValidationError: true
description: Adds an fixed asset type to the system
responses:
'200':
description: results single object - created fixed type
content:
application/json:
schema:
$ref: '#/components/schemas/AssetType'
example: '{
"assetTypeId":"85509b5d-308e-420d-9532-b85105058916",
"assetTypeName":"Machinery11004",
"fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82",
"depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368",
"accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8",
"bookDepreciationSetting":{
"depreciableObjectId":"00000000-0000-0000-0000-000000000000",
"depreciableObjectType":"None",
"depreciationMethod":"DiminishingValue100",
"averagingMethod":"ActualDays",
"depreciationRate":0.05,
"depreciationCalculationMethod":"None"
},
"locks":0,
"lockPrivateUseAccount":false
}'
'400':
description: 'invalid input, object invalid'
content:
application/json:
example: '{
"resourceValidationErrors":[
],
"fieldValidationErrors":[
{
"fieldName":"FixedAssetAccountId",
"valueProvided":"",
"localisedMessage":"Fixed Asset Account Id is invalid",
"type":"http://common.service.xero.com/errors/validation/field",
"title":"Validation Error",
"detail":"Fixed Asset Account Id is invalid"
},
{
"fieldName":"DepreciationExpenseAccountId",
"valueProvided":"",
"localisedMessage":"Depreciation Expense Account Id is invalid",
"type":"http://common.service.xero.com/errors/validation/field",
"title":"Validation Error",
"detail":"Depreciation Expense Account Id is invalid"
}
],
"type":"http://common.service.xero.com/errors/validation",
"title":"The resource update failed validation.",
"detail":"Validation Errors"
}'
'409':
description: a type already exists
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AssetType'
example: '{
"assetTypeName":"Machinery11004",
"fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82",
"depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368",
"accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8",
"bookDepreciationSetting":{
"depreciationMethod":"DiminishingValue100",
"averagingMethod":"ActualDays",
"depreciationRate":0.05,
"depreciationCalculationMethod":"None"
}
}'
description: Asset type to add
/Settings:
parameters:
- $ref: '#/components/parameters/requiredHeader'
get:
security:
- OAuth2: [assets, assets.read]
tags:
- Asset
summary: searches fixed asset settings
operationId: getAssetSettings
description: By passing in the appropriate options, you can search for
available fixed asset types in the system
responses:
'200':
description: search results matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/Setting'
example: '{
"assetNumberPrefix":"FA-",
"assetNumberSequence":"0007",
"assetStartDate":"2016-01-01T00:00:00",
"optInForTax":false
}'
'400':
description: bad input parameter
components:
securitySchemes:
OAuth2:
type: oauth2
description: For more information
flows:
authorizationCode:
authorizationUrl: 'https://login.xero.com/identity/connect/authorize'
tokenUrl: 'https://identity.xero.com/connect/token'
scopes:
email: Grant read-only access to your email
openid: Grant read-only access to your open id
profile: your profile information
assets: Grant read-write access to fixed assets
assets.read: Grant read-only access to fixed assets
parameters:
requiredHeader:
in: header
name: xero-tenant-id
x-snake: xero_tenant_id
description: Xero identifier for Tenant
example: YOUR_XERO_TENANT_ID
schema:
type: string
required: true
idempotencyKey:
in: header
name: Idempotency-Key
x-snake: idempotency_key
description: This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
example: "KEY_VALUE"
schema:
type: string
schemas:
Assets:
type: object
properties:
pagination:
$ref: '#/components/schemas/Pagination'
items:
type: array
items:
$ref: '#/components/schemas/Asset'
Pagination:
properties:
page:
type: integer
example: 1
pageSize:
type: integer
example: 10
pageCount:
type: integer
example: 1
itemCount:
type: integer
example: 2
Asset:
type: object
required:
- assetName
properties:
assetId:
type: string
format: uuid
description: "The Xero-generated Id for the asset"
example: "3b5b3a38-5649-495f-87a1-14a4e5918634"
assetName:
type: string
description: "The name of the asset"
example: "Awesome Truck 3"
assetTypeId:
type: string
format: uuid
description: "The Xero-generated Id for the asset type"
example: "3b5b3a38-5649-495f-87a1-14a4e5918634"
assetNumber:
type: string
description: "Must be unique."
example: "FA-0013"
purchaseDate:
type: string
format: date
description: "The date the asset was purchased YYYY-MM-DD"
example: "2015-07-01T00:00:00"
purchasePrice:
type: number
format: double
x-is-money: true
description: "The purchase price of the asset"
example: "1000.0000"
disposalDate:
type: string
format: date
description: "The date the asset was disposed"
example: "2020-07-01T00:00:00"
disposalPrice:
type: number
format: double
x-is-money: true
description: "The price the asset was disposed at"
example: "1.0000"
assetStatus:
$ref: '#/components/schemas/AssetStatus'
warrantyExpiryDate:
type: string
description: "The date the asset’s warranty expires (if needed) YYYY-MM-DD"
example: "ca4c6b39-4f4f-43e8-98da-5e1f350a6694"
serialNumber:
type: string
description: "The asset's serial number"
example: "ca4c6b39-4f4f-43e8-98da-5e1f350a6694"
bookDepreciationSetting:
$ref: '#/components/schemas/BookDepreciationSetting'
bookDepreciationDetail:
$ref: '#/components/schemas/BookDepreciationDetail'
canRollback:
type: boolean
description: "Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back."
example: true
accountingBookValue:
type: number
format: double
x-is-money: true
description: "The accounting value of the asset"
example: 0
isDeleteEnabledForDate:
type: boolean
description: "Boolean to indicate whether delete is enabled"
example: true
AssetStatus:
type: string
description: "See Asset Status Codes."
example: "Draft"
enum:
- Draft
- Registered
- Disposed
AssetStatusQueryParam:
type: string
description: "See Asset Status Codes."
example: "DRAFT"
enum:
- DRAFT
- REGISTERED
- DISPOSED
AssetType:
type: object
x-snake: asset_type
required:
- assetTypeName
- bookDepreciationSetting
properties:
assetTypeId:
type: string
format: uuid
example: "5da209c5-5e19-4a43-b925-71b776c49ced"
description: "Xero generated unique identifier for asset types"
assetTypeName:
type: string
example: "Computer Equipment"
description: "The name of the asset type"
fixedAssetAccountId:
type: string
format: uuid
example: "24e260f1-bfc4-4766-ad7f-8a8ce01de879"
description: "The asset account for fixed assets of this type"
depreciationExpenseAccountId:
type: string
format: uuid
example: "b23fc79b-d66b-44b0-a240-e138e086fcbc"
description: "The expense account for the depreciation of fixed assets of this type"
accumulatedDepreciationAccountId:
type: string
format: uuid
example: "ca4c6b39-4f4f-43e8-98da-5e1f350a6694"
description: "The account for accumulated depreciation of fixed assets of this type"
bookDepreciationSetting:
$ref: '#/components/schemas/BookDepreciationSetting'
locks:
type: integer
example: 33
description: "All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed."
BookDepreciationSetting:
required:
- name
properties:
depreciationMethod:
type: string
enum:
- NoDepreciation
- StraightLine
- DiminishingValue100
- DiminishingValue150
- DiminishingValue200
- FullDepreciation
example: "StraightLine"
description: "The method of depreciation applied to this asset. See Depreciation Methods"
averagingMethod:
type: string
enum:
- FullMonth
- ActualDays
example: "ActualDays"
description: "The method of averaging applied to this asset. See Averaging Methods"
depreciationRate:
type: number
format: double
x-is-money: true
example: 0.05
description: "The rate of depreciation (e.g. 0.05)"
effectiveLifeYears:
type: integer
example: 5
description: "Effective life of the asset in years (e.g. 5)"
depreciationCalculationMethod:
type: string
enum:
- Rate
- Life
- None
example: "None"
description: "See Depreciation Calculation Methods"
depreciableObjectId:
type: string
format: uuid
example: "68f17094-af97-4f1b-b36b-013b45b6ad3c"
description: "Unique Xero identifier for the depreciable object"
depreciableObjectType:
type: string
example: "Asset"
description: "The type of asset object"
bookEffectiveDateOfChangeId:
type: string
format: uuid
example: "68f17094-af97-4f1b-b36b-013b45b6ad3c"
description: "Unique Xero identifier for the effective date change"
BookDepreciationDetail:
required:
- name
properties:
currentCapitalGain:
type: number
format: double
x-is-money: true
example: 5.25
description: "When an asset is disposed, this will be the sell price minus the purchase price if a profit was made."
currentGainLoss:
type: number
format: double
x-is-money: true
example: 10.50
description: "When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value."
depreciationStartDate:
type: string
format: date
example: "2015-07-01T00:00:00"
description: "YYYY-MM-DD"
costLimit:
type: number
format: double
x-is-money: true
example: 9000.0000
description: "The value of the asset you want to depreciate, if this is less than the cost of the asset."
residualValue:
type: number
format: double
x-is-money: true
example: 10000.0000
description: "The value of the asset remaining when you've fully depreciated it."
priorAccumDepreciationAmount:
type: number
format: double
x-is-money: true
example: 0.45
description: "All depreciation prior to the current financial year."
currentAccumDepreciationAmount:
type: number
format: double
x-is-money: true
example: 5.0000
description: "All depreciation occurring in the current financial year."
Setting:
required:
- name
properties:
assetNumberPrefix:
type: string
example: "FA-"
description: "The prefix used for fixed asset numbers (“FA-” by default)"
assetNumberSequence:
type: string
example: "0022"
description: "The next available sequence number"
assetStartDate:
type: string
format: date
example: "2015-07-31T00:00:00"
description: "The date depreciation calculations started on registered fixed assets in Xero"
lastDepreciationDate:
type: string
format: date
example: "2015-07-01T00:00:00"
description: "The last depreciation date"
defaultGainOnDisposalAccountId:
type: string
format: uuid
example: "346ddb97-739a-4274-b43b-66aa3218d17c"
description: "Default account that gains are posted to"
defaultLossOnDisposalAccountId:
type: string
format: uuid
example: "1b798541-24e2-4855-9309-c023a0b576f3"
description: "Default account that losses are posted to"
defaultCapitalGainOnDisposalAccountId:
type: string
format: uuid
example: "6d6a0bdb-e118-45d8-a023-2ad617ec1cb7"
description: "Default account that capital gains are posted to"
optInForTax:
type: boolean
description: "opt in for tax calculation"
example: false
type: object
Error:
externalDocs:
url: "https://developer.xero.com/documentation/api/http-response-codes"
properties:
resourceValidationErrors:
description: Array of elements of resource validation errors
type: array
items:
$ref: "#/components/schemas/ResourceValidationErrorsElement"
fieldValidationErrors:
description: Array of elements of field validation errors
type: array
items:
$ref: "#/components/schemas/FieldValidationErrorsElement"
type:
description: The internal type of error, not accessible externally
type: string
title:
description: Title of the error
type: string
detail:
description: Detail of the error
type: string
type: object
ResourceValidationErrorsElement:
externalDocs:
url: "https://developer.xero.com/documentation/api/http-response-codes"
properties:
resourceName:
description: The field name of the erroneous field
type: string
localisedMessage:
description: Explanation of the resource validation error
type: string
type: