> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alvys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create truck

> Register a company-owned truck in Alvys with its truck number, VIN, plates, weights, fuel profile, insurance, leases, toll passes, and ELD links.

The Create Truck endpoint registers a company-owned truck. On success it returns the new truck and its optimistic-concurrency token in the `ETag` response header. Send that value in the `If-Match` header of a later [Update truck](https://docs.alvys.com/en/api/reference/trucks/update-truck.md) request. For more information on how versioning works and how to include it in your requests, please refer to the [Versioning](https://docs.alvys.com/en/api/guides/versioning.md) page.

> [!NOTE]
>
> This endpoint requires the `truck:create` scope. See [Authentication](https://docs.alvys.com/en/api/guides/authentication-1.md).

### Truck number and VIN must be unique

`TruckNum` must be unique among your company's trucks. When you supply `VinNumber`, 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 truck in your company has this `TruckNum`. |
| `https://api.alvys.com/errors/Conflict/DuplicateVin` | Another truck in your company has this `VinNumber`. |

The response does not identify the existing truck. If your credential also has the `truck:read` scope, find it with [Search trucks](https://docs.alvys.com/en/api/reference/trucks/search-trucks.md) 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](https://docs.alvys.com/en/api/reference/subsidiaries/list-subsidiaries.md). If the credential can write to exactly one subsidiary, you can omit `SubsidiaryId` and the truck is created in that subsidiary.

### Truck status

`Status` is shown in the dispatch planner. It does not by itself block dispatch. A maintenance work order started in Alvys moves the truck to `In Shop`, and back to `Active` when the work order completes. `Crashed` and `Inactive` remove the truck from the ELD live map and from the truck 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

Only `TruckNum` is required. Dates are date-only values in `yyyy-MM-dd` format.

| Field | Type | Required | Description |
| - | - | - | - |
| TruckNum | String | Yes | The truck number. Must be unique among your company's trucks. |
| VinNumber | String | No | The Vehicle Identification Number (VIN). Must be unique among your company's trucks. |
| Year | Integer | No | The manufacturing year of the truck. |
| Make | String | No | The manufacturer of the truck. |
| Model | String | No | The model of the truck. |
| LicenseNum | String | No | The license plate number of the truck. |
| LicenseState | String | No | The state that issued the license plate. |
| LicenseCountry | String | No | The country where the truck is licensed. |
| LicenseExpirationDate | String (Date) | No | The plate registration expiration date ("License Expiration" 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 truck. See [Subsidiary](#subsidiary). |
| FleetId | String | No | An active fleet of your account, as returned in `Fleet.Id` by [List trucks](https://docs.alvys.com/en/api/reference/trucks/list-trucks.md). |
| NumberOfAxles | Integer | No | The number of axles on the truck. |
| GrossWeight | Object | No | The maximum gross weight. Stored and returned in pounds. |
| GrossWeight.Value | Number | No | The weight value. |
| GrossWeight.UnitOfMeasure | String | No | One of `Pounds`, `Kilograms`, `Grams`, `Ounces`, `Tons`, `CWT`, `MetricTon`, `LongTon`. |
| EmptyWeight | Object | No | The empty (tare) weight, with `Value` and `UnitOfMeasure` as in `GrossWeight`. Stored and returned in pounds. |
| GrossCombinationWeightRating | Object | No | The gross combination weight rating (what the truck can pull), with `Value` and `UnitOfMeasure` as in `GrossWeight`. |
| 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 power unit. |
| SteerTire | String | No | The steer axle tire size, free text (for example `295/75R22.5`). |
| DriveTire | String | No | The drive axle tire size, free text. |
| Color | String | No | The color of the truck. |
| FuelType | String | No | The type of fuel used by the truck. |
| FuelProfile | Object | No | The fuel-cost inputs of the truck. |
| FuelProfile.MpgLoaded | Number | No | Miles per gallon when loaded. |
| FuelProfile.MpgEmpty | Number | No | Miles per gallon when empty. |
| FuelProfile.TankCapacity | Object | No | The capacity of one tank, with `Value` (Number) and `UnitOfMeasure` (for example `Gallons` or `Liters`). |
| FuelProfile.TankCount | Integer | No | The number of fuel tanks. |
| FuelProfile.FuelKind | String | No | One of `Diesel`, `Gasoline`, `Cng`, `Lng`, `Electric`, `Hybrid`. |
| DeductToll | Boolean | No | Deduct the tolls of this truck from the driver's settlement. |
| InsuranceCompany | String | No | The insurance company of the truck. |
| InsurancePolicyNumber | String | No | The insurance policy number. |
| InsuranceExpirationDate | String (Date) | No | The expiration date of the insurance policy. |
| InsuranceValue | Number | No | The insured value of the truck. |
| LossPayee | String | No | The loss payee on the insurance policy. |
| InspectionExpirationDate | String (Date) | No | The expiration date of the annual inspection. |
| LeasedFrom | Object | No | The lease under which your company holds the truck. |
| LeasedFrom.CompanyId | String | No | The id of the company the truck 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 truck to another company. Same fields as `LeasedFrom`. |
| StartDate | String (Date) | No | The date the truck entered service. |
| EndDate | String (Date) | No | The date the truck left service. |
| OwnerOperatorId | String | No | The driver id of the owner operator the truck belongs to ("Assigned to Owner Operator" in Alvys). The driver must exist in your account with contractor type Owner Operator. |
| TollPasses | Array | No | The toll passes of the truck. One pass per issuer. |
| TollPasses.PassType | String | No | The pass issuer, free text (for example `E-ZPass`, `PrePass`, or `BestPass`). |
| TollPasses.PassValue | String | No | The transponder or account number on the pass. |
| IftaEnrollments | Array | No | The IFTA enrollments of the truck. |
| IftaEnrollments.State | String | No | The code of a US state, Canadian province or territory, or Mexican state (for example `TX`, `ON`, or `NLE`). Case-insensitive. |
| IftaEnrollments.Sticker | String | No | The IFTA decal (sticker) number. |
| EldProviders | Array | No | The ELD links of the truck. 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 truck 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 truck. |
| References.TenantReferenceId | String | Yes | The `Id` of a truck reference definition of your company. Get it from [List custom reference definitions](https://docs.alvys.com/en/api/reference/references/list-reference-definitions.md) with `entities=Truck`. |
| 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

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/trucks' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "TruckNum": "T-417",
  "VinNumber": "1XKAD49X8PJ000417",
  "Year": 2023,
  "Make": "Kenworth",
  "Model": "T680",
  "LicenseNum": "ABC1234",
  "LicenseState": "TX",
  "LicenseCountry": "USA",
  "LicenseExpirationDate": "2027-03-31",
  "SubsidiaryId": "a1b2c3d4-0000-0000-0000-000000000001",
  "NumberOfAxles": 3,
  "GrossWeight": { "Value": 80000, "UnitOfMeasure": "Pounds" },
  "TireCount": 10,
  "SteerTire": "295/75R22.5",
  "DriveTire": "295/75R22.5",
  "FuelProfile": {
    "MpgLoaded": 6.5,
    "MpgEmpty": 7.8,
    "TankCapacity": { "Value": 150, "UnitOfMeasure": "Gallons" },
    "TankCount": 2,
    "FuelKind": "Diesel"
  },
  "StartDate": "2026-11-01",
  "TollPasses": [{ "PassType": "E-ZPass", "PassValue": "0001234567" }],
  "IftaEnrollments": [{ "State": "TX", "Sticker": "IF-000417" }]
}'
```

Replace `YOUR_ACCESS_TOKEN` with your actual Bearer token.

***

### Response fields

A successful request returns `201 Created` with the new truck, in the same shape as [Get truck](https://docs.alvys.com/en/api/reference/trucks/get-truck.md). The truck's current `ETag` is in the `ETag` response header.

***

### Example response

**201 Created**

```json theme={null}
{
  "Id": "TL100000000000000417",
  "TruckNum": "T-417",
  "VinNumber": "1XKAD49X8PJ000417",
  "Year": 2023,
  "Make": "Kenworth",
  "Model": "T680",
  "LicenseNum": "ABC1234",
  "LicenseState": "TX",
  "LicenseCountry": "USA",
  "LicenseExpirationDate": "2027-03-31",
  "Status": "Active",
  "SubsidiaryId": "a1b2c3d4-0000-0000-0000-000000000001",
  "NumberOfAxles": 3,
  "GrossWeight": { "Value": 80000, "UnitOfMeasure": "Pounds" },
  "TireCount": 10,
  "FuelProfile": {
    "MpgLoaded": 6.5,
    "MpgEmpty": 7.8,
    "TankCapacity": { "Value": 150, "UnitOfMeasure": "Gallons" },
    "TankCount": 2,
    "FuelKind": "Diesel"
  },
  "StartDate": "2026-11-01",
  "CreatedAt": "2026-11-13T15:04:05.000Z"
}
```

The example shows a subset of the response fields.

***

### Status codes

| Status | Meaning |
| - | - |
| 201 | The truck 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 `truck:create` scope. |
| 409 | Another truck in your company has the same `TruckNum` (`DuplicateAssetNumber`) or `VinNumber` (`DuplicateVin`). |
| 422 | A referenced record is not usable. See [Why a request is refused with 422](#why-a-request-is-refused-with-422). |
| 429 | The rate limit was exceeded. |

### Why a request is refused with 422

The problem `type` 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 truck 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](https://docs.alvys.com/en/api/guides/rate-limits.md) 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.


## OpenAPI

````yaml POST /api/p/v{version}/trucks
openapi: 3.0.1
info:
  title: Alvys
  description: >-
    Alvys provides a robust set of REST APIs to allow you to integrate Alvys
    into virtually any platform. These APIs cover most of Alvys' major product
    areas with additional endpoints being added regularly based on customer
    requests.
  contact:
    name: Alvys Support
    url: https://www.alvys.com/resources/contact/
  version: v1
servers:
  - url: https://integrations.alvys.com
    description: Public API Server
  - url: https://api.alvys.com/
    description: Public API Server
security:
  - Public: []
tags:
  - name: Authentication
    description: Obtain an OAuth 2.0 access token for the Alvys Public API.
  - name: Carrier Settlement Statements
    description: >-
      Search carrier settlement statements and retrieve a single statement by
      number.
  - name: Carriers
    description: Read carrier records, search carriers, and manage carrier documents.
  - name: Customers
    description: Create, read, update, delete, and search customer records.
  - name: Deductions
    description: >-
      Create one-time deductions and search or delete existing deduction
      records.
  - name: DispatchPreferences
    description: Dispatch preferences endpoints for reading dispatch rules and preferences.
  - name: Driver Settlement Statements
    description: >-
      Search driver settlement statements and retrieve a single statement by
      number.
  - name: Drivers
    description: >-
      Read driver records, search drivers and driver events, and manage driver
      documents.
  - name: Fuel
    description: Read and search fuel transactions.
  - name: Invoices
    description: >-
      Read invoices, create carrier invoices, and record carrier and customer
      payments.
  - name: Loads
    description: >-
      Read, update, and search loads; manage load documents, notes, and custom
      references.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: References
    description: >-
      List tenant custom reference definitions and create or update values on
      existing loads, stops, and trips.
  - name: Subsidiaries
    description: >-
      List your company's subsidiaries and read a single subsidiary, so an
      integration can resolve a subsidiary id to a recognizable name.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Tracking
    description: >-
      Record an asset's current location or telemetry from a third-party source,
      such as an external ELD or a self-reporting vehicle.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read and search trips; manage trip documents, stop appointments, arrivals,
      departures, and stop and trip custom references.
  - name: Trucks
    description: Read trucks, search truck events, and manage truck documents.
  - name: Users
    description: List and search users.
  - name: Visibility
    description: >-
      Read inbound and outbound visibility history and search outbound
      visibility errors.
  - name: Webhooks
    description: >-
      Create, read, update, delete, enable, disable, verify, test, and rotate
      secrets for webhook subscriptions; read event types, delivery logs, and
      health metrics.
  - name: Accessorials
  - name: Credits
paths:
  /api/p/v{version}/trucks:
    post:
      tags:
        - Trucks
      summary: Create truck
      description: >-
        Registers a company-owned truck. TruckNum must be unique among your
        company's trucks; the VIN must be unique when supplied. A clash answers
        409; find the holder with POST /trucks/search when your credential can
        read, so a re-run of an onboarding step can reconcile instead of
        creating a duplicate. Status defaults to Active. SubsidiaryId may be
        omitted only when the credential can write to exactly one subsidiary
        (see GET /subsidiaries).
      parameters:
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckCreateRequest'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckCreateRequest'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckCreateRequest'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckCreateRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alvys.Models.Trucks.TruckResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '409':
          description: >-
            Conflict (TruckNum or VIN already used by another truck:
            DuplicateAssetNumber or DuplicateVin)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '422':
          description: Unprocessable Content
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.Trucks.TruckCreateRequest:
      required:
        - TruckNum
      type: object
      properties:
        TruckNum:
          type: string
        VinNumber:
          type: string
          nullable: true
        Year:
          type: integer
          format: int32
          nullable: true
        Make:
          type: string
          nullable: true
        Model:
          type: string
          nullable: true
        LicenseNum:
          type: string
          nullable: true
        LicenseState:
          type: string
          nullable: true
        LicenseCountry:
          type: string
          nullable: true
        LicenseExpirationDate:
          type: string
          description: >-
            Plate registration expiration ("License Expiration" in the app).
            Date only (yyyy-MM-dd), stored as 00:00 UTC.
          format: date
          nullable: true
        Status:
          type: string
          description: >-
            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 truck from the ELD live map and from truck pickers.
            Defaults to Active.
          nullable: true
        SubsidiaryId:
          type: string
          description: >-
            Subsidiary id from GET /subsidiaries. Must be one this credential
            may write to. May be omitted only when the credential can write to
            exactly one subsidiary.
          nullable: true
        FleetId:
          type: string
          description: >-
            Fleet id, as returned in Fleet.Id by GET /trucks. Must be an active
            fleet of your account.
          nullable: true
        NumberOfAxles:
          type: integer
          format: int32
          nullable: true
        GrossWeight:
          allOf:
            - $ref: '#/components/schemas/Alvys.Weight'
          description: >-
            Maximum gross weight, with its unit (Pounds, Kilograms, ...). Stored
            and returned in pounds.
          nullable: true
        EmptyWeight:
          allOf:
            - $ref: '#/components/schemas/Alvys.Weight'
          description: >-
            Empty (tare) weight, with its unit (Pounds, Kilograms, ...). Stored
            and returned in pounds.
          nullable: true
        Dimensions:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.VehicleDimensions'
          description: >-
            Outside dimensions for the routing vehicle profile: Height, Width
            and Length, each with its unit (Feet, Inches, Meters, ...).
          nullable: true
        GrossCombinationWeightRating:
          allOf:
            - $ref: '#/components/schemas/Alvys.Weight'
          description: >-
            Gross combination weight rating: what the unit can pull, with its
            unit (Pounds, Kilograms, ...).
          nullable: true
        TireCount:
          type: integer
          description: Tires on the power unit.
          format: int32
          nullable: true
        Color:
          type: string
          nullable: true
        FuelType:
          type: string
          nullable: true
        FuelProfile:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Trucks.FuelProfileRequest'
          description: >-
            Fuel-cost inputs: MpgLoaded, MpgEmpty, TankCapacity (with its unit),
            TankCount and FuelKind (Diesel, Gasoline, Cng, Lng, Electric,
            Hybrid).
          nullable: true
        DeductToll:
          type: boolean
          description: Deduct this truck's tolls from the driver's settlement.
          nullable: true
        InsuranceCompany:
          type: string
          nullable: true
        InsurancePolicyNumber:
          type: string
          nullable: true
        InsuranceExpirationDate:
          type: string
          description: Date only (yyyy-MM-dd), stored as 00:00 UTC.
          format: date
          nullable: true
        InspectionExpirationDate:
          type: string
          description: >-
            Annual inspection expiration. Date only (yyyy-MM-dd), stored as
            00:00 UTC.
          format: date
          nullable: true
        InsuranceValue:
          type: number
          format: double
          nullable: true
        LossPayee:
          type: string
          nullable: true
        LeasedFrom:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Assets.AssetLeaseRequest'
          nullable: true
        LeasedTo:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Assets.AssetLeaseRequest'
          nullable: true
        StartDate:
          type: string
          description: >-
            Date the truck entered service. Date only (yyyy-MM-dd), stored as
            00:00 UTC.
          format: date
          nullable: true
        EndDate:
          type: string
          description: >-
            Date the truck left service. Date only (yyyy-MM-dd), stored as 00:00
            UTC.
          format: date
          nullable: true
        OwnerOperatorId:
          type: string
          description: >-
            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.
          nullable: true
        SteerTire:
          type: string
          description: Steer axle tire size. Tire size, free text (e.g. 295/75R22.5).
          nullable: true
        DriveTire:
          type: string
          description: Drive axles tire size. Tire size, free text (e.g. 295/75R22.5).
          nullable: true
        TollPasses:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Assets.TollPassRequest'
          description: Toll passes, replaced whole. One pass per issuer.
          nullable: true
        IftaEnrollments:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Assets.IftaEnrollmentRequest'
          description: IFTA enrollments, replaced whole.
          nullable: true
        EldProviders:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Assets.EldProviderRequest'
          description: >-
            ELD links, replaced whole. Moving an asset off a link stops its
            location updates from that provider.
          nullable: true
        References:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Assets.AssetReferenceRequest'
          description: >-
            Custom references, replaced whole. Each new or changed reference
            must name a definition the tenant set up for this asset type; type,
            access and visibility come from the definition.
          nullable: true
      additionalProperties: false
    Alvys.Models.Trucks.TruckResponse:
      required:
        - CreatedAt
        - EmptyWeight
        - FuelCards
        - GrossWeight
        - Id
        - Notes
        - Status
        - SubsidiaryId
        - TruckNum
      type: object
      properties:
        Id:
          type: string
        TruckNum:
          type: string
        VinNumber:
          type: string
          nullable: true
        Year:
          type: integer
          format: int32
          nullable: true
        Make:
          type: string
          nullable: true
        Model:
          type: string
          nullable: true
        LicenseNum:
          type: string
          nullable: true
        LicenseState:
          type: string
          nullable: true
        LicenseCountry:
          type: string
          nullable: true
        PlateExpirationDate:
          type: string
          format: date
          nullable: true
        LicenseExpirationDate:
          type: string
          format: date
          nullable: true
        Status:
          type: string
        SubsidiaryId:
          type: string
        NumberOfAxles:
          type: integer
          format: int32
          nullable: true
        Fleet:
          allOf:
            - $ref: '#/components/schemas/FleetResponse'
          nullable: true
        GrossWeight:
          allOf:
            - $ref: '#/components/schemas/Alvys.Weight'
        EmptyWeight:
          allOf:
            - $ref: '#/components/schemas/Alvys.Weight'
        Color:
          type: string
          nullable: true
        FuelType:
          type: string
          nullable: true
        FuelCards:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.FuelCard'
        InsuranceCompany:
          type: string
          nullable: true
        InsurancePolicyNumber:
          type: string
          nullable: true
        InsuranceExpirationDate:
          type: string
          format: date
          nullable: true
        InspectionExpirationDate:
          type: string
          format: date
          nullable: true
        Notes:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Notes.NoteDto'
        CreatedAt:
          type: string
          format: date-time
        References:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.References.ReferenceResponse'
          nullable: true
        DeductToll:
          type: boolean
          nullable: true
        InsuranceValue:
          type: number
          format: double
          nullable: true
        LossPayee:
          type: string
          nullable: true
        LeasedFrom:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Assets.AssetLeaseResponse'
          nullable: true
        LeasedTo:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Assets.AssetLeaseResponse'
          nullable: true
        StartDate:
          type: string
          format: date
          nullable: true
        EndDate:
          type: string
          format: date
          nullable: true
        Dimensions:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.VehicleDimensions'
          nullable: true
        GrossCombinationWeightRating:
          allOf:
            - $ref: '#/components/schemas/Alvys.Weight'
          nullable: true
        TireCount:
          type: integer
          format: int32
          nullable: true
        FuelProfile:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.TruckFuelProfile'
          nullable: true
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ValidationProblemDetails:
      required:
        - Errors
      type: object
      properties:
        Errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Alvys.Weight:
      required:
        - UnitOfMeasure
        - Value
      type: object
      properties:
        Value:
          type: number
          format: double
        UnitOfMeasure:
          allOf:
            - $ref: '#/components/schemas/Alvys.WeightWeightUnits'
      additionalProperties: false
    Alvys.Models.VehicleDimensions:
      type: object
      properties:
        Height:
          allOf:
            - $ref: '#/components/schemas/Alvys.Length'
          nullable: true
        Width:
          allOf:
            - $ref: '#/components/schemas/Alvys.Length'
          nullable: true
        Length:
          allOf:
            - $ref: '#/components/schemas/Alvys.Length'
          nullable: true
      additionalProperties: false
    Alvys.Models.Trucks.FuelProfileRequest:
      type: object
      properties:
        MpgLoaded:
          type: number
          format: double
          nullable: true
        MpgEmpty:
          type: number
          format: double
          nullable: true
        TankCapacity:
          allOf:
            - $ref: '#/components/schemas/Alvys.Volume'
          nullable: true
        TankCount:
          type: integer
          format: int32
          nullable: true
        FuelKind:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.FuelKind'
          nullable: true
      additionalProperties: false
    Alvys.Models.Assets.AssetLeaseRequest:
      type: object
      properties:
        CompanyId:
          type: string
          description: >-
            Id of the company the asset is leased from or to. Must be a company
            in your account.
          nullable: true
        DriverName:
          type: string
          nullable: true
        StartDate:
          type: string
          description: Date only (yyyy-MM-dd), stored as 00:00 UTC.
          format: date
          nullable: true
        EndDate:
          type: string
          description: Date only (yyyy-MM-dd), stored as 00:00 UTC.
          format: date
          nullable: true
      additionalProperties: false
    Alvys.Models.Assets.TollPassRequest:
      type: object
      properties:
        PassType:
          type: string
          description: >-
            Toll pass issuer, e.g. E-ZPass, PrePass, BestPass. Free text; one
            pass per issuer.
          nullable: true
        PassValue:
          type: string
          description: Transponder or account number on the pass.
          nullable: true
      additionalProperties: false
    Alvys.Models.Assets.IftaEnrollmentRequest:
      type: object
      properties:
        State:
          type: string
          description: >-
            US state, Canadian province or territory, or Mexican state, by its
            code (TX, ON, NLE). Matched case-insensitively and stored as the
            code. An entry identical to one already stored is kept as it is.
          nullable: true
        Sticker:
          type: string
          description: IFTA decal (sticker) number. Optional.
          nullable: true
      additionalProperties: false
    Alvys.Models.Assets.EldProviderRequest:
      type: object
      properties:
        IntegrationType:
          type: string
          description: >-
            The ELD integration, by its Alvys name (e.g. Samsara, Motive,
            Orbcomm). Matched case-insensitively; one link per integration.
          nullable: true
        Id:
          type: string
          description: The asset's id in that provider.
          nullable: true
        DatagateWayId:
          type: string
          description: >-
            Orbcomm only: the device's data gateway id. Rejected for any other
            integration.
          nullable: true
        SensorId:
          type: string
          description: >-
            Sensor id on the device. Omit or send null to keep the one stored on
            the same link.
          nullable: true
      additionalProperties: false
    Alvys.Models.Assets.AssetReferenceRequest:
      type: object
      properties:
        Id:
          type: string
          description: >-
            Id of a reference already on the asset, to keep or edit it. Omit for
            a new reference.
          nullable: true
        TenantReferenceId:
          type: string
          description: >-
            Id of the reference definition (GET
            companyprofiles/reference/entity/{Truck|Trailer}). Required for a
            new or changed reference.
          nullable: true
        Value:
          type: string
          description: >-
            The value, checked against the definition's type: true or false for
            Bool, a date (yyyy-MM-dd) for Date, one of the definition's values
            for List. A reference identical to one already stored is kept as it
            is.
          nullable: true
      additionalProperties: false
    FleetResponse:
      type: object
      properties:
        Id:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        InvoiceNumberPrefix:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.FuelCard:
      required:
        - ApplyFuelDiscount
        - DeductFuel
      type: object
      properties:
        id:
          type: string
          nullable: true
        CardNumber:
          type: string
          nullable: true
        Provider:
          type: string
          nullable: true
        DeductFuel:
          type: boolean
        ApplyFuelDiscount:
          type: boolean
        DeductFromId:
          type: string
          nullable: true
        DeductFromName:
          type: string
          nullable: true
        DeductFromSubsidiary:
          type: string
          nullable: true
        DeductFromContractorType:
          type: string
          nullable: true
        FuelTypeConfigs:
          type: array
          items:
            $ref: >-
              #/components/schemas/Alvys.Features.FuelServices.Models.FuelTypeConfig
          nullable: true
      additionalProperties: false
    Alvys.Models.Notes.NoteDto:
      required:
        - Description
        - id
        - NoteType
        - User
      type: object
      properties:
        id:
          type: string
        Description:
          type: string
        NoteType:
          type: string
        Time:
          type: string
          format: date-time
          nullable: true
        User:
          type: string
        UserId:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.References.ReferenceResponse:
      required:
        - Name
        - Value
      type: object
      properties:
        Id:
          type: string
          nullable: true
        ReferenceId:
          type: string
          nullable: true
        Name:
          type: string
        Value:
          type: string
        Type:
          type: string
          nullable: true
        Access:
          type: string
          nullable: true
        Origin:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.Assets.AssetLeaseResponse:
      type: object
      properties:
        CompanyId:
          type: string
          nullable: true
        DriverName:
          type: string
          nullable: true
        StartDate:
          type: string
          format: date
          nullable: true
        EndDate:
          type: string
          format: date
          nullable: true
      additionalProperties: false
    Alvys.Models.TruckFuelProfile:
      type: object
      properties:
        MpgLoaded:
          type: number
          format: double
          nullable: true
        MpgEmpty:
          type: number
          format: double
          nullable: true
        TankCapacity:
          allOf:
            - $ref: '#/components/schemas/Alvys.Volume'
          nullable: true
        TankCount:
          type: integer
          format: int32
          nullable: true
        FuelKind:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.FuelKind'
          nullable: true
      additionalProperties: false
    Alvys.WeightWeightUnits:
      enum:
        - Kilograms
        - Grams
        - Pounds
        - Ounces
        - Tons
        - CWT
        - MetricTon
        - LongTon
      type: string
    Alvys.Length:
      required:
        - Value
        - Unit
      type: object
      properties:
        Value:
          type: number
          format: double
        Unit:
          allOf:
            - $ref: '#/components/schemas/Alvys.LengthUnits'
      additionalProperties: false
    Alvys.Volume:
      required:
        - UnitOfMeasure
        - Value
      type: object
      properties:
        Value:
          type: number
          format: double
        UnitOfMeasure:
          allOf:
            - $ref: '#/components/schemas/Alvys.VolumeVolumeUnits'
      additionalProperties: false
    Alvys.Models.FuelKind:
      enum:
        - Diesel
        - Gasoline
        - Cng
        - Lng
        - Electric
        - Hybrid
      type: string
    Alvys.Features.FuelServices.Models.FuelTypeConfig:
      type: object
      properties:
        FuelType:
          type: string
          nullable: true
        DeductFuel:
          type: boolean
          nullable: true
        FuelDiscounted:
          type: boolean
          nullable: true
      additionalProperties: false
    Alvys.LengthUnits:
      enum:
        - Feet
        - Inches
        - Yards
        - Meters
      type: string
    Alvys.VolumeVolumeUnits:
      enum:
        - Gallons
        - Liters
        - Bushels
        - CubicFoot
        - CubicMeter
        - Quarts
      type: string
  securitySchemes:
    Public:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        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>`.

````