createAsset
adds a fixed asset
Adds an asset to the system
/Assets
Usage and SDK Samples
using System;
using System.Diagnostics;
using Xero.NetStandard.OAuth2.Api;
using Xero.NetStandard.OAuth2.Client;
using Xero.NetStandard.OAuth2.Model;
namespace Example
{
public class CreateAssetExample
{
public async Task Main()
{
var accessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new AssetApi();
var xeroTenantId = "YOUR_XERO_TENANT_ID";
var idempotencyKey = "KEY_VALUE";
var asset = new Asset();
asset.assetName = "AssetName";
asset.assetNumber = "AssetNumber";
asset.Status = AssetStatus.Draft;
try {
var result = await apiInstance.CreateAssetAsync(accessToken, xeroTenantId, asset, idempotencyKey);
Console.WriteLine(result);
}
catch (Exception e)
{
Console.WriteLine("Exception when calling apiInstance.CreateAsset: " + e.Message );
}
}
}
}
Scopes
assets | Grant read-write access to fixed assets |
Parameters
Name | Description |
---|---|
xero-tenant-id* |
String
Xero identifier for Tenant
Required
|
Idempotency-Key |
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
Name | Description |
---|---|
asset * |
Asset
Fixed asset you are creating
Required
|