Xero Assets API

Asset

createAsset

adds a fixed asset

Adds an asset to the system


/Assets

Usage and SDK Samples

curl -X  "https://api.xero.com/assets.xro/1.0/Assets"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AssetApi;

import java.io.File;
import java.util.*;

public class AssetApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: OAuth2
        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
        OAuth2.setAccessToken("YOUR ACCESS TOKEN");

        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        Asset asset = { "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 }; // Asset | 
        try {
            Asset result = apiInstance.createAsset(xeroTenantId, asset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#createAsset");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.AssetApi;

public class AssetApiExample {

    public static void main(String[] args) {
        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        Asset asset = { "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 }; // Asset | 
        try {
            Asset result = apiInstance.createAsset(xeroTenantId, asset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#createAsset");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *xeroTenantId = xeroTenantId_example; // Xero identifier for Tenant (default to null)
Asset *asset = { "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 }; // 

AssetApi *apiInstance = [[AssetApi alloc] init];

// adds a fixed asset
[apiInstance createAssetWith:xeroTenantId
    asset:asset
              completionHandler: ^(Asset output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
const tokenSet: TokenSet =  {
  id_token: 'xxx',
  access_token: 'yyy',
  expires_at: 1582308862,
  token_type: 'Bearer',
  refresh_token: 'zzz',
  session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
 
const xeroTenantId = "xeroTenantId_example";  // {String} Xero identifier for Tenant 
const asset:Asset = { "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 };  // {Asset} 
try {
  const response: any = await xero.accountingApi.createAsset(xeroTenantId, asset);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
  console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}

using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;

namespace Example
{
    public class createAssetExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: OAuth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AssetApi();
            var xeroTenantId = xeroTenantId_example;  // String | Xero identifier for Tenant (default to null)
            var asset = new Asset(); // Asset | 

            try
            {
                // adds a fixed asset
                Asset result = apiInstance.createAsset(xeroTenantId, asset);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetApi.createAsset: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: OAuth2

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );	
$config->setHost("https://api.xero.com/api.xro/2.0");        

$xeroTenantId =  'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant

$apiInstance = new XeroAPI\XeroPHP\Api\AssetApi(
    new GuzzleHttp\Client(),
    $config
);

try { 
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->createAsset: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AssetApi;

# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = ::AssetApi->new();
my $xeroTenantId = xeroTenantId_example; # String | Xero identifier for Tenant
my $asset = ::Object::Asset->new(); # Asset | 

eval { 
    my $result = $api_instance->createAsset(xeroTenantId => $xeroTenantId, asset => $asset);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetApi->createAsset: $@\n";
}
from __future__ import print_statement
import time
import 
from .rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = .AssetApi()
xeroTenantId = xeroTenantId_example # String | Xero identifier for Tenant (default to null)
asset = { "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 } # Asset | 

try: 
    # adds a fixed asset
    api_response = api_instance.create_asset(xeroTenantId, asset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetApi->createAsset: %s\n" % e)
extern crate AssetApi;

pub fn main() {
    let xeroTenantId = xeroTenantId_example; // String
    let asset = { "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 }; // Asset

    let mut context = AssetApi::Context::default();
    let result = client.createAsset(xeroTenantId, asset, &context).wait();
    println!("{:?}", result);

}

Scopes

assets

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
asset *
Asset
Fixed asset you are creating
Required

createAssetType

adds a fixed asset type

Adds an fixed asset type to the system


/AssetTypes

Usage and SDK Samples

curl -X  "https://api.xero.com/assets.xro/1.0/AssetTypes"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AssetApi;

import java.io.File;
import java.util.*;

public class AssetApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: OAuth2
        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
        OAuth2.setAccessToken("YOUR ACCESS TOKEN");

        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        AssetType assetType = { "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" } }; // AssetType | 
        try {
            AssetType result = apiInstance.createAssetType(xeroTenantId, assetType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#createAssetType");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.AssetApi;

public class AssetApiExample {

    public static void main(String[] args) {
        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        AssetType assetType = { "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" } }; // AssetType | 
        try {
            AssetType result = apiInstance.createAssetType(xeroTenantId, assetType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#createAssetType");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *xeroTenantId = xeroTenantId_example; // Xero identifier for Tenant (default to null)
AssetType *assetType = { "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" } }; //  (optional)

AssetApi *apiInstance = [[AssetApi alloc] init];

// adds a fixed asset type
[apiInstance createAssetTypeWith:xeroTenantId
    assetType:assetType
              completionHandler: ^(AssetType output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
const tokenSet: TokenSet =  {
  id_token: 'xxx',
  access_token: 'yyy',
  expires_at: 1582308862,
  token_type: 'Bearer',
  refresh_token: 'zzz',
  session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
 
const xeroTenantId = "xeroTenantId_example";  // {String} Xero identifier for Tenant
const assetType:AssetType =  { "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" } };  // {AssetType} 

try {
  const response: any = await xero.accountingApi.createAssetType(xeroTenantId,  assetType);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
  console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}

using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;

namespace Example
{
    public class createAssetTypeExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: OAuth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AssetApi();
            var xeroTenantId = xeroTenantId_example;  // String | Xero identifier for Tenant (default to null)
            var assetType = new AssetType(); // AssetType |  (optional) 

            try
            {
                // adds a fixed asset type
                AssetType result = apiInstance.createAssetType(xeroTenantId, assetType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetApi.createAssetType: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: OAuth2

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );	
$config->setHost("https://api.xero.com/api.xro/2.0");        

$xeroTenantId =  'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant

$apiInstance = new XeroAPI\XeroPHP\Api\AssetApi(
    new GuzzleHttp\Client(),
    $config
);

try { 
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->createAssetType: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AssetApi;

# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = ::AssetApi->new();
my $xeroTenantId = xeroTenantId_example; # String | Xero identifier for Tenant
my $assetType = ::Object::AssetType->new(); # AssetType | 

eval { 
    my $result = $api_instance->createAssetType(xeroTenantId => $xeroTenantId, assetType => $assetType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetApi->createAssetType: $@\n";
}
from __future__ import print_statement
import time
import 
from .rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = .AssetApi()
xeroTenantId = xeroTenantId_example # String | Xero identifier for Tenant (default to null)
assetType = { "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" } } # AssetType |  (optional)

try: 
    # adds a fixed asset type
    api_response = api_instance.create_asset_type(xeroTenantId, assetType=assetType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetApi->createAssetType: %s\n" % e)
extern crate AssetApi;

pub fn main() {
    let xeroTenantId = xeroTenantId_example; // String
    let assetType = { "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" } }; // AssetType

    let mut context = AssetApi::Context::default();
    let result = client.createAssetType(xeroTenantId, assetType, &context).wait();
    println!("{:?}", result);

}

Scopes

assets

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
assetType
AssetType
Asset type to add

getAssetById

retrieves fixed asset by id

By passing in the appropriate asset id, you can search for a specific fixed asset in the system


/Assets/{id}

Usage and SDK Samples

curl -X  "https://api.xero.com/assets.xro/1.0/Assets/{id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AssetApi;

import java.io.File;
import java.util.*;

public class AssetApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: OAuth2
        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
        OAuth2.setAccessToken("YOUR ACCESS TOKEN");

        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        UUID id = 4f7bcdcb-5ec1-4258-9558-19f662fccdfe; // UUID | fixed asset id for single object
        try {
            Asset result = apiInstance.getAssetById(xeroTenantId, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssetById");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.AssetApi;

public class AssetApiExample {

    public static void main(String[] args) {
        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        UUID id = 4f7bcdcb-5ec1-4258-9558-19f662fccdfe; // UUID | fixed asset id for single object
        try {
            Asset result = apiInstance.getAssetById(xeroTenantId, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssetById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *xeroTenantId = xeroTenantId_example; // Xero identifier for Tenant (default to null)
UUID *id = 4f7bcdcb-5ec1-4258-9558-19f662fccdfe; // fixed asset id for single object (default to null)

AssetApi *apiInstance = [[AssetApi alloc] init];

// retrieves fixed asset by id
[apiInstance getAssetByIdWith:xeroTenantId
    id:id
              completionHandler: ^(Asset output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
const tokenSet: TokenSet =  {
  id_token: 'xxx',
  access_token: 'yyy',
  expires_at: 1582308862,
  token_type: 'Bearer',
  refresh_token: 'zzz',
  session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
 
const xeroTenantId = "xeroTenantId_example";  // {String} Xero identifier for Tenant 
const id = "4f7bcdcb-5ec1-4258-9558-19f662fccdfe";  // {UUID} fixed asset id for single object
try {
  const response: any = await xero.accountingApi.getAssetById(xeroTenantId, id);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
  console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}

using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;

namespace Example
{
    public class getAssetByIdExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: OAuth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AssetApi();
            var xeroTenantId = xeroTenantId_example;  // String | Xero identifier for Tenant (default to null)
            var id = new UUID(); // UUID | fixed asset id for single object (default to null)

            try
            {
                // retrieves fixed asset by id
                Asset result = apiInstance.getAssetById(xeroTenantId, id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetApi.getAssetById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: OAuth2

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );	
$config->setHost("https://api.xero.com/api.xro/2.0");        

$xeroTenantId =  'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant

$apiInstance = new XeroAPI\XeroPHP\Api\AssetApi(
    new GuzzleHttp\Client(),
    $config
);

try { 
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->getAssetById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AssetApi;

# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = ::AssetApi->new();
my $xeroTenantId = xeroTenantId_example; # String | Xero identifier for Tenant
my $id = 4f7bcdcb-5ec1-4258-9558-19f662fccdfe; # UUID | fixed asset id for single object

eval { 
    my $result = $api_instance->getAssetById(xeroTenantId => $xeroTenantId, id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetApi->getAssetById: $@\n";
}
from __future__ import print_statement
import time
import 
from .rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = .AssetApi()
xeroTenantId = xeroTenantId_example # String | Xero identifier for Tenant (default to null)
id = 4f7bcdcb-5ec1-4258-9558-19f662fccdfe # UUID | fixed asset id for single object (default to null)

try: 
    # retrieves fixed asset by id
    api_response = api_instance.get_asset_by_id(xeroTenantId, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetApi->getAssetById: %s\n" % e)
extern crate AssetApi;

pub fn main() {
    let xeroTenantId = xeroTenantId_example; // String
    let id = 4f7bcdcb-5ec1-4258-9558-19f662fccdfe; // UUID

    let mut context = AssetApi::Context::default();
    let result = client.getAssetById(xeroTenantId, id, &context).wait();
    println!("{:?}", result);

}

Scopes

assets.read

Parameters

Path parameters
Name Description
id*
UUID (uuid)
fixed asset id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getAssetSettings

searches fixed asset settings

By passing in the appropriate options, you can search for available fixed asset types in the system


/Settings

Usage and SDK Samples

curl -X  "https://api.xero.com/assets.xro/1.0/Settings"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AssetApi;

import java.io.File;
import java.util.*;

public class AssetApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: OAuth2
        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
        OAuth2.setAccessToken("YOUR ACCESS TOKEN");

        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        try {
            Setting result = apiInstance.getAssetSettings(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssetSettings");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.AssetApi;

public class AssetApiExample {

    public static void main(String[] args) {
        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        try {
            Setting result = apiInstance.getAssetSettings(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssetSettings");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *xeroTenantId = xeroTenantId_example; // Xero identifier for Tenant (default to null)

AssetApi *apiInstance = [[AssetApi alloc] init];

// searches fixed asset settings
[apiInstance getAssetSettingsWith:xeroTenantId
              completionHandler: ^(Setting output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
const tokenSet: TokenSet =  {
  id_token: 'xxx',
  access_token: 'yyy',
  expires_at: 1582308862,
  token_type: 'Bearer',
  refresh_token: 'zzz',
  session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
 
const xeroTenantId = "xeroTenantId_example";  // {String} Xero identifier for Tenant
try {
  const response: any = await xero.accountingApi.getAssetSettings(xeroTenantId);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
  console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}

using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;

namespace Example
{
    public class getAssetSettingsExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: OAuth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AssetApi();
            var xeroTenantId = xeroTenantId_example;  // String | Xero identifier for Tenant (default to null)

            try
            {
                // searches fixed asset settings
                Setting result = apiInstance.getAssetSettings(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetApi.getAssetSettings: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: OAuth2

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );	
$config->setHost("https://api.xero.com/api.xro/2.0");        

$xeroTenantId =  'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant

$apiInstance = new XeroAPI\XeroPHP\Api\AssetApi(
    new GuzzleHttp\Client(),
    $config
);

try { 
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->getAssetSettings: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AssetApi;

# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = ::AssetApi->new();
my $xeroTenantId = xeroTenantId_example; # String | Xero identifier for Tenant

eval { 
    my $result = $api_instance->getAssetSettings(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetApi->getAssetSettings: $@\n";
}
from __future__ import print_statement
import time
import 
from .rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = .AssetApi()
xeroTenantId = xeroTenantId_example # String | Xero identifier for Tenant (default to null)

try: 
    # searches fixed asset settings
    api_response = api_instance.get_asset_settings(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetApi->getAssetSettings: %s\n" % e)
extern crate AssetApi;

pub fn main() {
    let xeroTenantId = xeroTenantId_example; // String

    let mut context = AssetApi::Context::default();
    let result = client.getAssetSettings(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

assets.read

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getAssetTypes

searches fixed asset types

By passing in the appropriate options, you can search for available fixed asset types in the system


/AssetTypes

Usage and SDK Samples

curl -X  "https://api.xero.com/assets.xro/1.0/AssetTypes"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AssetApi;

import java.io.File;
import java.util.*;

public class AssetApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: OAuth2
        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
        OAuth2.setAccessToken("YOUR ACCESS TOKEN");

        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        try {
            array[AssetType] result = apiInstance.getAssetTypes(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssetTypes");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.AssetApi;

public class AssetApiExample {

    public static void main(String[] args) {
        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        try {
            array[AssetType] result = apiInstance.getAssetTypes(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssetTypes");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *xeroTenantId = xeroTenantId_example; // Xero identifier for Tenant (default to null)

AssetApi *apiInstance = [[AssetApi alloc] init];

// searches fixed asset types
[apiInstance getAssetTypesWith:xeroTenantId
              completionHandler: ^(array[AssetType] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
const tokenSet: TokenSet =  {
  id_token: 'xxx',
  access_token: 'yyy',
  expires_at: 1582308862,
  token_type: 'Bearer',
  refresh_token: 'zzz',
  session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
 
const xeroTenantId = "xeroTenantId_example";  // {String} Xero identifier for Tenant
try {
  const response: any = await xero.accountingApi.getAssetTypes(xeroTenantId);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
  console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}

using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;

namespace Example
{
    public class getAssetTypesExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: OAuth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AssetApi();
            var xeroTenantId = xeroTenantId_example;  // String | Xero identifier for Tenant (default to null)

            try
            {
                // searches fixed asset types
                array[AssetType] result = apiInstance.getAssetTypes(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetApi.getAssetTypes: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: OAuth2

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );	
$config->setHost("https://api.xero.com/api.xro/2.0");        

$xeroTenantId =  'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant

$apiInstance = new XeroAPI\XeroPHP\Api\AssetApi(
    new GuzzleHttp\Client(),
    $config
);

try { 
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->getAssetTypes: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AssetApi;

# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = ::AssetApi->new();
my $xeroTenantId = xeroTenantId_example; # String | Xero identifier for Tenant

eval { 
    my $result = $api_instance->getAssetTypes(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetApi->getAssetTypes: $@\n";
}
from __future__ import print_statement
import time
import 
from .rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = .AssetApi()
xeroTenantId = xeroTenantId_example # String | Xero identifier for Tenant (default to null)

try: 
    # searches fixed asset types
    api_response = api_instance.get_asset_types(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetApi->getAssetTypes: %s\n" % e)
extern crate AssetApi;

pub fn main() {
    let xeroTenantId = xeroTenantId_example; // String

    let mut context = AssetApi::Context::default();
    let result = client.getAssetTypes(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

assets.read

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getAssets

searches fixed asset

By passing in the appropriate options, you can search for available fixed asset in the system


/Assets

Usage and SDK Samples

curl -X  "https://api.xero.com/assets.xro/1.0/Assets?status=Draft&page=1&pageSize=5&orderBy=AssetName&sortDirection=ASC&filterBy=Draft"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AssetApi;

import java.io.File;
import java.util.*;

public class AssetApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: OAuth2
        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
        OAuth2.setAccessToken("YOUR ACCESS TOKEN");

        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        String status = Draft; // String | Required when retrieving a collection of assets. See Asset Status Codes
        Integer page = 1; // Integer | Results are paged. This specifies which page of the results to return. The default page is 1.
        Integer pageSize = 5; // Integer | The number of records returned per page. By default the number of records returned is 10.
        String orderBy = AssetName; // String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
        String sortDirection = ASC; // String | ASC or DESC
        String filterBy = Draft; // String | 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.
        try {
            Assets result = apiInstance.getAssets(xeroTenantId, status, page, pageSize, orderBy, sortDirection, filterBy);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssets");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.AssetApi;

public class AssetApiExample {

    public static void main(String[] args) {
        AssetApi apiInstance = new AssetApi();
        String xeroTenantId = xeroTenantId_example; // String | Xero identifier for Tenant
        String status = Draft; // String | Required when retrieving a collection of assets. See Asset Status Codes
        Integer page = 1; // Integer | Results are paged. This specifies which page of the results to return. The default page is 1.
        Integer pageSize = 5; // Integer | The number of records returned per page. By default the number of records returned is 10.
        String orderBy = AssetName; // String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
        String sortDirection = ASC; // String | ASC or DESC
        String filterBy = Draft; // String | 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.
        try {
            Assets result = apiInstance.getAssets(xeroTenantId, status, page, pageSize, orderBy, sortDirection, filterBy);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetApi#getAssets");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *xeroTenantId = xeroTenantId_example; // Xero identifier for Tenant (default to null)
String *status = Draft; // Required when retrieving a collection of assets. See Asset Status Codes (default to null)
Integer *page = 1; // Results are paged. This specifies which page of the results to return. The default page is 1. (optional) (default to null)
Integer *pageSize = 5; // The number of records returned per page. By default the number of records returned is 10. (optional) (default to null)
String *orderBy = AssetName; // Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. (optional) (default to null)
String *sortDirection = ASC; // ASC or DESC (optional) (default to null)
String *filterBy = Draft; // 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. (optional) (default to null)

AssetApi *apiInstance = [[AssetApi alloc] init];

// searches fixed asset
[apiInstance getAssetsWith:xeroTenantId
    status:status
    page:page
    pageSize:pageSize
    orderBy:orderBy
    sortDirection:sortDirection
    filterBy:filterBy
              completionHandler: ^(Assets output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
const tokenSet: TokenSet =  {
  id_token: 'xxx',
  access_token: 'yyy',
  expires_at: 1582308862,
  token_type: 'Bearer',
  refresh_token: 'zzz',
  session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
 
const xeroTenantId = "xeroTenantId_example";  // {String} Xero identifier for Tenant 
const status = "Draft";  // {String} Required when retrieving a collection of assets. See Asset Status Codes
const page =  1;  // {Integer} Results are paged. This specifies which page of the results to return. The default page is 1.
const pageSize =  5;  // {Integer} The number of records returned per page. By default the number of records returned is 10.
const orderBy =  'AssetName';  // {String} Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
const sortDirection =  'ASC';  // {String} ASC or DESC
const filterBy =  'Draft';  // {String} 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.

try {
  const response: any = await xero.accountingApi.getAssets(xeroTenantId, status,  page, pageSize, orderBy, sortDirection, filterBy);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
  console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}

using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;

namespace Example
{
    public class getAssetsExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: OAuth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AssetApi();
            var xeroTenantId = xeroTenantId_example;  // String | Xero identifier for Tenant (default to null)
            var status = Draft;  // String | Required when retrieving a collection of assets. See Asset Status Codes (default to null)
            var page = 1;  // Integer | Results are paged. This specifies which page of the results to return. The default page is 1. (optional)  (default to null)
            var pageSize = 5;  // Integer | The number of records returned per page. By default the number of records returned is 10. (optional)  (default to null)
            var orderBy = AssetName;  // String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. (optional)  (default to null)
            var sortDirection = ASC;  // String | ASC or DESC (optional)  (default to null)
            var filterBy = Draft;  // String | 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. (optional)  (default to null)

            try
            {
                // searches fixed asset
                Assets result = apiInstance.getAssets(xeroTenantId, status, page, pageSize, orderBy, sortDirection, filterBy);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetApi.getAssets: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: OAuth2

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );	
$config->setHost("https://api.xero.com/api.xro/2.0");        

$xeroTenantId =  'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant

$apiInstance = new XeroAPI\XeroPHP\Api\AssetApi(
    new GuzzleHttp\Client(),
    $config
);

try { 
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->getAssets: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AssetApi;

# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = ::AssetApi->new();
my $xeroTenantId = xeroTenantId_example; # String | Xero identifier for Tenant
my $status = Draft; # String | Required when retrieving a collection of assets. See Asset Status Codes
my $page = 1; # Integer | Results are paged. This specifies which page of the results to return. The default page is 1.
my $pageSize = 5; # Integer | The number of records returned per page. By default the number of records returned is 10.
my $orderBy = AssetName; # String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
my $sortDirection = ASC; # String | ASC or DESC
my $filterBy = Draft; # String | 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.

eval { 
    my $result = $api_instance->getAssets(xeroTenantId => $xeroTenantId, status => $status, page => $page, pageSize => $pageSize, orderBy => $orderBy, sortDirection => $sortDirection, filterBy => $filterBy);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetApi->getAssets: $@\n";
}
from __future__ import print_statement
import time
import 
from .rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = .AssetApi()
xeroTenantId = xeroTenantId_example # String | Xero identifier for Tenant (default to null)
status = Draft # String | Required when retrieving a collection of assets. See Asset Status Codes (default to null)
page = 1 # Integer | Results are paged. This specifies which page of the results to return. The default page is 1. (optional) (default to null)
pageSize = 5 # Integer | The number of records returned per page. By default the number of records returned is 10. (optional) (default to null)
orderBy = AssetName # String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. (optional) (default to null)
sortDirection = ASC # String | ASC or DESC (optional) (default to null)
filterBy = Draft # String | 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. (optional) (default to null)

try: 
    # searches fixed asset
    api_response = api_instance.get_assets(xeroTenantId, status, page=page, pageSize=pageSize, orderBy=orderBy, sortDirection=sortDirection, filterBy=filterBy)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetApi->getAssets: %s\n" % e)
extern crate AssetApi;

pub fn main() {
    let xeroTenantId = xeroTenantId_example; // String
    let status = Draft; // String
    let page = 1; // Integer
    let pageSize = 5; // Integer
    let orderBy = AssetName; // String
    let sortDirection = ASC; // String
    let filterBy = Draft; // String

    let mut context = AssetApi::Context::default();
    let result = client.getAssets(xeroTenantId, status, page, pageSize, orderBy, sortDirection, filterBy, &context).wait();
    println!("{:?}", result);

}

Scopes

assets.read

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
status*
String
Required when retrieving a collection of assets. See Asset Status Codes
Required
page
Integer
Results are paged. This specifies which page of the results to return. The default page is 1.
pageSize
Integer
The number of records returned per page. By default the number of records returned is 10.
orderBy
String
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
ASC or DESC
filterBy
String
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.