Loads
Set load fleet
Move a load to another fleet, the same as Change Fleet in Alvys, with safe retries and the new fleet’s invoice number prefix on the load’s next invoice.
PUT
/
api
/
p
/
v
{version}
/
loads
/
{loadNumber}
/
fleet
Set load fleet
curl --request PUT \
--url https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"FleetId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({FleetId: '<string>'})
};
fetch('https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet', 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}/loads/{loadNumber}/fleet"
payload = { "FleetId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(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}/loads/{loadNumber}/fleet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'FleetId' => '<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}/loads/{loadNumber}/fleet"
payload := strings.NewReader("{\n \"FleetId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"FleetId\": \"<string>\"\n}")
.asString();{
"Id": "<string>",
"LoadNumber": "<string>",
"OrderNumber": "<string>",
"CustomerId": "<string>",
"Status": "<string>",
"LoadType": "<string>",
"CustomerType": [
"<string>"
],
"Stops": [
{
"AppointmentRequested": true,
"AppointmentConfirmed": true,
"ScheduleType": "<string>",
"Id": "<string>",
"StopType": "<string>",
"References": [
{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<string>"
}
],
"$type": "<string>",
"AppointmentDate": "2023-11-07T05:31:56Z",
"LoadingType": "<string>",
"Address": {
"Street": "<string>",
"City": "<string>",
"State": "<string>",
"ZipCode": "<string>",
"Country": "<string>"
},
"Coordinates": {
"Latitude": "<string>",
"Longitude": "<string>"
},
"Status": "<string>",
"ArrivedAt": "2023-11-07T05:31:56Z",
"DepartedAt": "2023-11-07T05:31:56Z",
"CompanyId": "<string>",
"CompanyNumber": "<string>",
"CompanyName": "<string>",
"Eta": {
"Planned": "2023-11-07T05:31:56Z",
"Live": "2023-11-07T05:31:56Z",
"Manual": "2023-11-07T05:31:56Z"
}
}
],
"InvoiceAs": "<string>",
"Notes": [
{
"id": "<string>",
"Description": "<string>",
"NoteType": "<string>",
"User": "<string>",
"Time": "2023-11-07T05:31:56Z",
"UserId": "<string>"
}
],
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"References": [
{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<string>"
}
],
"PONumber": "<string>",
"CustomerName": "<string>",
"CustomerNumber": "<string>",
"ContractId": "<string>",
"Fleet": {
"Id": "<string>",
"Name": "<string>",
"InvoiceNumberPrefix": "<string>"
},
"OfficeId": "<string>",
"Linehaul": {
"Amount": 123,
"Currency": 123
},
"FuelSurcharge": {
"Amount": 123,
"Currency": 123
},
"CustomerAccessorials": {
"Amount": 123,
"Currency": 123
},
"CustomerAccessorialsDetails": [
{
"Id": "<string>",
"Type": "<string>",
"Total": {
"Amount": 123,
"Currency": 123
},
"Rate": {
"Amount": 123,
"Currency": 123
},
"RateType": "<string>",
"Uom": "<string>",
"Quantity": 123,
"IsPaid": true,
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"UpdatedAt": "2023-11-07T05:31:56Z",
"UpdatedBy": "<string>",
"ExternalId": "<string>"
}
],
"CustomerRate": {
"Amount": 123,
"Currency": 123
},
"CustomerMileage": {
"Distance": {
"Value": 123,
"UnitOfMeasure": "Miles"
},
"Source": "<string>",
"ProfileId": "<string>",
"ProfileName": "<string>"
},
"InvoicedAmount": {
"Amount": 123,
"Currency": 123
},
"Weight": {
"Value": 123,
"UnitOfMeasure": "Kilograms"
},
"Volume": {
"Value": 123,
"UnitOfMeasure": "Gallons"
},
"ScheduledPickupAt": "2023-11-07T05:31:56Z",
"ScheduledDeliveryAt": "2023-11-07T05:31:56Z",
"PickedUpAt": "2023-11-07T05:31:56Z",
"DeliveredAt": "2023-11-07T05:31:56Z",
"InvoicedAt": "2023-11-07T05:31:56Z",
"LastInvoiceSentAt": "2023-11-07T05:31:56Z",
"CancelledAt": "2023-11-07T05:31:56Z",
"CancelledBy": "<string>",
"CustomerServiceRepId": "<string>",
"CustomerSalesAgentId": "<string>",
"CustomerSalesManagerId": "<string>",
"CustomerLoadPlannerId": "<string>",
"UpdatedAt": "2023-11-07T05:31:56Z",
"UpdatedBy": "<string>",
"CustomerAccountManagerId": "<string>",
"PaidAt": "2023-11-07T05:31:56Z",
"TotalPaid": {
"Amount": 123,
"Currency": 123
},
"Payments": [
{
"Id": "<string>",
"Amount": {
"Amount": 123,
"Currency": 123
},
"PaidAt": "2023-11-07T05:31:56Z"
}
],
"TenderId": "<string>",
"IsDeleted": true,
"RequiredEquipment": [
"<string>"
],
"Origin": {
"Street": "<string>",
"City": "<string>",
"State": "<string>",
"ZipCode": "<string>",
"Country": "<string>",
"CompanyId": "<string>",
"Coordinates": {
"Latitude": "<string>",
"Longitude": "<string>"
}
},
"Destination": {
"Street": "<string>",
"City": "<string>",
"State": "<string>",
"ZipCode": "<string>",
"Country": "<string>",
"CompanyId": "<string>",
"Coordinates": {
"Latitude": "<string>",
"Longitude": "<string>"
}
}
}{
"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>"
}The Set Load Fleet endpoint puts a load in the fleet you name, the same as Change Fleet in Alvys. The fleet’s id, name and invoice number prefix are stored on the load, and the change is written to the load’s history. The load’s trips, rates and invoice-as subsidiary are not changed. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
This endpoint requires the
load:update scope. See Authentication.Request parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| version | path | String | Yes | API version to use. |
| loadNumber | path | String | Yes | The load number. A trip number such as 123-1 is not accepted and returns 404 Not Found. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| FleetId | string | Yes | An active fleet of your account, as returned in Fleet.Id by Get load, List trucks or List trailers. 1 to 255 characters. |
Retry safely
Sending the fleet the load already has, with the same name and invoice number prefix, returns200 OK with the load unchanged and writes nothing to its history. A retry after a timeout is safe. This holds for a Paid or Cancelled load too.
If-Match is not used: the last write wins, the same as in the app.
Invoices
Invoiced, Financed and Completed loads accept the change, the same as in the app. Invoice numbers already issued keep their prefix. The load’s next invoice, or a supplemental or void-and-revise reissue, uses the new fleet’s invoice number prefix.On a company with automatic fleet assignment, a later truck, trailer or driver assignment on the load can replace the fleet you set here.
Response
200 OK with the load, in the same shape as Get load. The Fleet object shows the new fleet.
Errors
| Status | When |
|---|---|
400 Bad Request | The body is missing or malformed, or FleetId is missing, blank or longer than 255 characters. |
401 Unauthorized | The access token is missing, invalid or expired. |
403 Forbidden | Your credential does not have the load:update scope. |
404 Not Found | The load does not exist, is deleted, has no trips or is outside your credential’s subsidiaries, or a trip number was used in place of the load number (for example 123-1). |
409 Conflict | The load is Paid or Cancelled, or other writes kept changing the load while its fleet was being set. See Why a request is refused with 409. |
422 Unprocessable Entity | FleetId is not an active fleet of your account: unknown, deleted or another company’s. The problem type is https://api.alvys.com/errors/UnprocessableEntity/FleetNotFound. |
429 Too Many Requests | You are rate limited. See Rate limits. |
Why a request is refused with 409
The problemtype is https://api.alvys.com/errors/Conflict/ followed by the reason:
| Reason | Cause |
|---|---|
LoadPaidOrCancelled | The load is Paid or Cancelled, so its fleet can no longer be changed. |
LoadWriteConflict | Other writes changed the load on every attempt to set its fleet. Retry the request. |
Example cURL request
curl --location --request PUT 'https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data-raw '{
"FleetId": "a1b2c3d4e5f647a8b9c0d1e2f3a4b5c6"
}'
Example response (200 OK)
Abbreviated. The full load has the same fields as Get load.{
"Id": "c2e418d5-3125-4b14-b6b0-dcf77b0c2a93",
"LoadNumber": "3022258",
"OrderNumber": "ORD-1042",
"CustomerName": "Example Customer",
"Status": "Delivered",
"Fleet": {
"Id": "a1b2c3d4e5f647a8b9c0d1e2f3a4b5c6",
"Name": "West Region",
"InvoiceNumberPrefix": "WR"
},
"UpdatedAt": "2026-12-02T15:04:11+00:00"
}
Rate limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information, see the Rate Limits section.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>.
Path Parameters
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Response
OK
⌘I
Set load fleet
curl --request PUT \
--url https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"FleetId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({FleetId: '<string>'})
};
fetch('https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet', 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}/loads/{loadNumber}/fleet"
payload = { "FleetId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(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}/loads/{loadNumber}/fleet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'FleetId' => '<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}/loads/{loadNumber}/fleet"
payload := strings.NewReader("{\n \"FleetId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://integrations.alvys.com/api/p/v{version}/loads/{loadNumber}/fleet")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"FleetId\": \"<string>\"\n}")
.asString();{
"Id": "<string>",
"LoadNumber": "<string>",
"OrderNumber": "<string>",
"CustomerId": "<string>",
"Status": "<string>",
"LoadType": "<string>",
"CustomerType": [
"<string>"
],
"Stops": [
{
"AppointmentRequested": true,
"AppointmentConfirmed": true,
"ScheduleType": "<string>",
"Id": "<string>",
"StopType": "<string>",
"References": [
{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<string>"
}
],
"$type": "<string>",
"AppointmentDate": "2023-11-07T05:31:56Z",
"LoadingType": "<string>",
"Address": {
"Street": "<string>",
"City": "<string>",
"State": "<string>",
"ZipCode": "<string>",
"Country": "<string>"
},
"Coordinates": {
"Latitude": "<string>",
"Longitude": "<string>"
},
"Status": "<string>",
"ArrivedAt": "2023-11-07T05:31:56Z",
"DepartedAt": "2023-11-07T05:31:56Z",
"CompanyId": "<string>",
"CompanyNumber": "<string>",
"CompanyName": "<string>",
"Eta": {
"Planned": "2023-11-07T05:31:56Z",
"Live": "2023-11-07T05:31:56Z",
"Manual": "2023-11-07T05:31:56Z"
}
}
],
"InvoiceAs": "<string>",
"Notes": [
{
"id": "<string>",
"Description": "<string>",
"NoteType": "<string>",
"User": "<string>",
"Time": "2023-11-07T05:31:56Z",
"UserId": "<string>"
}
],
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"References": [
{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<string>"
}
],
"PONumber": "<string>",
"CustomerName": "<string>",
"CustomerNumber": "<string>",
"ContractId": "<string>",
"Fleet": {
"Id": "<string>",
"Name": "<string>",
"InvoiceNumberPrefix": "<string>"
},
"OfficeId": "<string>",
"Linehaul": {
"Amount": 123,
"Currency": 123
},
"FuelSurcharge": {
"Amount": 123,
"Currency": 123
},
"CustomerAccessorials": {
"Amount": 123,
"Currency": 123
},
"CustomerAccessorialsDetails": [
{
"Id": "<string>",
"Type": "<string>",
"Total": {
"Amount": 123,
"Currency": 123
},
"Rate": {
"Amount": 123,
"Currency": 123
},
"RateType": "<string>",
"Uom": "<string>",
"Quantity": 123,
"IsPaid": true,
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"UpdatedAt": "2023-11-07T05:31:56Z",
"UpdatedBy": "<string>",
"ExternalId": "<string>"
}
],
"CustomerRate": {
"Amount": 123,
"Currency": 123
},
"CustomerMileage": {
"Distance": {
"Value": 123,
"UnitOfMeasure": "Miles"
},
"Source": "<string>",
"ProfileId": "<string>",
"ProfileName": "<string>"
},
"InvoicedAmount": {
"Amount": 123,
"Currency": 123
},
"Weight": {
"Value": 123,
"UnitOfMeasure": "Kilograms"
},
"Volume": {
"Value": 123,
"UnitOfMeasure": "Gallons"
},
"ScheduledPickupAt": "2023-11-07T05:31:56Z",
"ScheduledDeliveryAt": "2023-11-07T05:31:56Z",
"PickedUpAt": "2023-11-07T05:31:56Z",
"DeliveredAt": "2023-11-07T05:31:56Z",
"InvoicedAt": "2023-11-07T05:31:56Z",
"LastInvoiceSentAt": "2023-11-07T05:31:56Z",
"CancelledAt": "2023-11-07T05:31:56Z",
"CancelledBy": "<string>",
"CustomerServiceRepId": "<string>",
"CustomerSalesAgentId": "<string>",
"CustomerSalesManagerId": "<string>",
"CustomerLoadPlannerId": "<string>",
"UpdatedAt": "2023-11-07T05:31:56Z",
"UpdatedBy": "<string>",
"CustomerAccountManagerId": "<string>",
"PaidAt": "2023-11-07T05:31:56Z",
"TotalPaid": {
"Amount": 123,
"Currency": 123
},
"Payments": [
{
"Id": "<string>",
"Amount": {
"Amount": 123,
"Currency": 123
},
"PaidAt": "2023-11-07T05:31:56Z"
}
],
"TenderId": "<string>",
"IsDeleted": true,
"RequiredEquipment": [
"<string>"
],
"Origin": {
"Street": "<string>",
"City": "<string>",
"State": "<string>",
"ZipCode": "<string>",
"Country": "<string>",
"CompanyId": "<string>",
"Coordinates": {
"Latitude": "<string>",
"Longitude": "<string>"
}
},
"Destination": {
"Street": "<string>",
"City": "<string>",
"State": "<string>",
"ZipCode": "<string>",
"Country": "<string>",
"CompanyId": "<string>",
"Coordinates": {
"Latitude": "<string>",
"Longitude": "<string>"
}
}
}{
"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>"
}