> ## 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 fuel transaction

> Retrieve a single fuel transaction by ID from Alvys, including card number, driver, unit, gallons, price per gallon, location, and posted totals.

The endpoint for retrieving fuel information by ID requires specifying the fuel entry's unique ID and the API version in the URL path. This 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 parameters are required in the URL path:

| Parameter | Type   | Required | Description                              |
| --------- | ------ | -------- | ---------------------------------------- |
| version   | String | Yes      | The API version to use.                  |
| id        | String | Yes      | The unique identifier of the fuel entry. |

#### Example CURL request

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

Replace `{version}` with the API version number, `{id}` with the actual fuel ID, and `YOUR_ACCESS_TOKEN` with your actual Bearer token:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/fuel/43000ba1-b001-408d-b00f-c00f8004add' \
--header 'Authorization: Bearer eLOETt0hFmWxz_1VBt_oYx9YuSVTWCbZjjNUz8DTKN_EPhH12hs3al...'
```

### Response Parameters

The following table lists the parameters included in the response for the fuel-related request:

| Parameter              | Type               | Description                                                      |
| ---------------------- | ------------------ | ---------------------------------------------------------------- |
| Id                     | String             | The unique identifier of the fuel transaction.                   |
| TransactionId          | String             | The transaction ID.                                              |
| SubsidiaryId           | String             | The subsidiary ID associated with the transaction.               |
| SubsidiaryName         | String             | The name of the subsidiary associated with the transaction.      |
| TruckId                | String             | The unique identifier of the truck.                              |
| TruckNumber            | String             | The truck number associated with the transaction.                |
| DriverId               | String             | The unique identifier of the driver.                             |
| DriverName             | String             | The name of the driver.                                          |
| OwnerOperatorId        | String             | The unique identifier of the owner-operator.                     |
| OwnerOperatorName      | String             | The name of the owner-operator.                                  |
| Source                 | String             | The name of the fuel card provider.                              |
| Type                   | String             | The raw fuel type provided by the fuel provider.                 |
| Category               | String             | The internal fuel category (e.g., Diesel, DEF, Cash Advance).    |
| Description            | String             | The fuel product description provided by the fuel card provider. |
| Location               | Object             | The location details of the transaction.                         |
| Location.Id            | String             | The unique identifier of the location.                           |
| Location.Name          | String             | The name of the location.                                        |
| Location.City          | String             | The city of the location.                                        |
| Location.State         | String             | The state of the location.                                       |
| Location.Address       | String             | The address of the location.                                     |
| Location.Country       | String             | The country of the location.                                     |
| FuelTotal              | Object             | The total fuel amount.                                           |
| FuelTotal.Amount       | Number             | The amount of fuel.                                              |
| FuelTotal.Currency     | Integer            | The currency of the fuel amount.                                 |
| Fees                   | Object             | The total fees.                                                  |
| Fees.Amount            | Number             | The amount of fees.                                              |
| Fees.Currency          | Integer            | The currency of the fees amount.                                 |
| Discounts              | Object             | The total discounts.                                             |
| Discounts.Amount       | Number             | The amount of discounts.                                         |
| Discounts.Currency     | Integer            | The currency of the discounts amount.                            |
| Advances               | Object             | The total advances.                                              |
| Advances.Amount        | Number             | The amount of advances.                                          |
| Advances.Currency      | Integer            | The currency of the advances amount.                             |
| Total                  | Object             | The total amount including fuel, fees, discounts, and advances.  |
| Total.Amount           | Number             | The total amount.                                                |
| Total.Currency         | Integer            | The currency of the total amount.                                |
| Quantity               | Object             | Details of the fuel quantity purchased.                          |
| Quantity.Value         | Number             | The numeric value of the fuel purchased.                         |
| Quantity.UnitOfMeasure | String             | The unit of measure (e.g., Gallons).                             |
| TransactionDate        | String (date-time) | The date and time of the fuel transaction.                       |

#### Example Response

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

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

This page is interactive, allowing you to try a request by specifying the API version and fuel 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}/fuel/{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}/fuel/{id}:
    get:
      tags:
        - Fuel
      summary: Get fuel transaction
      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.FuelResponse'
        '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.FuelResponse:
      required:
        - Advances
        - Discounts
        - Fees
        - FuelTotal
        - Id
        - Quantity
        - Source
        - Total
        - TransactionId
      type: object
      properties:
        Id:
          type: string
        TransactionId:
          type: string
        SubsidiaryId:
          type: string
          nullable: true
        SubsidiaryName:
          type: string
          nullable: true
        TruckId:
          type: string
          nullable: true
        TruckNumber:
          type: string
          nullable: true
        DriverId:
          type: string
          nullable: true
        DriverName:
          type: string
          nullable: true
        OwnerOperatorId:
          type: string
          nullable: true
        OwnerOperatorName:
          type: string
          nullable: true
        Source:
          type: string
        Type:
          type: string
          nullable: true
        Category:
          type: string
          nullable: true
        Description:
          type: string
          nullable: true
        Location:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Models.Trucks.FuelResponsePumpLocation
          nullable: true
        FuelTotal:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        Fees:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        Discounts:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        Advances:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        Total:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        Quantity:
          allOf:
            - $ref: '#/components/schemas/Alvys.Volume'
        TransactionDate:
          type: string
          format: date-time
          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: {}
    Alvys.Models.Trucks.FuelResponsePumpLocation:
      type: object
      properties:
        Id:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        City:
          type: string
          nullable: true
        State:
          type: string
          nullable: true
        Address:
          type: string
          nullable: true
        Country:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Money:
      required:
        - Amount
      type: object
      properties:
        Amount:
          type: number
          format: double
        Currency:
          type: integer
          format: int32
          nullable: true
      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.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>`.

````