Skip to main content
POST
/
v6
/
mileage
/
query
Query mileage
curl --request POST \
  --url https://sandbox.tight.com/v6/mileage/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cursor": "<string>",
  "limit": 123,
  "sort": {
    "orderBy": "DATE",
    "direction": "ASC"
  },
  "filter": {
    "status": {
      "in": [
        "ACTIVE"
      ],
      "notIn": [
        "ACTIVE"
      ],
      "equal": "ACTIVE",
      "notEqual": "ACTIVE",
      "greaterThan": "ACTIVE",
      "greaterThanEqual": "ACTIVE",
      "lessThan": "ACTIVE",
      "lessThanEqual": "ACTIVE"
    },
    "mileageStatus": {
      "in": [
        "PENDING"
      ],
      "notIn": [
        "PENDING"
      ],
      "equal": "PENDING",
      "notEqual": "PENDING",
      "greaterThan": "PENDING",
      "greaterThanEqual": "PENDING",
      "lessThan": "PENDING",
      "lessThanEqual": "PENDING"
    }
  }
}
'
{
  "result": "SUCCESS",
  "data": [
    {
      "id": "mlg_12345",
      "date": "2024-03-15",
      "status": "ACTIVE",
      "mileageStatus": "BUSINESS",
      "description": "Drive to client meeting",
      "notes": "Client was not available",
      "customer": {
        "id": "cus_4852707",
        "name": "Abigail Adams",
        "email": "abigail@tight.com"
      },
      "classSegments": [
        {
          "id": "cls_593051",
          "label": {
            "id": "cll_4521",
            "name": "Region",
            "requiredness": "NOT_REQUIRED"
          },
          "name": "Mid-Atlantic",
          "child": {
            "id": "cls_593052",
            "label": {
              "id": "cll_4521",
              "name": "Region",
              "requiredness": "NOT_REQUIRED"
            },
            "name": "Washington DC",
            "child": "<unknown>"
          }
        }
      ],
      "distance": {
        "type": "MILE",
        "value": "12.5"
      },
      "start": {
        "time": "2023-11-07T05:31:56Z",
        "lat": "38.8977",
        "lng": "-77.0365",
        "location": {
          "id": "loc_28868401",
          "name": "Home Office"
        },
        "address": {
          "countryCode": "USA",
          "state": "<string>",
          "city": "<string>",
          "zip": "<string>",
          "phoneWork": "<string>",
          "address1": "<string>",
          "address2": "<string>"
        }
      },
      "end": {
        "time": "2023-11-07T05:31:56Z",
        "lat": "38.8977",
        "lng": "-77.0365",
        "location": {
          "id": "loc_28868401",
          "name": "Home Office"
        },
        "address": {
          "countryCode": "USA",
          "state": "<string>",
          "city": "<string>",
          "zip": "<string>",
          "phoneWork": "<string>",
          "address1": "<string>",
          "address2": "<string>"
        }
      },
      "duration": 3600000,
      "deduction": {
        "amount": 6775
      },
      "route": {
        "id": "mrt_12345",
        "waypoints": [
          {
            "lat": "38.8977",
            "lng": "-77.0365"
          }
        ]
      },
      "car": {
        "id": "car_28868401",
        "name": "My Toyota Camry",
        "make": "Toyota",
        "model": "Camry"
      },
      "customData": {
        "internal_key": "some_internal_key",
        "some_other_field": 23434
      }
    }
  ],
  "cursor": {
    "after": "<string>",
    "before": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, see Authentication for more detail.

Body

application/json
cursor
string | null

Cursor from the previous paginated response

limit
integer<int32>

Page size, i.e. number of items to return per page

Required range: x <= 250
sort
object

Sort order for the items in the response.

filter
object

Filter for items in the response.

Response

Success

result
enum<string>

The result of the action performed.

Available options:
SUCCESS,
FAILURE
data
object[]

The data generated by the action performed.

cursor
object

Cursor to be used in your subsequent paginated request. Only populated if there are more pages available.