Update trailer
Partially update a trailer by ID in Alvys, changing only the fields you send, such as equipment, plates, status, capacity, reefer, leases, or ELD links.
curl --request PATCH \
--url https://integrations.alvys.com/api/p/v{version}/trailers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--header 'If-Match: <if-match>' \
--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: 'PATCH',
headers: {
'If-Match': '<if-match>',
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/{id}', 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/{id}"
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 = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.patch(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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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",
"If-Match: <if-match>"
],
]);
$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/{id}"
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("PATCH", url, payload)
req.Header.Add("If-Match", "<if-match>")
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.patch("https://integrations.alvys.com/api/p/v{version}/trailers/{id}")
.header("If-Match", "<if-match>")
.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>"
}{
"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>"
}trailer:update scope. See Authentication.If-Match is required
This endpoint uses optimistic concurrency. Send the trailer’s currentETag in the If-Match header. The ETag response header of Get trailer, Create trailer, and every successful update carries it.
- If you omit
If-Match, the request is rejected with428 Precondition Required. - If the trailer changed after you read it, the request is rejected with
412 Precondition Failed. Get the trailer again and retry with the newETag.
Fields that are replaced whole
Dimensions, Reefer, EldProviders, and References are replaced whole: send the complete value you want stored. For EldProviders and References, null clears the list.
- EldProviders: moving the trailer off an ELD link stops its location updates from that provider. Omit
SensorId, or sendnull, to keep the sensor id stored on the same link. - References: include the
Idof each reference already on the trailer that you want to keep or edit. OmitIdfor a new reference. A reference identical to one already stored is kept as it is.
Trailer number and VIN must stay unique
If you changeTrailerNum or VinNum to a value another trailer in your company already has, the request is rejected with 409 Conflict. The problem type is https://api.alvys.com/errors/Conflict/DuplicateAssetNumber for the trailer number and https://api.alvys.com/errors/Conflict/DuplicateVin for the VIN.
Status and owner operator
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, so a status you write can be overwritten.
OwnerOperatorId set to null unassigns the trailer: it goes back to the carrier of its subsidiary.
Request parameters
The following parameters are required in the URL path:| Parameter | Type | Required | Description |
|---|---|---|---|
| version | String | Yes | The version of the API. |
| id | String | Yes | The unique identifier of the trailer. |
| Header | Required | Description |
|---|---|---|
| If-Match | Yes | The current ETag of the trailer being updated. |
Request body
All fields are optional, includingEquipmentType and EquipmentSize. The fields are the same as in Create trailer, with these differences:
| Field | Type | Description |
|---|---|---|
| TrailerNum | String | The new trailer number. Must be unique among your company’s trailers. |
| SubsidiaryId | String | A subsidiary that your credential may write to. |
| Status | String | One of Active, Planned, Temporary, Repair, In Shop, Leased Out, Crashed, Inactive (case-insensitive). No default. |
| StartDate / EndDate | String (Date) | EndDate cannot be before StartDate. |
| References.Id | String | The id of a reference already on the trailer, to keep or edit it. Omit for a new reference. |
Example cURL request
curl --location --request PATCH 'https://integrations.alvys.com/api/p/v1/trailers/TR100000000000000932' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--header 'If-Match: "00000000-0000-0000-0000-000000000001"' \
--data-raw '{
"Status": "Repair",
"InspectionExpiresAt": "2027-06-30"
}'
YOUR_ACCESS_TOKEN with your actual Bearer token and the If-Match value with the trailer’s current ETag.
Response fields
A successful request returns200 OK with the updated trailer, in the same shape as Get trailer. The new ETag is in the ETag response header.
Status codes
| Status | Meaning |
|---|---|
| 200 | The trailer was updated. |
| 400 | The request body failed validation. The response lists the invalid fields. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks the trailer:update scope. |
| 404 | No company-owned trailer with the given id exists in the subsidiaries your credential can access. |
| 409 | Another trailer in your company has the same TrailerNum (DuplicateAssetNumber) or VinNum (DuplicateVin). |
| 412 | The If-Match value did not match the current trailer. Get the trailer again and retry. |
| 422 | A referenced record is not usable. See Why a request is refused with 422. |
| 428 | The If-Match header is missing. |
| 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 |
|---|---|
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>.
Headers
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. A maintenance work order started in Alvys moves the trailer to In Shop and back to Active on its own.
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
OK
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 PATCH \
--url https://integrations.alvys.com/api/p/v{version}/trailers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--header 'If-Match: <if-match>' \
--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: 'PATCH',
headers: {
'If-Match': '<if-match>',
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/{id}', 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/{id}"
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 = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.patch(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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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",
"If-Match: <if-match>"
],
]);
$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/{id}"
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("PATCH", url, payload)
req.Header.Add("If-Match", "<if-match>")
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.patch("https://integrations.alvys.com/api/p/v{version}/trailers/{id}")
.header("If-Match", "<if-match>")
.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>"
}{
"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>"
}