xero.assets
Module xero.assets
API
ballerinax/xero.assets Ballerina library
Overview
The Xero Assets API v2.9.4 connector(https://developer.xero.com/documentation/api/assets/overview/) OpenAPI specification.
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.
Clients
xero.assets: Client
This is a generated connector for Xero Assets API v2.9.4 OpenAPI specification. 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.
Constructor
Gets invoked to initialize the connector.
The connector initialization requires setting the API credentials.
Create a Xero account and obtain tokens following this guide.
init (ConnectionConfig config, string serviceUrl)- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.xero.com/assets.xro/1.0" - URL of the target service
getAssetTypes
searches fixed asset types
Parameters
- xeroTenantId string - Xero identifier for Tenant
createAssetType
adds a fixed asset type
getAssets
function getAssets(string xeroTenantId, AssetStatusQueryParam status, int? page, int? pageSize, string? orderBy, string? sortDirection, string? filterBy) returns Assets|errorsearches fixed asset
Parameters
- xeroTenantId string - Xero identifier for Tenant
- status AssetStatusQueryParam - Required when retrieving a collection of assets. See Asset Status Codes
- page int? (default ()) - Results are paged. This specifies which page of the results to return. The default page is 1.
- pageSize int? (default ()) - The number of records returned per page. By default the number of records returned is 10.
- orderBy string? (default ()) - Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
- sortDirection string? (default ()) - ASC or DESC
- filterBy string? (default ()) - 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.
createAsset
adds a fixed asset
Parameters
- xeroTenantId string - Xero identifier for Tenant
- payload Asset - Fixed asset you are creating
getAssetById
Retrieves fixed asset by id
Parameters
- xeroTenantId string - Xero identifier for Tenant
- id string - fixed asset id for single object
getAssetSettings
searches fixed asset settings
Parameters
- xeroTenantId string - Xero identifier for Tenant
Records
xero.assets: Asset
Fields
- accountingBookValue? decimal - The accounting value of the asset
- assetId? string - The Xero-generated Id for the asset
- assetName string - The name of the asset
- assetNumber? string - Must be unique.
- assetStatus? AssetStatus - See Asset Status Codes.
- assetTypeId? string - The Xero-generated Id for the asset type
- bookDepreciationDetail? BookDepreciationDetail -
- bookDepreciationSetting? BookDepreciationSetting -
- canRollback? boolean - 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.
- disposalDate? string - The date the asset was disposed
- disposalPrice? decimal - The price the asset was disposed at
- isDeleteEnabledForDate? boolean - Boolean to indicate whether delete is enabled
- purchaseDate? string - The date the asset was purchased YYYY-MM-DD
- purchasePrice? decimal - The purchase price of the asset
- serialNumber? string - The asset's serial number
- warrantyExpiryDate? string - The date the asset’s warranty expires (if needed) YYYY-MM-DD
xero.assets: Assets
Fields
- items? Asset[] -
- pagination? Pagination -
xero.assets: AssetType
Fields
- accumulatedDepreciationAccountId? string - The account for accumulated depreciation of fixed assets of this type
- assetTypeId? string - Xero generated unique identifier for asset types
- assetTypeName string - The name of the asset type
- bookDepreciationSetting BookDepreciationSetting -
- depreciationExpenseAccountId? string - The expense account for the depreciation of fixed assets of this type
- fixedAssetAccountId? string - The asset account for fixed assets of this type
- locks? int - All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed.
xero.assets: BookDepreciationDetail
Fields
- costLimit? decimal - The value of the asset you want to depreciate, if this is less than the cost of the asset.
- currentAccumDepreciationAmount? decimal - All depreciation occurring in the current financial year.
- currentCapitalGain? decimal - When an asset is disposed, this will be the sell price minus the purchase price if a profit was made.
- currentGainLoss? decimal - When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value.
- depreciationStartDate? string - YYYY-MM-DD
- priorAccumDepreciationAmount? decimal - All depreciation prior to the current financial year.
- residualValue? decimal - The value of the asset remaining when you've fully depreciated it.
xero.assets: BookDepreciationSetting
Fields
- averagingMethod? string - The method of averaging applied to this asset. See Averaging Methods
- bookEffectiveDateOfChangeId? string - Unique Xero identifier for the effective date change
- depreciableObjectId? string - Unique Xero identifier for the depreciable object
- depreciableObjectType? string - The type of asset object
- depreciationCalculationMethod? string - See Depreciation Calculation Methods
- depreciationMethod? string - The method of depreciation applied to this asset. See Depreciation Methods
- depreciationRate? decimal - The rate of depreciation (e.g. 0.05)
- effectiveLifeYears? int - Effective life of the asset in years (e.g. 5)
xero.assets: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy? ProxyConfig - Proxy server related options
xero.assets: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth BearerTokenConfig|OAuth2RefreshTokenGrantConfig - Configurations related to client authentication
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings? ClientHttp1Settings - Configurations related to HTTP/1.x protocol
- http2Settings? ClientHttp2Settings - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache? CacheConfig - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- responseLimits? ResponseLimitConfigs - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
xero.assets: Error
Fields
- detail? string - Detail of the error
- fieldValidationErrors? FieldValidationErrorsElement[] - Array of elements of field validation errors
- resourceValidationErrors? ResourceValidationErrorsElement[] - Array of elements of resource validation errors
- title? string - Title of the error
- 'type? string - The internal type of error, not accessible externally
xero.assets: FieldValidationErrorsElement
Fields
- detail? string - Detail of the field validation error
- fieldName? string - The field name of the erroneous field
- localisedMessage? string - Explanation of the field validation error
- title? string - Title of the field validation error
- 'type? string - Internal type of the field validation error message
- valueProvided? string - The provided value
xero.assets: OAuth2RefreshTokenGrantConfig
OAuth2 Refresh Token Grant Configs
Fields
- Fields Included from *OAuth2RefreshTokenGrantConfig
- refreshUrl string(default "https://identity.xero.com/connect/token") - Refresh URL
xero.assets: Pagination
Fields
- itemCount? int -
- page? int -
- pageCount? int -
- pageSize? int -
xero.assets: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
xero.assets: ResourceValidationErrorsElement
Fields
- detail? string - Detail of the resource validation error
- localisedMessage? string - Explanation of the resource validation error
- resourceName? string - The field name of the erroneous field
- title? string - Title of the resource validation error
- 'type? string - Internal type of the resource error message
xero.assets: Setting
Fields
- assetNumberPrefix? string - The prefix used for fixed asset numbers (“FA-” by default)
- assetNumberSequence? string - The next available sequence number
- assetStartDate? string - The date depreciation calculations started on registered fixed assets in Xero
- defaultCapitalGainOnDisposalAccountId? string - Default account that capital gains are posted to
- defaultGainOnDisposalAccountId? string - Default account that gains are posted to
- defaultLossOnDisposalAccountId? string - Default account that losses are posted to
- lastDepreciationDate? string - The last depreciation date
- optInForTax? boolean - opt in for tax calculation
Array types
xero.assets: AssetTypeArr
AssetTypeArr
String types
Import
import ballerinax/xero.assets;Metadata
Released date: 3 days ago
Version: 1.5.2
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.8.0
GraalVM compatible: Yes
Pull count
Total: 30
Current verison: 0
Weekly downloads
Keywords
Type/Connector
Vendor/Xero
Area/Finance & Accounting
Finance/Asset Management
Cost/Paid
Contributors
Dependencies