Skip to main content
POST
/
v6
/
mileage
Save mileage
curl --request POST \
  --url https://sandbox.tight.com/v6/mileage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": [
    {
      "id": "mlg_12345",
      "date": "2024-03-15",
      "status": "ACTIVE",
      "mileageStatus": "BUSINESS",
      "description": "Drive to client meeting",
      "notes": "Client was not available",
      "customerId": "cus_4852707",
      "classSegmentIds": [
        "<string>"
      ],
      "distance": {
        "type": "MILE",
        "value": "12.5"
      },
      "start": {
        "time": "2023-11-07T05:31:56Z",
        "lat": "38.8977",
        "lng": "-77.0365",
        "locationId": "loc_28868401",
        "address": {
          "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",
        "locationId": "loc_28868401",
        "address": {
          "state": "<string>",
          "city": "<string>",
          "zip": "<string>",
          "phoneWork": "<string>",
          "address1": "<string>",
          "address2": "<string>"
        }
      },
      "duration": 3600000,
      "deduction": {
        "amount": 6775
      },
      "carId": "car_28868401",
      "customData": {
        "internal_key": "some_internal_key",
        "some_other_field": 23434
      }
    }
  ]
}
'
{
  "result": "SUCCESS",
  "data": [
    {
      "result": "SUCCESS",
      "statusCode": 200,
      "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
        }
      },
      "error": [
        {
          "type": "UNKNOWN_ERROR",
          "message": "<string>",
          "param": "<string>"
        }
      ]
    }
  ],
  "error": [
    {
      "type": "UNKNOWN_ERROR",
      "message": "<string>",
      "param": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
data
object[]
required

Response

Success

result
enum<string>

The result of the action performed.

Available options:
SUCCESS,
FAILURE
data
object[]

The data generated by the action performed.

error
object[]