> ## 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.

# Update truck

> Partially update a truck by ID in Alvys, changing only the fields you send, such as plates, status, weights, fuel profile, leases, or ELD links.

The Update Truck endpoint applies a partial update to an existing truck. Send only the fields you want to change. A field that is absent from the body keeps its stored value. An empty string clears a free-text field. 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:update` scope. See [Authentication](https://docs.alvys.com/en/api/guides/authentication-1.md).

### If-Match is required

This endpoint uses optimistic concurrency. Send the truck's current `ETag` in the `If-Match` header. The `ETag` response header of [Get truck](https://docs.alvys.com/en/api/reference/trucks/get-truck.md), [Create truck](https://docs.alvys.com/en/api/reference/trucks/create-truck.md), and every successful update carries it.

* If you omit `If-Match`, the request is rejected with `428 Precondition Required`.
* If the truck changed after you read it, the request is rejected with `412 Precondition Failed`. Get the truck again and retry with the new `ETag`.

### Fields that are replaced whole

`Dimensions`, `FuelProfile`, `TollPasses`, `IftaEnrollments`, `EldProviders`, and `References` are replaced whole: send the complete value you want stored. For the four arrays, `null` clears the list.

* **EldProviders:** moving the truck off an ELD link stops its location updates from that provider. Omit `SensorId`, or send `null`, to keep the sensor id stored on the same link.
* **References:** include the `Id` of each reference already on the truck that you want to keep or edit. Omit `Id` for a new reference. A reference identical to one already stored is kept as it is.

### Truck number and VIN must stay unique

If you change `TruckNum` or `VinNumber` to a value another truck 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 truck 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 truck 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 truck: it goes back to the carrier of its subsidiary. 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 owner operator when the truck moves to one.

***

### 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 truck. |

The following header is required:

| Header | Required | Description |
| - | - | - |
| If-Match | Yes | The current `ETag` of the truck being updated. |

***

### Request body

All fields are optional. The fields are the same as in [Create truck](https://docs.alvys.com/en/api/reference/trucks/create-truck.md#request-body), with these differences:

| Field | Type | Description |
| - | - | - |
| TruckNum | String | The new truck number. Must be unique among your company's trucks. |
| 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 truck, to keep or edit it. Omit for a new reference. |

***

### Example cURL request

```bash theme={null}
curl --location --request PATCH 'https://integrations.alvys.com/api/p/v1/trucks/TL100000000000000417' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--header 'If-Match: "00000000-0000-0000-0000-000000000001"' \
--data-raw '{
  "LicenseNum": "XYZ9876",
  "LicenseExpirationDate": "2028-03-31",
  "TollPasses": [
    { "PassType": "E-ZPass", "PassValue": "0001234567" },
    { "PassType": "PrePass", "PassValue": "PP-000417" }
  ]
}'
```

Replace `YOUR_ACCESS_TOKEN` with your actual Bearer token and the `If-Match` value with the truck's current `ETag`.

***

### Response fields

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

***

### Status codes

| Status | Meaning |
| - | - |
| 200 | The truck 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 `truck:update` scope. |
| 404 | No company-owned truck with the given `id` exists in the subsidiaries your credential can access. |
| 409 | Another truck in your company has the same `TruckNum` (`DuplicateAssetNumber`) or `VinNumber` (`DuplicateVin`). |
| 412 | The `If-Match` value did not match the current truck. Get the truck again and retry. |
| 422 | A referenced record is not usable. See [Why a request is refused with 422](#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 problem `type` 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 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 PATCH /api/p/v{version}/trucks/{id}
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/{id}:
    patch:
      tags:
        - Trucks
      summary: Update truck
      description: >-
        Partial update. A field that is absent from the body is left unchanged;
        an empty string clears a free-text field. Requires If-Match with the
        ETag from your most recent GET, POST or PATCH; a stale ETag answers 412.
        Status is shown in the dispatch planner but does not by itself block
        dispatch; to take a truck out of the planner schedule an event (POST
        /trucks/events). In Shop and Active are also set by the maintenance
        work-order sync when a work order starts and completes, so a status you
        write may be overwritten by it.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
        - name: If-Match
          in: header
          required: true
          description: >-
            The truck's current ETag (the ETag response header of your most
            recent GET, POST or PATCH), for optimistic concurrency. Required; if
            omitted the request is rejected with 428.
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckUpdateRequest'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckUpdateRequest'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckUpdateRequest'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Trucks.TruckUpdateRequest'
        required: true
      responses:
        '200':
          description: OK
          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'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/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'
        '412':
          description: Precondition Failed (If-Match ETag did not match the current truck)
          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'
        '428':
          description: Precondition Required (If-Match header missing)
          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.TruckUpdateRequest:
      type: object
      properties:
        TruckNum:
          type: string
          nullable: true
        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. A
            maintenance work order started in Alvys moves the truck to In Shop
            and back to Active on its own.
          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, ...). Replaced
            whole.
          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). Replaced whole.
          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. null clears.
          nullable: true
        IftaEnrollments:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Assets.IftaEnrollmentRequest'
          description: IFTA enrollments, replaced whole. null clears.
          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. null clears.
          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. null clears.
          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>`.

````