Create trailer
Register a company-owned trailer in Alvys with its trailer number, equipment type and size, VIN, plates, capacity, reefer, insurance, and ELD links.
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/trailers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"TrailerNum": "<string>",
"EquipmentType": "<string>",
"EquipmentSize": "<string>",
"VinNum": "<string>",
"Year": 123,
"Make": "<string>",
"LicenseNum": "<string>",
"LicenseState": "<string>",
"LicenseCountry": "<string>",
"LicenseExpiresAt": "2023-12-25",
"PlatesExpire": true,
"Status": "<string>",
"SubsidiaryId": "<string>",
"FleetId": "<string>",
"Capacity": {
"Pallets": 123,
"Weight": 123
},
"ReeferMake": "<string>",
"NumberOfAxles": 123,
"EmptyWeight": {
"Value": 123
},
"Dimensions": {
"Height": {
"Value": 123
},
"Width": {
"Value": 123
},
"Length": {
"Value": 123
}
},
"GrossVehicleWeightRating": {
"Value": 123
},
"TireCount": 123,
"Reefer": {
"FuelBurnPerHour": 123,
"TankCapacity": {
"Value": 123
}
},
"InsuranceCompany": "<string>",
"InsurancePolicyNumber": "<string>",
"InsuranceExpiresAt": "2023-12-25",
"InspectionExpiresAt": "2023-12-25",
"InsuranceValue": 123,
"LeasedFrom": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"LeasedTo": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"OwnerOperatorId": "<string>",
"TireSize": "<string>",
"EldProviders": [
{
"IntegrationType": "<string>",
"Id": "<string>",
"DatagateWayId": "<string>",
"SensorId": "<string>"
}
],
"References": [
{
"Id": "<string>",
"TenantReferenceId": "<string>",
"Value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
TrailerNum: '<string>',
EquipmentType: '<string>',
EquipmentSize: '<string>',
VinNum: '<string>',
Year: 123,
Make: '<string>',
LicenseNum: '<string>',
LicenseState: '<string>',
LicenseCountry: '<string>',
LicenseExpiresAt: '2023-12-25',
PlatesExpire: true,
Status: '<string>',
SubsidiaryId: '<string>',
FleetId: '<string>',
Capacity: {Pallets: 123, Weight: 123},
ReeferMake: '<string>',
NumberOfAxles: 123,
EmptyWeight: {Value: 123},
Dimensions: {Height: {Value: 123}, Width: {Value: 123}, Length: {Value: 123}},
GrossVehicleWeightRating: {Value: 123},
TireCount: 123,
Reefer: {FuelBurnPerHour: 123, TankCapacity: {Value: 123}},
InsuranceCompany: '<string>',
InsurancePolicyNumber: '<string>',
InsuranceExpiresAt: '2023-12-25',
InspectionExpiresAt: '2023-12-25',
InsuranceValue: 123,
LeasedFrom: {
CompanyId: '<string>',
DriverName: '<string>',
StartDate: '2023-12-25',
EndDate: '2023-12-25'
},
LeasedTo: {
CompanyId: '<string>',
DriverName: '<string>',
StartDate: '2023-12-25',
EndDate: '2023-12-25'
},
StartDate: '2023-12-25',
EndDate: '2023-12-25',
OwnerOperatorId: '<string>',
TireSize: '<string>',
EldProviders: [
{
IntegrationType: '<string>',
Id: '<string>',
DatagateWayId: '<string>',
SensorId: '<string>'
}
],
References: [{Id: '<string>', TenantReferenceId: '<string>', Value: '<string>'}]
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/trailers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/trailers"
payload = {
"TrailerNum": "<string>",
"EquipmentType": "<string>",
"EquipmentSize": "<string>",
"VinNum": "<string>",
"Year": 123,
"Make": "<string>",
"LicenseNum": "<string>",
"LicenseState": "<string>",
"LicenseCountry": "<string>",
"LicenseExpiresAt": "2023-12-25",
"PlatesExpire": True,
"Status": "<string>",
"SubsidiaryId": "<string>",
"FleetId": "<string>",
"Capacity": {
"Pallets": 123,
"Weight": 123
},
"ReeferMake": "<string>",
"NumberOfAxles": 123,
"EmptyWeight": { "Value": 123 },
"Dimensions": {
"Height": { "Value": 123 },
"Width": { "Value": 123 },
"Length": { "Value": 123 }
},
"GrossVehicleWeightRating": { "Value": 123 },
"TireCount": 123,
"Reefer": {
"FuelBurnPerHour": 123,
"TankCapacity": { "Value": 123 }
},
"InsuranceCompany": "<string>",
"InsurancePolicyNumber": "<string>",
"InsuranceExpiresAt": "2023-12-25",
"InspectionExpiresAt": "2023-12-25",
"InsuranceValue": 123,
"LeasedFrom": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"LeasedTo": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"OwnerOperatorId": "<string>",
"TireSize": "<string>",
"EldProviders": [
{
"IntegrationType": "<string>",
"Id": "<string>",
"DatagateWayId": "<string>",
"SensorId": "<string>"
}
],
"References": [
{
"Id": "<string>",
"TenantReferenceId": "<string>",
"Value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/trailers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TrailerNum' => '<string>',
'EquipmentType' => '<string>',
'EquipmentSize' => '<string>',
'VinNum' => '<string>',
'Year' => 123,
'Make' => '<string>',
'LicenseNum' => '<string>',
'LicenseState' => '<string>',
'LicenseCountry' => '<string>',
'LicenseExpiresAt' => '2023-12-25',
'PlatesExpire' => true,
'Status' => '<string>',
'SubsidiaryId' => '<string>',
'FleetId' => '<string>',
'Capacity' => [
'Pallets' => 123,
'Weight' => 123
],
'ReeferMake' => '<string>',
'NumberOfAxles' => 123,
'EmptyWeight' => [
'Value' => 123
],
'Dimensions' => [
'Height' => [
'Value' => 123
],
'Width' => [
'Value' => 123
],
'Length' => [
'Value' => 123
]
],
'GrossVehicleWeightRating' => [
'Value' => 123
],
'TireCount' => 123,
'Reefer' => [
'FuelBurnPerHour' => 123,
'TankCapacity' => [
'Value' => 123
]
],
'InsuranceCompany' => '<string>',
'InsurancePolicyNumber' => '<string>',
'InsuranceExpiresAt' => '2023-12-25',
'InspectionExpiresAt' => '2023-12-25',
'InsuranceValue' => 123,
'LeasedFrom' => [
'CompanyId' => '<string>',
'DriverName' => '<string>',
'StartDate' => '2023-12-25',
'EndDate' => '2023-12-25'
],
'LeasedTo' => [
'CompanyId' => '<string>',
'DriverName' => '<string>',
'StartDate' => '2023-12-25',
'EndDate' => '2023-12-25'
],
'StartDate' => '2023-12-25',
'EndDate' => '2023-12-25',
'OwnerOperatorId' => '<string>',
'TireSize' => '<string>',
'EldProviders' => [
[
'IntegrationType' => '<string>',
'Id' => '<string>',
'DatagateWayId' => '<string>',
'SensorId' => '<string>'
]
],
'References' => [
[
'Id' => '<string>',
'TenantReferenceId' => '<string>',
'Value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/trailers"
payload := strings.NewReader("{\n \"TrailerNum\": \"<string>\",\n \"EquipmentType\": \"<string>\",\n \"EquipmentSize\": \"<string>\",\n \"VinNum\": \"<string>\",\n \"Year\": 123,\n \"Make\": \"<string>\",\n \"LicenseNum\": \"<string>\",\n \"LicenseState\": \"<string>\",\n \"LicenseCountry\": \"<string>\",\n \"LicenseExpiresAt\": \"2023-12-25\",\n \"PlatesExpire\": true,\n \"Status\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"FleetId\": \"<string>\",\n \"Capacity\": {\n \"Pallets\": 123,\n \"Weight\": 123\n },\n \"ReeferMake\": \"<string>\",\n \"NumberOfAxles\": 123,\n \"EmptyWeight\": {\n \"Value\": 123\n },\n \"Dimensions\": {\n \"Height\": {\n \"Value\": 123\n },\n \"Width\": {\n \"Value\": 123\n },\n \"Length\": {\n \"Value\": 123\n }\n },\n \"GrossVehicleWeightRating\": {\n \"Value\": 123\n },\n \"TireCount\": 123,\n \"Reefer\": {\n \"FuelBurnPerHour\": 123,\n \"TankCapacity\": {\n \"Value\": 123\n }\n },\n \"InsuranceCompany\": \"<string>\",\n \"InsurancePolicyNumber\": \"<string>\",\n \"InsuranceExpiresAt\": \"2023-12-25\",\n \"InspectionExpiresAt\": \"2023-12-25\",\n \"InsuranceValue\": 123,\n \"LeasedFrom\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"LeasedTo\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\",\n \"OwnerOperatorId\": \"<string>\",\n \"TireSize\": \"<string>\",\n \"EldProviders\": [\n {\n \"IntegrationType\": \"<string>\",\n \"Id\": \"<string>\",\n \"DatagateWayId\": \"<string>\",\n \"SensorId\": \"<string>\"\n }\n ],\n \"References\": [\n {\n \"Id\": \"<string>\",\n \"TenantReferenceId\": \"<string>\",\n \"Value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://integrations.alvys.com/api/p/v{version}/trailers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"TrailerNum\": \"<string>\",\n \"EquipmentType\": \"<string>\",\n \"EquipmentSize\": \"<string>\",\n \"VinNum\": \"<string>\",\n \"Year\": 123,\n \"Make\": \"<string>\",\n \"LicenseNum\": \"<string>\",\n \"LicenseState\": \"<string>\",\n \"LicenseCountry\": \"<string>\",\n \"LicenseExpiresAt\": \"2023-12-25\",\n \"PlatesExpire\": true,\n \"Status\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"FleetId\": \"<string>\",\n \"Capacity\": {\n \"Pallets\": 123,\n \"Weight\": 123\n },\n \"ReeferMake\": \"<string>\",\n \"NumberOfAxles\": 123,\n \"EmptyWeight\": {\n \"Value\": 123\n },\n \"Dimensions\": {\n \"Height\": {\n \"Value\": 123\n },\n \"Width\": {\n \"Value\": 123\n },\n \"Length\": {\n \"Value\": 123\n }\n },\n \"GrossVehicleWeightRating\": {\n \"Value\": 123\n },\n \"TireCount\": 123,\n \"Reefer\": {\n \"FuelBurnPerHour\": 123,\n \"TankCapacity\": {\n \"Value\": 123\n }\n },\n \"InsuranceCompany\": \"<string>\",\n \"InsurancePolicyNumber\": \"<string>\",\n \"InsuranceExpiresAt\": \"2023-12-25\",\n \"InspectionExpiresAt\": \"2023-12-25\",\n \"InsuranceValue\": 123,\n \"LeasedFrom\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"LeasedTo\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\",\n \"OwnerOperatorId\": \"<string>\",\n \"TireSize\": \"<string>\",\n \"EldProviders\": [\n {\n \"IntegrationType\": \"<string>\",\n \"Id\": \"<string>\",\n \"DatagateWayId\": \"<string>\",\n \"SensorId\": \"<string>\"\n }\n ],\n \"References\": [\n {\n \"Id\": \"<string>\",\n \"TenantReferenceId\": \"<string>\",\n \"Value\": \"<string>\"\n }\n ]\n}")
.asString();{
"Id": "<string>",
"TrailerNum": "<string>",
"Status": "<string>",
"Notes": [
{
"id": "<string>",
"Description": "<string>",
"NoteType": "<string>",
"User": "<string>",
"Time": "2023-11-07T05:31:56Z",
"UserId": "<string>"
}
],
"CreatedAt": "2023-11-07T05:31:56Z",
"Fleet": {
"Id": "<string>",
"Name": "<string>",
"InvoiceNumberPrefix": "<string>"
},
"Year": 123,
"Make": "<string>",
"LicenseNum": "<string>",
"LicenseState": "<string>",
"LicenseCountry": "<string>",
"PlateExpiresAt": "2023-12-25",
"LicenseExpiresAt": "2023-12-25",
"VinNum": "<string>",
"SubsidiaryId": "<string>",
"EquipmentType": "<string>",
"EquipmentSize": "<string>",
"Capacity": {
"Pallets": 123,
"Weight": 123
},
"InsuranceCompany": "<string>",
"InsurancePolicyNumber": "<string>",
"InsuranceExpiresAt": "2023-12-25",
"InspectionExpiresAt": "2023-12-25",
"References": [
{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<string>"
}
],
"CompanyOwnedAsset": true,
"PlatesExpire": true,
"ReeferMake": "<string>",
"InsuranceValue": 123,
"LeasedFrom": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"LeasedTo": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"NumberOfAxles": 123,
"EmptyWeight": {
"Value": 123,
"UnitOfMeasure": "Kilograms"
},
"Dimensions": {
"Height": {
"Value": 123,
"Unit": "Feet"
},
"Width": {
"Value": 123,
"Unit": "Feet"
},
"Length": {
"Value": 123,
"Unit": "Feet"
}
},
"GrossVehicleWeightRating": {
"Value": 123,
"UnitOfMeasure": "Kilograms"
},
"TireCount": 123,
"Reefer": {
"FuelBurnPerHour": 123,
"TankCapacity": {
"Value": 123,
"UnitOfMeasure": "Gallons"
}
}
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}ETag response header. Send that value in the If-Match header of a later Update trailer request. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
trailer:create scope. See Authentication.Equipment type and size are required
EquipmentType and EquipmentSize are required. A trailer without them never matches the equipment requirement of a load. EquipmentType is an Alvys equipment type such as Van, Reefer, or Flatbed, matched case-insensitively. EquipmentSize is the length in feet, for example 53 or 53'.
Trailer number and VIN must be unique
TrailerNum must be unique among your company’s trailers. When you supply VinNum, it must be unique too. A request that would create a duplicate is rejected with 409 Conflict, and the problem type tells you which value clashed:
Problem type | Cause |
|---|---|
https://api.alvys.com/errors/Conflict/DuplicateAssetNumber | Another trailer in your company has this TrailerNum. |
https://api.alvys.com/errors/Conflict/DuplicateVin | Another trailer in your company has this VinNum. |
trailer:read scope, find it with Search trailers and update that record instead. This lets an onboarding job that runs twice reconcile with what it already created.
Subsidiary
SubsidiaryId must be a subsidiary that your credential may write to. Get the ids from List subsidiaries. If the credential can write to exactly one subsidiary, you can omit SubsidiaryId and the trailer is created in that subsidiary.
Trailer status
Status is shown in the dispatch planner. It does not by itself block dispatch. A maintenance work order started in Alvys moves the trailer to In Shop, and back to Active when the work order completes. Crashed and Inactive remove the trailer from the ELD live map and from the trailer lists you pick from in Alvys.
Request parameters
The following parameter is required in the URL path:| Parameter | Type | Required | Description |
|---|---|---|---|
| version | String | Yes | The version of the API. |
Request body
TrailerNum, EquipmentType, and EquipmentSize are required. Dates are date-only values in yyyy-MM-dd format.
| Field | Type | Required | Description |
|---|---|---|---|
| TrailerNum | String | Yes | The trailer number. Must be unique among your company’s trailers. |
| EquipmentType | String | Yes | The Alvys equipment type, for example Van, Reefer, or Flatbed. Case-insensitive. |
| EquipmentSize | String | Yes | The length in feet, for example 53 or 53'. |
| VinNum | String | No | The Vehicle Identification Number (VIN). Must be unique among your company’s trailers. |
| Year | Integer | No | The manufacturing year of the trailer. |
| Make | String | No | The make of the trailer. |
| LicenseNum | String | No | The license plate number of the trailer. |
| LicenseState | String | No | The state where the trailer is licensed. |
| LicenseCountry | String | No | The country where the trailer is licensed. |
| LicenseExpiresAt | String (Date) | No | The plate registration expiration date (“License Expiration” in Alvys). |
| PlatesExpire | Boolean | No | Whether the plates expire (“Plates Expire” in Alvys). |
| Status | String | No | One of Active, Planned, Temporary, Repair, In Shop, Leased Out, Crashed, Inactive (case-insensitive). Defaults to Active. |
| SubsidiaryId | String | No | The subsidiary of the trailer. See Subsidiary. |
| FleetId | String | No | An active fleet of your account, as returned in Fleet.Id by List trailers. |
| Capacity | Object | No | The load capacity of the trailer. |
| Capacity.Pallets | Integer | No | The number of pallets the trailer can carry. |
| Capacity.Weight | Number | No | The maximum payload, in pounds. |
| NumberOfAxles | Integer | No | The number of axles on the trailer. |
| EmptyWeight | Object | No | The empty (tare) weight, with Value (Number) and UnitOfMeasure (Pounds, Kilograms, Grams, Ounces, Tons, CWT, MetricTon, or LongTon). Stored and returned in pounds. |
| GrossVehicleWeightRating | Object | No | The gross vehicle weight rating, with Value and UnitOfMeasure as in EmptyWeight. The maximum payload stays on Capacity.Weight. |
| Dimensions | Object | No | The outside dimensions for the routing vehicle profile. |
| Dimensions.Height | Object | No | The height, with Value (Number) and Unit (Feet, Inches, Yards, or Meters). |
| Dimensions.Width | Object | No | The width, with Value and Unit. |
| Dimensions.Length | Object | No | The length, with Value and Unit. |
| TireCount | Integer | No | The number of tires on the trailer. |
| TireSize | String | No | The tire size, free text (for example 295/75R22.5). |
| ReeferMake | String | No | The make of the reefer unit. |
| Reefer | Object | No | The fuel use of the reefer unit. |
| Reefer.FuelBurnPerHour | Number | No | The fuel burned per hour, in gallons. |
| Reefer.TankCapacity | Object | No | The capacity of the reefer tank, with Value (Number) and UnitOfMeasure (for example Gallons or Liters). |
| InsuranceCompany | String | No | The name of the insurance company. |
| InsurancePolicyNumber | String | No | The insurance policy number. |
| InsuranceExpiresAt | String (Date) | No | The expiration date of the insurance policy. |
| InsuranceValue | Number | No | The insured value of the trailer. |
| InspectionExpiresAt | String (Date) | No | The expiration date of the annual inspection. |
| LeasedFrom | Object | No | The lease under which your company holds the trailer. |
| LeasedFrom.CompanyId | String | No | The id of the company the trailer is leased from. Must be a company in your account. |
| LeasedFrom.DriverName | String | No | The driver name recorded on the lease. |
| LeasedFrom.StartDate | String (Date) | No | The start date of the lease. |
| LeasedFrom.EndDate | String (Date) | No | The end date of the lease. |
| LeasedTo | Object | No | The lease under which your company leases the trailer to another company. Same fields as LeasedFrom. |
| StartDate | String (Date) | No | The date the trailer entered service. |
| EndDate | String (Date) | No | The date the trailer left service. |
| OwnerOperatorId | String | No | The driver id of the owner operator the trailer belongs to (“Assigned to Owner Operator” in Alvys). The driver must exist in your account with contractor type Owner Operator. |
| EldProviders | Array | No | The ELD links of the trailer. One link per integration. |
| EldProviders.IntegrationType | String | No | The ELD integration by its Alvys name (for example Samsara, Motive, or Orbcomm). Case-insensitive. |
| EldProviders.Id | String | No | The id of the trailer in that provider. |
| EldProviders.DatagateWayId | String | No | Orbcomm only: the data gateway id of the device. Rejected for any other integration. |
| EldProviders.SensorId | String | No | The sensor id on the device. |
| References | Array | No | The custom references of the trailer. |
| References.TenantReferenceId | String | Yes | The Id of a trailer reference definition of your company. Get it from List custom reference definitions with entities=Trailer. |
| References.Value | String | No | The value, checked against the type of the definition: true or false for Bool, a date (yyyy-MM-dd) for Date, one of the definition’s values for List. |
Example cURL request
curl --location 'https://integrations.alvys.com/api/p/v1/trailers' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"TrailerNum": "TR-932",
"EquipmentType": "Reefer",
"EquipmentSize": "53",
"VinNum": "1JJV532D2PL000932",
"Year": 2023,
"Make": "Utility",
"LicenseNum": "TRL5678",
"LicenseState": "TX",
"LicenseCountry": "USA",
"SubsidiaryId": "a1b2c3d4-0000-0000-0000-000000000001",
"Capacity": { "Pallets": 26, "Weight": 45000 },
"NumberOfAxles": 2,
"ReeferMake": "Thermo King",
"Reefer": {
"FuelBurnPerHour": 0.8,
"TankCapacity": { "Value": 50, "UnitOfMeasure": "Gallons" }
},
"TireSize": "295/75R22.5",
"StartDate": "2026-11-01"
}'
YOUR_ACCESS_TOKEN with your actual Bearer token.
Response fields
A successful request returns201 Created with the new trailer, in the same shape as Get trailer. The trailer’s current ETag is in the ETag response header.
Example response
201 Created{
"Id": "TR100000000000000932",
"TrailerNum": "TR-932",
"Year": 2023,
"Make": "Utility",
"LicenseNum": "TRL5678",
"LicenseState": "TX",
"LicenseCountry": "USA",
"VinNum": "1JJV532D2PL000932",
"Status": "Active",
"SubsidiaryId": "a1b2c3d4-0000-0000-0000-000000000001",
"EquipmentType": "Reefer",
"EquipmentSize": "53",
"Capacity": { "Pallets": 26, "Weight": 45000 },
"CreatedAt": "2026-11-13T15:04:05.000Z",
"CompanyOwnedAsset": true,
"ReeferMake": "Thermo King",
"StartDate": "2026-11-01",
"NumberOfAxles": 2,
"Reefer": {
"FuelBurnPerHour": 0.8,
"TankCapacity": { "Value": 50, "UnitOfMeasure": "Gallons" }
}
}
Status codes
| Status | Meaning |
|---|---|
| 201 | The trailer was created. |
| 400 | The request body failed validation. The response lists the invalid fields. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks the trailer:create scope. |
| 409 | Another trailer in your company has the same TrailerNum (DuplicateAssetNumber) or VinNum (DuplicateVin). |
| 422 | A referenced record is not usable. See Why a request is refused with 422. |
| 429 | The rate limit was exceeded. |
Why a request is refused with 422
The problemtype is https://api.alvys.com/errors/UnprocessableEntity/ followed by the reason:
| Reason | Cause |
|---|---|
SubsidiaryRequired | You omitted SubsidiaryId, and the credential can write to more than one subsidiary, or to none. |
SubsidiaryNotInScope | SubsidiaryId is not a subsidiary that this credential may write to. |
FleetNotFound | FleetId is not an active fleet of your account. |
LeaseCompanyNotFound | LeasedFrom.CompanyId or LeasedTo.CompanyId is not a company in your account. |
OwnerOperatorNotFound | OwnerOperatorId is not a driver in your account with contractor type Owner Operator. |
ReferenceDefinitionNotFound | A References.TenantReferenceId is not a trailer reference definition of your account. |
Rate limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the Rate Limits section. This page is interactive, allowing you to try a request by completing the fields for the parameters below. As you fill out the parameters, the CURL command on the right side of the page will be automatically updated.Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Body
One of Active, Planned, Temporary, Repair, In Shop, Leased Out, Crashed, Inactive (case-insensitive). Shown in the dispatch planner; does not by itself block dispatch. In Shop and Active are also written by the maintenance work-order sync. Crashed and Inactive remove the trailer from the ELD live map and from trailer pickers. Defaults to Active.
Driver id of the owner operator the asset belongs to ("Assigned to Owner Operator" in the app). The driver must exist in your account with contractor type Owner Operator. null unassigns the asset: it goes back to its subsidiary's carrier. On a truck, fuel cards with Deduct Fuel follow the change in the same write: they stop deducting when the truck leaves its owner operator, and deduct from the new one when it moves.
Response
Created
Whether this trailer is part of the company's own fleet. true is a company-owned trailer. false is an external trailer — a carrier's equipment recorded against a trip rather than an asset this tenant manages. The field is also absent or null on a small number of older external records, so treat anything other than true as external.
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/trailers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"TrailerNum": "<string>",
"EquipmentType": "<string>",
"EquipmentSize": "<string>",
"VinNum": "<string>",
"Year": 123,
"Make": "<string>",
"LicenseNum": "<string>",
"LicenseState": "<string>",
"LicenseCountry": "<string>",
"LicenseExpiresAt": "2023-12-25",
"PlatesExpire": true,
"Status": "<string>",
"SubsidiaryId": "<string>",
"FleetId": "<string>",
"Capacity": {
"Pallets": 123,
"Weight": 123
},
"ReeferMake": "<string>",
"NumberOfAxles": 123,
"EmptyWeight": {
"Value": 123
},
"Dimensions": {
"Height": {
"Value": 123
},
"Width": {
"Value": 123
},
"Length": {
"Value": 123
}
},
"GrossVehicleWeightRating": {
"Value": 123
},
"TireCount": 123,
"Reefer": {
"FuelBurnPerHour": 123,
"TankCapacity": {
"Value": 123
}
},
"InsuranceCompany": "<string>",
"InsurancePolicyNumber": "<string>",
"InsuranceExpiresAt": "2023-12-25",
"InspectionExpiresAt": "2023-12-25",
"InsuranceValue": 123,
"LeasedFrom": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"LeasedTo": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"OwnerOperatorId": "<string>",
"TireSize": "<string>",
"EldProviders": [
{
"IntegrationType": "<string>",
"Id": "<string>",
"DatagateWayId": "<string>",
"SensorId": "<string>"
}
],
"References": [
{
"Id": "<string>",
"TenantReferenceId": "<string>",
"Value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
TrailerNum: '<string>',
EquipmentType: '<string>',
EquipmentSize: '<string>',
VinNum: '<string>',
Year: 123,
Make: '<string>',
LicenseNum: '<string>',
LicenseState: '<string>',
LicenseCountry: '<string>',
LicenseExpiresAt: '2023-12-25',
PlatesExpire: true,
Status: '<string>',
SubsidiaryId: '<string>',
FleetId: '<string>',
Capacity: {Pallets: 123, Weight: 123},
ReeferMake: '<string>',
NumberOfAxles: 123,
EmptyWeight: {Value: 123},
Dimensions: {Height: {Value: 123}, Width: {Value: 123}, Length: {Value: 123}},
GrossVehicleWeightRating: {Value: 123},
TireCount: 123,
Reefer: {FuelBurnPerHour: 123, TankCapacity: {Value: 123}},
InsuranceCompany: '<string>',
InsurancePolicyNumber: '<string>',
InsuranceExpiresAt: '2023-12-25',
InspectionExpiresAt: '2023-12-25',
InsuranceValue: 123,
LeasedFrom: {
CompanyId: '<string>',
DriverName: '<string>',
StartDate: '2023-12-25',
EndDate: '2023-12-25'
},
LeasedTo: {
CompanyId: '<string>',
DriverName: '<string>',
StartDate: '2023-12-25',
EndDate: '2023-12-25'
},
StartDate: '2023-12-25',
EndDate: '2023-12-25',
OwnerOperatorId: '<string>',
TireSize: '<string>',
EldProviders: [
{
IntegrationType: '<string>',
Id: '<string>',
DatagateWayId: '<string>',
SensorId: '<string>'
}
],
References: [{Id: '<string>', TenantReferenceId: '<string>', Value: '<string>'}]
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/trailers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/trailers"
payload = {
"TrailerNum": "<string>",
"EquipmentType": "<string>",
"EquipmentSize": "<string>",
"VinNum": "<string>",
"Year": 123,
"Make": "<string>",
"LicenseNum": "<string>",
"LicenseState": "<string>",
"LicenseCountry": "<string>",
"LicenseExpiresAt": "2023-12-25",
"PlatesExpire": True,
"Status": "<string>",
"SubsidiaryId": "<string>",
"FleetId": "<string>",
"Capacity": {
"Pallets": 123,
"Weight": 123
},
"ReeferMake": "<string>",
"NumberOfAxles": 123,
"EmptyWeight": { "Value": 123 },
"Dimensions": {
"Height": { "Value": 123 },
"Width": { "Value": 123 },
"Length": { "Value": 123 }
},
"GrossVehicleWeightRating": { "Value": 123 },
"TireCount": 123,
"Reefer": {
"FuelBurnPerHour": 123,
"TankCapacity": { "Value": 123 }
},
"InsuranceCompany": "<string>",
"InsurancePolicyNumber": "<string>",
"InsuranceExpiresAt": "2023-12-25",
"InspectionExpiresAt": "2023-12-25",
"InsuranceValue": 123,
"LeasedFrom": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"LeasedTo": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"OwnerOperatorId": "<string>",
"TireSize": "<string>",
"EldProviders": [
{
"IntegrationType": "<string>",
"Id": "<string>",
"DatagateWayId": "<string>",
"SensorId": "<string>"
}
],
"References": [
{
"Id": "<string>",
"TenantReferenceId": "<string>",
"Value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/trailers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TrailerNum' => '<string>',
'EquipmentType' => '<string>',
'EquipmentSize' => '<string>',
'VinNum' => '<string>',
'Year' => 123,
'Make' => '<string>',
'LicenseNum' => '<string>',
'LicenseState' => '<string>',
'LicenseCountry' => '<string>',
'LicenseExpiresAt' => '2023-12-25',
'PlatesExpire' => true,
'Status' => '<string>',
'SubsidiaryId' => '<string>',
'FleetId' => '<string>',
'Capacity' => [
'Pallets' => 123,
'Weight' => 123
],
'ReeferMake' => '<string>',
'NumberOfAxles' => 123,
'EmptyWeight' => [
'Value' => 123
],
'Dimensions' => [
'Height' => [
'Value' => 123
],
'Width' => [
'Value' => 123
],
'Length' => [
'Value' => 123
]
],
'GrossVehicleWeightRating' => [
'Value' => 123
],
'TireCount' => 123,
'Reefer' => [
'FuelBurnPerHour' => 123,
'TankCapacity' => [
'Value' => 123
]
],
'InsuranceCompany' => '<string>',
'InsurancePolicyNumber' => '<string>',
'InsuranceExpiresAt' => '2023-12-25',
'InspectionExpiresAt' => '2023-12-25',
'InsuranceValue' => 123,
'LeasedFrom' => [
'CompanyId' => '<string>',
'DriverName' => '<string>',
'StartDate' => '2023-12-25',
'EndDate' => '2023-12-25'
],
'LeasedTo' => [
'CompanyId' => '<string>',
'DriverName' => '<string>',
'StartDate' => '2023-12-25',
'EndDate' => '2023-12-25'
],
'StartDate' => '2023-12-25',
'EndDate' => '2023-12-25',
'OwnerOperatorId' => '<string>',
'TireSize' => '<string>',
'EldProviders' => [
[
'IntegrationType' => '<string>',
'Id' => '<string>',
'DatagateWayId' => '<string>',
'SensorId' => '<string>'
]
],
'References' => [
[
'Id' => '<string>',
'TenantReferenceId' => '<string>',
'Value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/trailers"
payload := strings.NewReader("{\n \"TrailerNum\": \"<string>\",\n \"EquipmentType\": \"<string>\",\n \"EquipmentSize\": \"<string>\",\n \"VinNum\": \"<string>\",\n \"Year\": 123,\n \"Make\": \"<string>\",\n \"LicenseNum\": \"<string>\",\n \"LicenseState\": \"<string>\",\n \"LicenseCountry\": \"<string>\",\n \"LicenseExpiresAt\": \"2023-12-25\",\n \"PlatesExpire\": true,\n \"Status\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"FleetId\": \"<string>\",\n \"Capacity\": {\n \"Pallets\": 123,\n \"Weight\": 123\n },\n \"ReeferMake\": \"<string>\",\n \"NumberOfAxles\": 123,\n \"EmptyWeight\": {\n \"Value\": 123\n },\n \"Dimensions\": {\n \"Height\": {\n \"Value\": 123\n },\n \"Width\": {\n \"Value\": 123\n },\n \"Length\": {\n \"Value\": 123\n }\n },\n \"GrossVehicleWeightRating\": {\n \"Value\": 123\n },\n \"TireCount\": 123,\n \"Reefer\": {\n \"FuelBurnPerHour\": 123,\n \"TankCapacity\": {\n \"Value\": 123\n }\n },\n \"InsuranceCompany\": \"<string>\",\n \"InsurancePolicyNumber\": \"<string>\",\n \"InsuranceExpiresAt\": \"2023-12-25\",\n \"InspectionExpiresAt\": \"2023-12-25\",\n \"InsuranceValue\": 123,\n \"LeasedFrom\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"LeasedTo\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\",\n \"OwnerOperatorId\": \"<string>\",\n \"TireSize\": \"<string>\",\n \"EldProviders\": [\n {\n \"IntegrationType\": \"<string>\",\n \"Id\": \"<string>\",\n \"DatagateWayId\": \"<string>\",\n \"SensorId\": \"<string>\"\n }\n ],\n \"References\": [\n {\n \"Id\": \"<string>\",\n \"TenantReferenceId\": \"<string>\",\n \"Value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://integrations.alvys.com/api/p/v{version}/trailers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"TrailerNum\": \"<string>\",\n \"EquipmentType\": \"<string>\",\n \"EquipmentSize\": \"<string>\",\n \"VinNum\": \"<string>\",\n \"Year\": 123,\n \"Make\": \"<string>\",\n \"LicenseNum\": \"<string>\",\n \"LicenseState\": \"<string>\",\n \"LicenseCountry\": \"<string>\",\n \"LicenseExpiresAt\": \"2023-12-25\",\n \"PlatesExpire\": true,\n \"Status\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"FleetId\": \"<string>\",\n \"Capacity\": {\n \"Pallets\": 123,\n \"Weight\": 123\n },\n \"ReeferMake\": \"<string>\",\n \"NumberOfAxles\": 123,\n \"EmptyWeight\": {\n \"Value\": 123\n },\n \"Dimensions\": {\n \"Height\": {\n \"Value\": 123\n },\n \"Width\": {\n \"Value\": 123\n },\n \"Length\": {\n \"Value\": 123\n }\n },\n \"GrossVehicleWeightRating\": {\n \"Value\": 123\n },\n \"TireCount\": 123,\n \"Reefer\": {\n \"FuelBurnPerHour\": 123,\n \"TankCapacity\": {\n \"Value\": 123\n }\n },\n \"InsuranceCompany\": \"<string>\",\n \"InsurancePolicyNumber\": \"<string>\",\n \"InsuranceExpiresAt\": \"2023-12-25\",\n \"InspectionExpiresAt\": \"2023-12-25\",\n \"InsuranceValue\": 123,\n \"LeasedFrom\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"LeasedTo\": {\n \"CompanyId\": \"<string>\",\n \"DriverName\": \"<string>\",\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\"\n },\n \"StartDate\": \"2023-12-25\",\n \"EndDate\": \"2023-12-25\",\n \"OwnerOperatorId\": \"<string>\",\n \"TireSize\": \"<string>\",\n \"EldProviders\": [\n {\n \"IntegrationType\": \"<string>\",\n \"Id\": \"<string>\",\n \"DatagateWayId\": \"<string>\",\n \"SensorId\": \"<string>\"\n }\n ],\n \"References\": [\n {\n \"Id\": \"<string>\",\n \"TenantReferenceId\": \"<string>\",\n \"Value\": \"<string>\"\n }\n ]\n}")
.asString();{
"Id": "<string>",
"TrailerNum": "<string>",
"Status": "<string>",
"Notes": [
{
"id": "<string>",
"Description": "<string>",
"NoteType": "<string>",
"User": "<string>",
"Time": "2023-11-07T05:31:56Z",
"UserId": "<string>"
}
],
"CreatedAt": "2023-11-07T05:31:56Z",
"Fleet": {
"Id": "<string>",
"Name": "<string>",
"InvoiceNumberPrefix": "<string>"
},
"Year": 123,
"Make": "<string>",
"LicenseNum": "<string>",
"LicenseState": "<string>",
"LicenseCountry": "<string>",
"PlateExpiresAt": "2023-12-25",
"LicenseExpiresAt": "2023-12-25",
"VinNum": "<string>",
"SubsidiaryId": "<string>",
"EquipmentType": "<string>",
"EquipmentSize": "<string>",
"Capacity": {
"Pallets": 123,
"Weight": 123
},
"InsuranceCompany": "<string>",
"InsurancePolicyNumber": "<string>",
"InsuranceExpiresAt": "2023-12-25",
"InspectionExpiresAt": "2023-12-25",
"References": [
{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<string>"
}
],
"CompanyOwnedAsset": true,
"PlatesExpire": true,
"ReeferMake": "<string>",
"InsuranceValue": 123,
"LeasedFrom": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"LeasedTo": {
"CompanyId": "<string>",
"DriverName": "<string>",
"StartDate": "2023-12-25",
"EndDate": "2023-12-25"
},
"StartDate": "2023-12-25",
"EndDate": "2023-12-25",
"NumberOfAxles": 123,
"EmptyWeight": {
"Value": 123,
"UnitOfMeasure": "Kilograms"
},
"Dimensions": {
"Height": {
"Value": 123,
"Unit": "Feet"
},
"Width": {
"Value": 123,
"Unit": "Feet"
},
"Length": {
"Value": 123,
"Unit": "Feet"
}
},
"GrossVehicleWeightRating": {
"Value": 123,
"UnitOfMeasure": "Kilograms"
},
"TireCount": 123,
"Reefer": {
"FuelBurnPerHour": 123,
"TankCapacity": {
"Value": 123,
"UnitOfMeasure": "Gallons"
}
}
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}