You will be able to record every fuel fill for an asset and read its fuel economy for any period. Dispatch works the figure out from the stretch between two full fills, and it keeps every stretch it cannot use on the list with a plain label.
Before you start #
- The
dispatch_fleetlicence flag is on for your account (it is in the Business plan, an add-on for Starter and Pro, and included in the 14-day trial). - The asset exists and has an odometer, or an hours meter for equipment that counts hours only.
- Fuel is entered in the volume unit of your business (set in your locale settings). Each fill can carry its own
volume_unit:l,gal_usorgal_uk.
Steps #
- Send
POST /fleet/assets/:id/fuelfor each fill withvolume,odometer(orhours),full_tankand, when you have the receipt,total_centsandtax_cents. The answer holds the newidand, when a total was given, theexpense_idof the linked expense. - Leave
full_tankastruefor a full fill. Sendfalsefor a part fill, which joins the volume of its stretch. - Send
missed_prior: truewhen you know an earlier fill was never recorded. - Read the result with
GET /fleet/assets/:id/fuel/economy. Addfromandtoto choose the period, andbasis=hoursfor hours-only equipment. - Look at each segment:
economyholds the figure,includedsays whether it counts, andexcluded_labelgives the reason in words when it does not.
How a figure is worked out #
A segment runs from one full fill to the next. Its volume is every fill after the first one, up to and including the closing fill. Its distance is the odometer difference between the two fills. The fill that opens the segment gives only its odometer reading, so its litres belong to the segment before it.
For distance, the economy is litres per 100 km in hundredths, shown in the units of your business. For hours-only equipment, the economy is litres per hour in hundredths, and span is hours in hundredths.
A period report adds up the usable segments whose closing fill falls in the period. It also lists the fuel that no usable segment accounts for (unmatched_volume_ml) and the distance covered in excluded segments (unattributed_span), apart from the economy.
Why a segment is excluded #
Dispatch never deletes a segment. It marks it excluded and shows the label below.
| Code | Label shown |
|---|---|
missed_prior | A fill-up before this one was not recorded. |
no_odometer | A fill-up has no odometer reading. |
order_conflict | The odometer readings and the dates do not agree. |
span_too_short | Too little distance to give a meaningful figure. |
volume_too_small | Too little fuel to give a meaningful figure. |
outlier | Far from this asset's usual figures. |
When a fill has no reading of its own, Dispatch reads the value from the meter log at that moment. The segment then counts and carries the note "Estimated from the meter log."
Technical details
- Limits in force: at least 10 km of distance (or 1.00 hour), at least 5 litres of fuel, and for the outlier test at least 4 other usable segments for the same asset. A segment is an outlier when its modified z-score against the asset's other segments is above 3.5.
- The fuel log is the record that counts. The expense row created with a fill is a view linked by a unique
fuel_log_id. To change a fuel expense, correct the fuel fill. Voiding the linked expense directly returnsconflict. - A fill with an odometer writes a meter reading with source
fuel.
If something goes wrong #
feature_not_licensed(403): the Fleet flag is off. Reads and exports keep working.licence_read_only(403): the licence is in read-only state. Renew it, then record the fill again.validation_failed(422):volumeis missing or zero,paid_byholds a value other thancompany,driveroraccount, orvolume_unitis unknown.invalid_date(422):filled_atneeds the form of an ISO 8601 date-time.not_found(404): no asset has that id.- A segment you expected to count is excluded: read its
excluded_label, fix the cause (add the missing odometer, or record the missing fill), and read the economy again.