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.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.
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.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.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.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.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.| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
vehicleId | int | Yes | — | ID of the vehicle being filled up |
fillUpDate | DateTime | Yes | — | Date and time of the fill-up (UTC recommended) |
isOdometerInMiles | bool | Yes | — | true if the odometer reading is in miles |
currentOdometer | decimal | Yes | ≥ 0 | Raw odometer reading at fill-up time |
isVolumeInGallons | bool | Yes | — | true if the fuel volume is in US gallons |
inputVolume | decimal | Yes | 0.1 – 1000 | Fuel volume added in the native unit |
isPaidInUsd | bool | Yes | — | true if the cost was paid in USD |
inputCost | decimal | Yes | ≥ 0 | Total amount paid in the native currency |
appliedExchangeRate | decimal? | Conditional | — | Required when isPaidInUsd is true |
isFullTank | bool | Yes | — | true if the tank was filled to capacity |
notes | string? | No | ≤ 500 chars | Optional 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.| Field | Type | Description |
|---|---|---|
id | int | Unique fuel log identifier |
vehicleId | int | The vehicle this log belongs to |
fillUpDate | DateTime | Date and time of the fill-up (UTC) |
distanceTraveledKm | decimal | Kilometers driven since the previous fill-up |
volumeLiters | decimal | Fuel volume in liters (normalized) |
totalCostMxn | decimal | Total cost in Mexican Pesos (normalized) |
odometerKm | decimal | Odometer reading converted to kilometers |
isFullTank | bool | Whether the tank was topped off |
Example Request
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
| Method | Path | Description |
|---|---|---|
GET | /api/fuellogs/vehicle/{vehicleId} | List all logs for a vehicle |
POST | /api/fuellogs | Create a new fuel log |
PUT | /api/fuellogs/{id} | Update an existing fuel log |
DELETE | /api/fuellogs/{id} | Delete a fuel log |