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

# Search toll transactions

> Search toll transactions with paginated POST filters — transponder, driver, unit, plaza, date range, and amount, returning per-transaction detail.

This endpoint provides detailed information about each toll transaction that matches the search criteria, facilitating efficient management and retrieval of toll transaction records.

The Search Toll Transactions API endpoint allows you to search for toll transactions within the Alvys system based on various criteria such as transponder ID, unit IDs, and date range. This endpoint provides detailed information about each toll transaction that matches the search criteria, facilitating efficient management and retrieval of toll transaction records.

### Request Parameters

The following parameter is required in the URL path:

| Parameter | Type   | Required | Description             |
| --------- | ------ | -------- | ----------------------- |
| version   | String | Yes      | The API version to use. |

#### Request Body

The following fields are required in the request body to filter the search results:

`<Table>`

<thead>
  <tr>
    <th>
      Parameter
    </th>

    <th>
      Type
    </th>

    <th>
      Required
    </th>

    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Page
    </td>

    <td>
      Integer
    </td>

    <td>
      Yes
    </td>

    <td>
      The page number to retrieve.
    </td>
  </tr>

  <tr>
    <td>
      PageSize
    </td>

    <td>
      Integer
    </td>

    <td>
      Yes
    </td>

    <td>
      The number of results per page.\
      PageSize must be greater than 0.
    </td>
  </tr>

  <tr>
    <td>
      TransponderId
    </td>

    <td>
      String
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The transponder ID used for the toll transactions. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      UnitIds
    </td>

    <td>
      Array of Strings
    </td>

    <td>
      Conditionally
    </td>

    <td>
      A list of unit IDs to filter by. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      DateRange
    </td>

    <td>
      Object
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The date range for the toll transactions. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      DateRange.Start
    </td>

    <td>
      String (Date-Time)
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The start date of the transaction range. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      DateRange.End
    </td>

    <td>
      String (Date-Time)
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The end date of the transaction range. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>
</tbody>

`</Table>`

#### Example CURL request

