createAsset
adds a fixed asset
Adds an asset to the system
/Assets
Usage and SDK Samples
# configure api_client for use with xero-python sdk client
api_client = ApiClient(
Configuration(
debug=false,
oauth2_token=OAuth2Token(
client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET"
),
),
pool_threads=1,
)
api_client.set_oauth2_token("YOUR_ACCESS_TOKEN")
def accounting_create_asset():
api_instance = AssetApi(api_client)
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'
asset = Asset(
asset_name = "Other Computer",
asset_number = "FA-00210",
status = "Draft")
try:
api_response = api_instance.create_asset(xero_tenant_id, asset, idempotency_key)
print(api_response)
except AccountingBadRequestException as e:
print("Exception when calling AssetApi->createAsset: %s\n" % e)
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
|