createAsset
adds a fixed asset
Adds an asset to the system
/Assets
Usage and SDK Samples
import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AssetApi;
import org.openapitools.client.models.asset.*;
import java.io.File;
import java.util.*;
public class AssetApiExample {
private AssetApi apiInstance;
public static void main(String[] args) {
String accessToken = "YOUR_ACCESS_TOKEN";
ApiClient defaultClient = new ApiClient();
apiInstance = AccountingApi.getInstance(defaultClient);
String xeroTenantId = 'YOUR_XERO_TENANT_ID';
String idempotencyKey = 'KEY_VALUE';
Asset asset = new Asset();
asset.setassetName("Other Computer");
asset.setassetNumber("FA-00210");
asset.setStatus(com.xero.models.assets.AssetStatus.DRAFT);
try {
Asset result = apiInstance.createAsset(accessToken, xeroTenantId, asset, idempotencyKey);
System.out.println(result);
} catch (XeroException e) {
System.err.println("Exception when calling AssetApi#createAsset");
e.printStackTrace();
}
}
}
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
|