@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Xero Assets API
@base https://api.xero.com/assets.xro/1.0
@version 12.0.0
@auth OAuth2
@endpoints 6
@toc Assets(3), AssetTypes(2), Settings(1)

@group Assets
@endpoint GET /Assets
@required {status: str}
@optional {page: int, pageSize: int, orderBy: str(AssetType/AssetName/AssetNumber/PurchaseDate/PurchasePrice/DisposalDate/DisposalPrice), sortDirection: str(asc/desc), filterBy: str}
@returns(200) {pagination: any, items: [map]}
@errors {400}

@endpoint POST /Assets
@required {assetName: str}
@optional {Idempotency-Key: str, assetId: str(uuid), assetTypeId: str(uuid), assetNumber: str, purchaseDate: str(date), purchasePrice: num(double), disposalDate: str(date), disposalPrice: num(double), assetStatus: str(Draft/Registered/Disposed), warrantyExpiryDate: str, serialNumber: str, bookDepreciationSetting: any, bookDepreciationDetail: any, canRollback: bool, accountingBookValue: num(double), isDeleteEnabledForDate: bool}
@returns(200) {assetId: str(uuid), assetName: str, assetTypeId: str(uuid), assetNumber: str, purchaseDate: str(date), purchasePrice: num(double), disposalDate: str(date), disposalPrice: num(double), assetStatus: str, warrantyExpiryDate: str, serialNumber: str, bookDepreciationSetting: any, bookDepreciationDetail: any, canRollback: bool, accountingBookValue: num(double), isDeleteEnabledForDate: bool}
@errors {400}

@endpoint GET /Assets/{id}
@required {id: str(uuid)}
@returns(200) {assetId: str(uuid), assetName: str, assetTypeId: str(uuid), assetNumber: str, purchaseDate: str(date), purchasePrice: num(double), disposalDate: str(date), disposalPrice: num(double), assetStatus: str, warrantyExpiryDate: str, serialNumber: str, bookDepreciationSetting: any, bookDepreciationDetail: any, canRollback: bool, accountingBookValue: num(double), isDeleteEnabledForDate: bool}
@errors {400}

@endgroup

@group AssetTypes
@endpoint GET /AssetTypes
@returns(200)
@errors {400}

@endpoint POST /AssetTypes
@required {assetTypeName: str, bookDepreciationSetting: any}
@optional {Idempotency-Key: str, assetTypeId: str(uuid), fixedAssetAccountId: str(uuid), depreciationExpenseAccountId: str(uuid), accumulatedDepreciationAccountId: str(uuid), locks: int}
@returns(200) {assetTypeId: str(uuid), assetTypeName: str, fixedAssetAccountId: str(uuid), depreciationExpenseAccountId: str(uuid), accumulatedDepreciationAccountId: str(uuid), bookDepreciationSetting: any, locks: int}
@errors {400, 409}

@endgroup

@group Settings
@endpoint GET /Settings
@returns(200) {assetNumberPrefix: str, assetNumberSequence: str, assetStartDate: str(date), lastDepreciationDate: str(date), defaultGainOnDisposalAccountId: str(uuid), defaultLossOnDisposalAccountId: str(uuid), defaultCapitalGainOnDisposalAccountId: str(uuid), optInForTax: bool}
@errors {400}

@endgroup

@end
