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

# Get truck

> Retrieve a single truck record by ID, including truck number, make and model, VIN, license plate, current driver, and last reported GPS position.

The endpoint for retrieving trucks by ID requires specifying the API version in the URL path. Including the version number ensures that your application interacts with the correct version of the API, providing stability and compatibility as the API evolves. For more information on how versioning works and how to include it in your requests, please refer to the [Versioning](/docs/versioning) page.

### Request Parameters

The following parameter is required in the URL path:

| Parameter | Type   | Required | Description                             |
| --------- | ------ | -------- | --------------------------------------- |
| version   | String | Yes      | The version of the API being requested. |
| id        | String | Yes      | The unique identifier of the truck.     |

#### Example CURL request

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v{version}/trucks/{truckId}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

Replace `{version}` with the API version number, `{truckId}` with the actual truck ID, and `YOUR_ACCESS_TOKEN` with your actual Bearer token.

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/trucks/TL123456789123400402' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ...'
```

### Response Parameters

The following table lists the parameters included in the response for truck-related requests.

| Parameter                          | Type               | Description                                                      |
| ---------------------------------- | ------------------ | ---------------------------------------------------------------- |
| Id                                 | String             | The unique identifier of the truck.                              |
| TruckNum                           | String             | The truck number.                                                |
| VinNumber                          | String             | The Vehicle Identification Number (VIN) of the truck.            |
| Year                               | Integer            | The manufacturing year of the truck.                             |
| Make                               | String             | The manufacturer of the truck.                                   |
| Model                              | String             | The model of the truck.                                          |
| LicenseNum                         | String             | The license plate number of the truck.                           |
| LicenseState                       | String             | The state that issued the truck's license plate.                 |
| LicenseCountry                     | String             | The country where the truck is licensed (USA, Canada, Mexico).   |
| PlateExpirationDate                | String (Date-Time) | The expiration date of the truck's license plate.                |
| LicenseExpirationDate              | String (Date-Time) | The expiration date of the truck's license.                      |
| Status                             | String             | The current status of the truck (e.g., Active).                  |
| SubsidiaryId                       | String             | The subsidiary ID associated with the truck.                     |
| NumberOfAxles                      | Integer            | The number of axles on the truck.                                |
| Fleet                              | Object             | The fleet details associated with the truck.                     |
| Fleet.Id                           | String             | The unique identifier of the fleet.                              |
| Fleet.Name                         | String             | The name of the fleet.                                           |
| Fleet.InvoiceNumberPrefix          | String             | The invoice number prefix for the fleet.                         |
| GrossWeight                        | Object             | The gross weight details of the truck.                           |
| GrossWeight.Value                  | Integer            | The value of the gross weight.                                   |
| GrossWeight.UnitOfMeasure          | String             | The unit of measure for the gross weight (e.g., Kilograms).      |
| EmptyWeight                        | Object             | The empty weight details of the truck.                           |
| EmptyWeight.Value                  | Integer            | The value of the empty weight.                                   |
| EmptyWeight.UnitOfMeasure          | String             | The unit of measure for the empty weight (e.g., Kilograms).      |
| Color                              | String             | The color of the truck.                                          |
| FuelType                           | String             | The type of fuel used by the truck.                              |
| FuelCards                          | Array of Objects   | The list of fuel cards associated with the truck.                |
| FuelCards.id                       | String             | The unique identifier of the fuel card.                          |
| FuelCards.CardNumber               | String             | The card number of the fuel card.                                |
| FuelCards.Provider                 | String             | The provider of the fuel card.                                   |
| FuelCards.DeductFuel               | Boolean            | Indicates if fuel costs are deducted.                            |
| FuelCards.ApplyFuelDiscount        | Boolean            | Indicates if a fuel discount is applied.                         |
| FuelCards.DeductFromId             | String             | The ID from which fuel costs are deducted.                       |
| FuelCards.DeductFromName           | String             | The name from which fuel costs are deducted.                     |
| FuelCards.DeductFromSubsidiary     | String             | The subsidiary from which fuel costs are deducted.               |
| FuelCards.DeductFromContractorType | String             | The contractor type from which fuel costs are deducted.          |
| InsuranceCompany                   | String             | The insurance company of the truck.                              |
| InsurancePolicyNumber              | String             | The insurance policy number.                                     |
| InsuranceExpirationDate            | String (Date-Time) | The expiration date of the insurance policy.                     |
| InspectionExpirationDate           | String (Date-Time) | The expiration date of the truck's inspection.                   |
| Notes                              | Array of Objects   | An optional list of notes related to the truck.                  |
| Notes.id                           | String             | The unique identifier of the note.                               |
| Notes.Description                  | String             | The description of the note.                                     |
| Notes.NoteType                     | String             | The type of note.                                                |
| Notes.Time                         | String (Date-Time) | The time the note was created.                                   |
| Notes.User                         | String             | The user who created the note.                                   |
| References                         | Array of Objects   | An optional list of custom references associated with the truck. |
| CreatedAt                          | String (Date-Time) | The date and time when the truck record was created.             |

#### Example Response

On the right side, you can see examples of different error codes by clicking "Example" and selecting the response code.

<img src="https://mintcdn.com/alvys/MPqgFq1pceM5E4R4/images/migrated/4e71ad2-Get_.gif?s=985fd46d5ad0d2b86213700632f5a6ea" alt="" width="706" height="912" data-path="images/migrated/4e71ad2-Get_.gif" />

#### 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](#rate-limits) section.

This page is interactive, allowing you to try a request by providing the truck ID in the URL path. As you fill out the parameters, the Curl command on the right side of the page will be automatically updated. Alternatively, you can directly edit the Curl command. Make sure to authorize yourself before trying a request.


## OpenAPI

````yaml GET /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, search loads, and manage load documents and notes.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read, search trips, manage trip documents, and record stop appointments,
      arrivals, and departures.
  - 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.
paths:
  /api/p/v{version}/trucks/{id}:
    get:
      tags:
        - Trucks
      summary: Get truck
      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'
      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.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            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.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
      additionalProperties: false
    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: {}
    FleetResponse:
      type: object
      properties:
        Id:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        InvoiceNumberPrefix:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Weight:
      required:
        - UnitOfMeasure
        - Value
      type: object
      properties:
        Value:
          type: number
          format: double
        UnitOfMeasure:
          allOf:
            - $ref: '#/components/schemas/Alvys.WeightWeightUnits'
      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.WeightWeightUnits:
      enum:
        - Kilograms
        - Grams
        - Pounds
        - Ounces
        - Tons
        - CWT
        - MetricTon
        - LongTon
      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
  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>`.

````