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
| Property | Description | Remarks |
|---|---|---|
| customerContext | Customer context which consists of the lease company and the customer | |
| assetId | CHG asset id | |
| description | CHG asset description | |
| class | CHG asset class | See also asset classes |
| category | CHG asset category | Possible enum values: hardware, software, service |
| leaseScheduleId | CHG lease schedule number | |
| leaseStartDate | Lease start date for the asset | |
| plannedLeaseEndDate | Future lease end of the asset | |
| actualLeaseEndDate | Financial lease end of the asset | |
| minimumLeaseTermEndDate | Minimum lease term of the asset | |
| serialNumber | Serial number, used as an identifier for data exchange | Editable via PATCH |
| technicalSpecifications | The technical data of the asset | |
| location | Customer installation data (invoice relevant) | Editable via PATCH |
| locationOfInstallation | Customer installation data (invoice relevant) | Editable via PATCH |
| orderNumber | Customer installation data (invoice relevant) | Editable via PATCH |
| costCenter | Customer installation data (invoice relevant) | Editable via PATCH |
| manufacturer | CHG manufacturer id | See also manufacturers |
| contractStatus | CHG asset lease status | Possible enum values: confirmationPending, confirmed, inLease, terminated |
| collectionNumber | CHG collection number | |
| eolFlagUserId | Last request user id | |
| eolFlagDate | Last request flag date | |
| eolFlagType | End of life request type | Possible enum values: extension, buyOut, collection, markForCollection |
| isCarbonZero | Carbon Zero certified | |
| deinstallationDate | Technical end of life date of the asset (date of goods receipt) | |
| installationCertificate | CHG acceptance certifacte number | |
| offleaseType | End of Life state | Possible enum values: stock, followUpLease, derecognition, buyout |
| invoiceGroupNumber | CHG invoice group number | |
| leaseOrderNumber | Customer installation data (invoice relevant) | |
| leaseDepartment | Customer installation data (invoice relevant) | |
| periodicalPrice | Leasing price for the current period (determined by field usagePeriod) | |
| usagePeriod | The current payment/usage period | Possible enum values: monthly, quarterly, semiyearly, yearly |
| currency | Currency of current periodicalPrice | ISO 4217 Code, e.g. EUR |
| customerSpecificFields | Customer installation data (not invoice relevant) | See next chapter |
| street | Asset location: street | Only provided for assets located in the US for tax reasons |
| street2 | Asset location: street appendix | Only provided for assets located in the US for tax reasons |
| postcode | Asset location: postcode | Only provided for assets located in the US for tax reasons |
| city | Asset location: city | Only provided for assets located in the US for tax reasons |
| federalState | Asset location: federal state | Only 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:
- All assets in extension:
filter=[["minimumLeaseTermEndDate","<","plannedLeaseEndDate"],"and",["actualLeaseEndDate","=",null]]&skip=0&take=100 - 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-31but just in absolute units) - 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