Use the Current API version number and make sure to replace the Authorization header value with your actual Bearer token for the request:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/tolls/search' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ...' \
--header 'Content-Type: application/json' \
--data '{
  "Page": 0,
  "PageSize": 100,
  "TransponderId": "",
  "UnitIds": [
      "TR25123456789"
  ],
  "DateRange": {
      "Start": "2021-07-23T14:48:05.234Z",
      "End": "2024-07-23T14:48:05.234Z"
  }
}'
```

### Response Parameters

The following table lists the parameters included in the response for toll transaction search requests:

| Parameter                     | Type               | Required | Description                                                     |
| ----------------------------- | ------------------ | -------- | --------------------------------------------------------------- |
| Page                          | Integer            | Yes      | The current page number of the results.                         |
| PageSize                      | Integer            | Yes      | The number of results per page.                                 |
| Total                         | Integer            | Yes      | The total number of matching toll transactions.                 |
| Items                         | Array of Objects   | Yes      | The list of toll transaction records matching the criteria.     |
| Items.Id                      | String             | Yes      | The unique identifier of the toll transaction.                  |
| Items.SubsidiaryId            | String             | No       | The subsidiary ID associated with the transaction.              |
| Items.TransactionId           | String             | No       | The external transaction ID from the toll provider.             |
| Items.TransponderId           | String             | No       | The transponder ID associated with the transaction.             |
| Items.Source                  | String             | Yes      | The toll provider (e.g., PrePass, BestPass, IPass).             |
| Items.Agency                  | String             | Yes      | The tolling agency that issued the transaction.                 |
| Items.UnitId                  | String             | No       | The Alvys unit ID associated with the transaction.              |
| Items.UnitNumber              | String             | No       | The unit number associated with the transaction.                |
| Items.LicenseState            | String             | No       | The state where the vehicle is licensed.                        |
| Items.LicensePlate            | String             | No       | The license plate of the vehicle.                               |
| Items.PrePaid                 | Boolean            | Yes      | Indicates whether the toll was prepaid.                         |
| Items.Service                 | String             | No       | The toll road or service (e.g., Texas Toll Roads, PA Turnpike). |
| Items.CostCenter              | String             | No       | The cost center associated with the transaction.                |
| Items.EntryLane               | String             | No       | The lane used at entry.                                         |
| Items.EntryPlazaId            | String             | No       | The identifier of the entry plaza.                              |
| Items.EntryPlazaName          | String             | No       | The name of the entry plaza.                                    |
| Items.EntryTime               | String (Date-Time) | No       | The date and time of entry.                                     |
| Items.ExitLane                | String             | No       | The lane used at exit.                                          |
| Items.ExitPlazaId             | String             | No       | The identifier of the exit plaza.                               |
| Items.ExitPlazaName           | String             | No       | The name of the exit plaza.                                     |
| Items.ExitTime                | String (Date-Time) | No       | The date and time of exit.                                      |
| Items.FormattedLocation       | String             | No       | The formatted location of the toll transaction.                 |
| Items.Amount                  | Object             | Yes      | The toll amount.                                                |
| Items.Amount.Amount           | Number             | Yes      | The monetary value of the toll.                                 |
| Items.Amount.Currency         | Integer            | Yes      | The currency identifier of the toll amount.                     |
| Items.RunningBalance          | Object             | No       | The running account balance after the transaction.              |
| Items.RunningBalance.Amount   | Number             | No       | The monetary value of the running balance.                      |
| Items.RunningBalance.Currency | Integer            | No       | The currency identifier of the running balance.                 |
| Items.Fee                     | Object             | No       | The fee charged for the transaction.                            |
| Items.Fee.Amount              | Number             | No       | The monetary value of the fee.                                  |
| Items.Fee.Currency            | Integer            | No       | The currency identifier of the fee.                             |
| Items.PostedAt                | String (Date-Time) | No       | The date and time when the transaction was posted.              |
| Items.TransactionDate         | String (Date-Time) | Yes      | The date and time when the toll transaction occurred.           |

#### 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/281748d-Sear.gif?s=d875694f02e2c1faf1c5eceb4e2b3e4e" alt="" width="706" height="844" data-path="images/migrated/281748d-Sear.gif" />

<br />

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

This page is interactive, allowing you to try a request by specifying the API version in the URL path and providing the necessary request body. 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 POST /api/p/v{version}/tolls/search
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}/tolls/search:
    post:
      tags:
        - Tolls
      summary: Search toll transactions
      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.Tolls.TollSearchRequest'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Tolls.TollSearchRequest'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Tolls.TollSearchRequest'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Tolls.TollSearchRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Alvys.Helpers.PagedResponse1Alvys.Models.Tolls.TollDto
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
        '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.Tolls.TollSearchRequest:
      required:
        - Page
        - PageSize
      type: object
      properties:
        Page:
          type: integer
          format: int32
        PageSize:
          type: integer
          format: int32
        TransponderId:
          type: string
          nullable: true
        UnitIds:
          type: array
          items:
            type: string
          nullable: true
        DateRange:
          allOf:
            - $ref: '#/components/schemas/Alvys.Models.Period'
          nullable: true
      additionalProperties: false
    Alvys.Helpers.PagedResponse1Alvys.Models.Tolls.TollDto:
      required:
        - Items
        - Page
        - PageSize
        - Total
      type: object
      properties:
        Page:
          type: integer
          format: int32
        PageSize:
          type: integer
          format: int32
        Facets:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/Alvys.Helpers.ResultSetFacetItem'
          nullable: true
        Total:
          type: integer
          format: int64
        Items:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Tolls.TollDto'
      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.Models.Period:
      required:
        - Start
      type: object
      properties:
        Start:
          type: string
          format: date-time
        End:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    Alvys.Helpers.ResultSetFacetItem:
      required:
        - Count
        - Value
      type: object
      properties:
        Value:
          type: string
        Count:
          type: integer
          format: int64
      additionalProperties: false
    Alvys.Models.Tolls.TollDto:
      required:
        - Agency
        - Amount
        - Id
        - PrePaid
        - Source
        - TransactionDate
      type: object
      properties:
        Id:
          type: string
        SubsidiaryId:
          type: string
          nullable: true
        TransactionId:
          type: string
          nullable: true
        TransponderId:
          type: string
          nullable: true
        Source:
          type: string
        Agency:
          type: string
        UnitId:
          type: string
          nullable: true
        UnitNumber:
          type: string
          nullable: true
        LicenseState:
          type: string
          nullable: true
        LicensePlate:
          type: string
          nullable: true
        PrePaid:
          type: boolean
        Service:
          type: string
          nullable: true
        CostCenter:
          type: string
          nullable: true
        EntryLane:
          type: string
          nullable: true
        EntryPlazaId:
          type: string
          nullable: true
        EntryPlazaName:
          type: string
          nullable: true
        EntryTime:
          type: string
          format: date-time
          nullable: true
        ExitLane:
          type: string
          nullable: true
        ExitPlazaId:
          type: string
          nullable: true
        ExitPlazaName:
          type: string
          nullable: true
        ExitTime:
          type: string
          format: date-time
          nullable: true
        FormattedLocation:
          type: string
          nullable: true
        Amount:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        RunningBalance:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
          nullable: true
        Fee:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
          nullable: true
        PostedAt:
          type: string
          format: date-time
          nullable: true
        TransactionDate:
          type: string
          format: date-time
      additionalProperties: false
    Alvys.Money:
      required:
        - Amount
      type: object
      properties:
        Amount:
          type: number
          format: double
        Currency:
          type: integer
          format: int32
          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>`.

````