Assets

This article explains the fields contained in responses and requests sent from and to the lease asset API endpoint.

General information

The general asset response contains all properties and is therefore used to describe the meaning of the field values. An example of a single asset may look like this:

"customerContext": {
  "customerName": "Testcompany Inc",
  "leaseCompanyName": "CHG-MERIDIAN USA Corp.",
  "customerNumber": 903544,
  "leaseCompany": 47
},
"assetId": 41100005,
"description": "PC-System EliteDesk 800 G2",
"class": "PCS",
"category": "hardware",
"leaseScheduleId": 2894568,
"leaseStartDate": "2021-06-01",
"plannedLeaseEndDate": "2024-05-31",
"actualLeaseEndDate": null,
"minimumLeaseTermEndDate": "2024-05-31",
"serialNumber": "8CC0151BPZ",
"technicalSpecifications": "Intel Quad Core i5, 256GB SSD, 8GB RAM, Win 10 Pro",
"location": "Office West Floor 3",
"locationOfInstallation": "New York CCity",
"orderNumber": "ORD12345",
"costCenter": "CC37548",
"manufacturer": "HP",
"contractStatus": "inLease",
"collectionNumber": null,
"eolFlagUserId": 1008,
"eolFlagDate": "2022-09-14T12:56:32.143Z",
"eolFlagType": "collection",
"isCarbonZero": false,
"deinstallationDate": null,
"installationCertificate": 1742508,
"offleaseType": null,
"invoiceGroupNumber": 5064,
"leaseOrderNumber": "4400010521",
"leaseDepartment": "Sales",
"periodicalPrice": 14.36,
"usagePeriod": "monthly",
"currency": "EUR",
"customerSpecificFields": {
  "Installation date": "2022-08-01",
  "Employee ID": "777",
  "Position": "Assistant to the regional manager"
},
"street": "8001 Test Drive",
"street2": "Building 3",
"postcode": "10507",
"city": "New York City, NY",
"federalState": "New York"

A lease asset is uniquely identified by a combination of the leaseCompany, leaseScheduleId and assetId.

Asset properties

PropertyDescriptionRemarks
customerContextCustomer context which consists of the lease company and the customer
assetIdCHG asset id
descriptionCHG asset description
classCHG asset classSee also asset classes
categoryCHG asset categoryPossible enum values: hardware, software, service
leaseScheduleIdCHG lease schedule number
leaseStartDateLease start date for the asset
plannedLeaseEndDateFuture lease end of the asset
actualLeaseEndDateFinancial lease end of the asset
minimumLeaseTermEndDateMinimum lease term of the asset
serialNumberSerial number, used as an identifier for data exchangeEditable via PATCH
technicalSpecificationsThe technical data of the asset
locationCustomer installation data (invoice relevant)Editable via PATCH
locationOfInstallationCustomer installation data (invoice relevant)Editable via PATCH
orderNumberCustomer installation data (invoice relevant)Editable via PATCH
costCenterCustomer installation data (invoice relevant)Editable via PATCH
manufacturerCHG manufacturer idSee also manufacturers
contractStatusCHG asset lease statusPossible enum values: confirmationPending, confirmed, inLease, terminated
collectionNumberCHG collection number
eolFlagUserIdLast request user id
eolFlagDateLast request flag date
eolFlagTypeEnd of life request typePossible enum values: extension, buyOut, collection, markForCollection
isCarbonZeroCarbon Zero certified
deinstallationDateTechnical end of life date of the asset (date of goods receipt)
installationCertificateCHG acceptance certifacte number
offleaseTypeEnd of Life statePossible enum values: stock, followUpLease, derecognition, buyout
invoiceGroupNumberCHG invoice group number
leaseOrderNumberCustomer installation data (invoice relevant)
leaseDepartmentCustomer installation data (invoice relevant)
periodicalPriceLeasing price for the current period (determined by field usagePeriod)
usagePeriodThe current payment/usage periodPossible enum values: monthly, quarterly, semiyearly, yearly
currencyCurrency of current periodicalPriceISO 4217 Code, e.g. EUR
customerSpecificFieldsCustomer installation data (not invoice relevant)See next chapter
streetAsset location: streetOnly provided for assets located in the US for tax reasons
street2Asset location: street appendixOnly provided for assets located in the US for tax reasons
postcodeAsset location: postcodeOnly provided for assets located in the US for tax reasons
cityAsset location: cityOnly provided for assets located in the US for tax reasons
federalStateAsset location: federal stateOnly provided for assets located in the US for tax reasons

Customer specific fields

As the name already inplies, this is a dynamic part of the asset which is different for every tesma customer. Initially the property customerSpecificFields will be null.

If you need special free fields, please contact the tesma support and they will add those as you need them. Please provide them with the name of the property and whether the property should be a string or a date type. After the customer specific fields have been set up by the support, they are also editable via a PATCH request.

Example requests

All units with financial changes

We recommend a three-step request to identify all relevant assets:

  1. All assets in extension: filter=[["minimumLeaseTermEndDate","<","plannedLeaseEndDate"],"and",["actualLeaseEndDate","=",null]]&skip=0&take=100
  2. All terminated assets in the last month: filter=[["contractStatus","=","terminated"],"and",["actualLeaseEndDate","<=","2023-01-01"]]&skip=0&take=100 (the compare value for actualLeaseEndDate can not be passed in a way like -31 but just in absolute units)
  3. All new assets with lease start date next month: filter=[["leaseStartDate",">=","2023-01-01"]]&skip=0&take=100

Identify an existing asset in the customer system in tesma.

This is best done via querying the serial number, meaning filter=[["serialNumber","<>",null]]&skip=0&take=100 or filter=[["serialNumber","=","12345"]] if you already know the serial number.

All expiring Assets in the next x days

This can be achieved using the parameters filter=[["contractStatus","=","inLease"],"and",["plannedLeaseEndDate","<=","2023-03-01"]]&skip=0&take=100 where 2023-03-01 is today plus x days.

All assets that originate from a follow up lease schedule

Query for the offLeaseType followUpLease and leaseStartDate greater than start of next month, e.g. filter=[["offLeaseType","=","followUpLease"],"and",["leaseStartDate",">=","2023-01-01"]]&skip=0&take=100

Load all assets

We recommend creating one request to determine the total number of assets by requesting /leases/assets?isCountQuery=true which will produce this output:

{
    "data": null,
    "totalCount": 130396
}

Afterwards, you can use sorting and paging to load the assets in chunks. You can define the chunk size depending on the capacity of your system, but we do not recommend loading more than 10000 assets in one request.

So you could go on with the following requests:

  • /leases/assets?sort=[{"selector":"assetId"}]&skip=0&take=10000
  • /leases/assets?sort=[{"selector":"assetId"}]&skip=10000&take=10000
  • /leases/assets?sort=[{"selector":"assetId"}]&skip=20000&take=10000
  • ...
  • /leases/assets?sort=[{"selector":"assetId"}]&skip=130000&take=396