Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JReyna217/AutoLog/llms.txt

Use this file to discover all available pages before exploring further.

Fuel logs are the core data source of AutoLog. Every time you fill up, you record the date, current odometer reading, fuel volume pumped, and total cost paid. AutoLog accepts both imperial (miles, US gallons) and metric (kilometers, liters) inputs, as well as costs in USD or MXN — then normalizes everything to kilometers and Mexican Pesos so that your analytics remain consistent regardless of where or how you filled up.

How Normalization Works

When a fuel log is created, AutoLog inspects three boolean flags in the request and converts the raw input values into their normalized counterparts before persisting to the database.
1

Odometer normalization

If IsOdometerInMiles is true, the submitted CurrentOdometer value is multiplied by 1.60934 to produce the internal kilometer value used for distance calculations. If false, the value is stored as-is in kilometers.
2

Volume normalization

If IsVolumeInGallons is true, the submitted InputVolume is multiplied by 3.78541 to calculate VolumeLiters, and the original gallon figure is preserved in OriginalVolumeGallons. If false, InputVolume is stored directly as VolumeLiters.
3

Currency normalization

If IsPaidInUsd is true, an AppliedExchangeRate must be provided. The submitted InputCost is multiplied by AppliedExchangeRate to produce TotalCostMxn, and the original USD amount is preserved in OriginalCostUsd. If false, InputCost is stored directly as TotalCostMxn.
4

Distance calculation

DistanceTraveledKm is not entered by the user. When a new log is saved, AutoLog retrieves the previous fill-up for the same vehicle and calculates the distance driven as the difference between the two normalized odometer readings. The result is written back to the previous log record.

CreateFuelLogRequest Fields

The following fields are accepted when creating or updating a fuel log entry.
FieldTypeRequiredConstraintsDescription
vehicleIdintYesID of the vehicle being filled up
fillUpDateDateTimeYesDate and time of the fill-up (UTC recommended)
isOdometerInMilesboolYestrue if the odometer reading is in miles
currentOdometerdecimalYes≥ 0Raw odometer reading at fill-up time
isVolumeInGallonsboolYestrue if the fuel volume is in US gallons
inputVolumedecimalYes0.1 – 1000Fuel volume added in the native unit
isPaidInUsdboolYestrue if the cost was paid in USD
inputCostdecimalYes≥ 0Total amount paid in the native currency
appliedExchangeRatedecimal?ConditionalRequired when isPaidInUsd is true
isFullTankboolYestrue if the tank was filled to capacity
notesstring?No≤ 500 charsOptional free-text notes about the fill-up

FuelLogResponse Fields

The response object returned after creating or fetching a fuel log contains only normalized values suitable for display and analytics.
FieldTypeDescription
idintUnique fuel log identifier
vehicleIdintThe vehicle this log belongs to
fillUpDateDateTimeDate and time of the fill-up (UTC)
distanceTraveledKmdecimalKilometers driven since the previous fill-up
volumeLitersdecimalFuel volume in liters (normalized)
totalCostMxndecimalTotal cost in Mexican Pesos (normalized)
odometerKmdecimalOdometer reading converted to kilometers
isFullTankboolWhether the tank was topped off
Use the Exchange Rates feature to maintain an up-to-date catalog of daily USD/MXN rates. When logging a fill-up paid in USD, look up the rate for that day and pass it as appliedExchangeRate to ensure accurate MXN conversion in your spending analytics.

Example Request

{
  "vehicleId": 3,
  "fillUpDate": "2025-06-15T10:30:00Z",
  "isOdometerInMiles": false,
  "currentOdometer": 54320.5,
  "isVolumeInGallons": false,
  "inputVolume": 42.5,
  "isPaidInUsd": false,
  "inputCost": 985.00,
  "appliedExchangeRate": null,
  "isFullTank": true,
  "notes": "Highway fill-up, PEMEX station km 142"
}
For a fill-up paid in USD with imperial units:
{
  "vehicleId": 3,
  "fillUpDate": "2025-06-20T18:00:00Z",
  "isOdometerInMiles": true,
  "currentOdometer": 33740.0,
  "isVolumeInGallons": true,
  "inputVolume": 12.3,
  "isPaidInUsd": true,
  "inputCost": 51.40,
  "appliedExchangeRate": 17.2500,
  "isFullTank": true,
  "notes": "Cross-border fill-up, Laredo TX"
}

API Endpoints

GET /api/fuellogs/vehicle/{vehicleId}

Returns all fuel log entries for a specific vehicle, ordered by date.

POST /api/fuellogs

Creates a new fuel log entry. Returns 201 Created with the saved record.

PUT /api/fuellogs/{id}

Updates metadata on an existing log (date, full tank flag, notes). Returns 204 No Content.

DELETE /api/fuellogs/{id}

Deletes a fuel log by ID. Returns 204 No Content.

Quick Reference

MethodPathDescription
GET/api/fuellogs/vehicle/{vehicleId}List all logs for a vehicle
POST/api/fuellogsCreate a new fuel log
PUT/api/fuellogs/{id}Update an existing fuel log
DELETE/api/fuellogs/{id}Delete a fuel log
Fuel Log API Reference

Build docs developers (and LLMs) love