---
title: "Update Fuel Entry"
method: PATCH
path: "/fuel_entries/{id}"
tags: ["Fuel Entries"]
---

# Update Fuel Entry

`PATCH /fuel_entries/{id}`

## Request

- Base URL: `https://secure.fleetio.com/api`
- URL: `https://secure.fleetio.com/api/fuel_entries/{id}`
- Auth: API key in header `Authorization` and API key in header `Account-Token`
- TypeScript: <https://skmtc.dev/fleetio/apis/fleetio-developer-api/docs/fuel_entries/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update a Fuel Entry

## Path parameters

- `id` string, required

## Request body

- object
  - `vehicle_id` integer
  - `vendor_id` integer: The Fleetio `id` of the [Vendor](/docs/api/vendors) associated with this Fuel Entry.
  - `fuel_type_id` integer: The Fleetio `id` of the [Fuel Type](/docs/api/fuel-types) associated with this Fuel Entry.
  - `date` string, date-time: We recommend using [ISO-8601](/docs/overview/date-formatting) formatted dates to avoid ambiguity.
  - `us_gallons` number, float: The fuel volume amount in US gallons. This field will _only_ be used if the [Vehicle](/docs/api/vehicles) is [configured to use US gallons](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings), otherwise it will be ignored.
  - `uk_gallons` number, float: The fuel volume amount in UK gallons. This field will _only_ be used if the [Vehicle](/docs/api/vehicles) is [configured to use UK gallons](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings), otherwise it will be ignored.
  - `liters` number, float: The fuel volume amount in liters. This field will be used if the [Vehicle](/docs/api/vehicles) is [configured to use liters](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings).
  - `price_per_volume_unit` number, float: The unit price for the Vehicle's [configured volume unit](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings).
  - `meter_entry_attributes` object: Each Fuel Entry requires an associated [Meter Entry](/docs/api/meter-entries)
    - `value` number, float: The value is the actual number on the meter that increments over time. The unit is determined by the [configured `meter_unit`](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings) on the associated Vehicle.
    - `void` boolean: If you attempt to save a meter value, which is too high or too low, Fleetio's validation rules will reject it. If you need to bypass this validation, you may [mark an entry as void](https://help.fleetio.com/s/article/Meter-Entry-Mark-As-Void-Unmark-As-Void).
  - `reference` string: A reference number or identifier for this Fuel Entry. This field is often used to store a receipt number or other unique identifier.
  - `partial` boolean: Indicates whether this Fuel Entry is a partial fill-up. Partial fill-ups are used to record Fuel Entries that are not full fill-ups. This field is `false` if not provided.
  - `personal` boolean: Indicates whether this Fuel Entry is personal. Personal Fuel Entries are used to record fuel purchases that are not associated with a specific Vehicle or Equipment. This field is `false` if not provided.
  - `custom_fields` CustomFields, nullable: *Full details on working with Custom Fields [here](/docs/overview/custom-fields).
  - `documents_attributes` object[]: An array of one or more document objects to add to the record. Follow our [Attaching Documents and Images](/docs/overview/attaching-documents-and-images) guide to upload to our third party storage provider in order to obtain `file_url`.
    - `name` string: The name to give the file which will be shown in the UI.
    - `file_url` string: The URL obtained from our storage provider that points to the file.
    - `file_mime_type` string: The MIME type of the file. For example, `application/pdf`.
    - `file_name` string: The name of the file.
    - `file_size` integer: The size of the file in bytes.
  - `images_attributes` object[]: An array of one or more image objects to add to the record. Follow our [Attaching Documents and Images](/docs/overview/attaching-documents-and-images) guide to upload to our third party storage provider in order to obtain `file_url`.
    - `name` string: The name to give the image which will be shown in the UI.
    - `file_url` string: The URL obtained from our storage provider that points to the image.
    - `file_mime_type` string: The MIME type of the image. For example, `image/png`.
    - `file_name` string: The name of the image.
    - `file_size` integer: The size of the image file in bytes.

## Response `200`

OK

- FuelEntry, nullable: A Fuel Entry
  - `id` integer, required
  - `created_at` string, date-time: The date and time at which this record was created.
  - `updated_at` string, date-time: The date and time at which this record was most recently updated.
  - `cost_per_hr` number, float, nullable, required: The automatically calculated cost per hour since the last Fuel Entry.
  - `cost_per_km` number, float, nullable, required: The automatically calculated cost per km since the last Fuel Entry.
  - `cost_per_mi` number, float, nullable, required: The automatically calculated cost per mi since the last Fuel Entry.
  - `date` string, date-time, required: The date and time at which this Fuel Entry was recorded.
  - `external_id` string, nullable, required: Used to uniquely identify Fuel Entries that are imported from external systems, such as Fleetcor and Wex.
  - `fuel_type_id` integer, nullable, required: The Fleetio `id` of the `Fuel Type` associated with this Fuel Entry.
  - `fuel_type_name` string, nullable, required: The name of the `Fuel Type` associated with this Fuel Entry.
  - `kpl` number, float, nullable, required: Running average recorded kilometers per liter (calculated automatically).
  - `liters` string, nullable, required: The fuel volume amount in liters. This field will _only_ be used if the [Vehicle](/docs/api/vehicles) is [configured to use liters](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings), otherwise it will be ignored.
  - `liters_per_hr` number, float, nullable, required: Running average recorded liters per hour (calculated automatically).
  - `lp100k` number, float, nullable, required: Running average recorded liters per 100 kilometers (calculated automatically).
  - `mpg_uk` number, float, nullable, required: Running average recorded miles per UK Gallon (calculated automatically).
  - `mpg_us` number, float, nullable, required: Running average recorded miles per US Gallon (calculated automatically).
  - `partial` boolean, required: Used to denote a partial fuel up as opposed to a complete fuel up. Learn more about partial Fuel Entries [here](https://help.fleetio.com/s/article/Partial-Fuel-Entries).
  - `personal` boolean, required: Used to denote a personal expense.
  - `price_per_volume_unit` number, float, nullable, required: The unit price for the `Vehicle`'s volume unit.
  - `raw_transaction_data` object, nullable, required: This object is dynamically populated by external fuel card integrations.
  - `reference` string, nullable, required: Optional data field for collecting information such as the invoice number, transaction id, or receipt number, for example.
  - `region` string, nullable, required
  - `reset` boolean, required
  - `uk_gallons` string, required: The fuel volume amount in UK gallons. This field will _only_ be used if the [Vehicle](/docs/api/vehicles) is [configured to use UK Gallons](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings), otherwise it will be ignored.
  - `uk_gallons_per_hr` number, float, nullable, required: Running average of UK gallons used per hour. Calculated automatically.
  - `us_gallons` string, required: The fuel volume amount in US gallons. This field will _only_ be used if the [Vehicle](/docs/api/vehicles) is [configured to use US Gallons](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings), otherwise it will be ignored.
  - `us_gallons_per_hr` number, float, nullable, required: Running average of US gallons used per hour. Calculated automatically.
  - `usage_in_hr` string, nullable, required: The automatically calculated usage in hours since the most recent Fuel Entry.
  - `usage_in_km` string, nullable, required: The automatically calculated usage in kilometers since the most recent Fuel Entry.
  - `usage_in_mi` string, nullable, required: The automatically calculated usage in miles since the most recent Fuel Entry.
  - `vehicle_id` integer, nullable, required: The Fleetio `id` of the [Vehicle](/docs/api/vehicles) associated with this Fuel Entry.
  - `vehicle_name` string, required: The name of the [Vehicle](/docs/api/vehicles) associated with this Fuel Entry.
  - `vendor_id` integer, nullable, required: The Fleetio `id` of the [Vendor](/docs/api/vendors) associated with this Fuel Entry.
  - `vendor_name` string, nullable, required: The name of the [Vendor](/docs/api/vendors) associated with this Fuel Entry.
  - `is_sample` boolean, required
  - `custom_fields` CustomFields, nullable: *Full details on working with Custom Fields [here](/docs/overview/custom-fields).
  - `fuel_economy_for_current_user` string, nullable
  - `fuel_economy_units_for_current_user` string
  - `meter_entry` VehicleMeterEntry, nullable, required: A Meter Entry
    - `id` integer
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `auto_voided_at` string, date-time, nullable: The date and time at which this Meter Entry was automatically voided. Formatted according to ISO-8601 in `User`'s local time.
    - `category` 'starting' | 'ending' | 'nightly' | 'manual', nullable: A category to describe the function of this Meter Entry.
    - `meter_type` 'secondary', nullable: Indicates whether or not this Meter is a secondary Meter.
    - `meterable_id` integer, nullable
    - `meterable_type` 'FuelEntry' | 'Issue' | 'PurchaseDetail' | 'ServiceEntry' | 'SubmittedInspectionItem' | 'VehicleAssignment' | 'WorkOrder', nullable: The type of the object with which this Meter Entry is associated.
    - `value` string: The current value of the meter.
    - `vehicle_id` integer, nullable
    - `void` boolean: Indicates whether or not this Meter Entry has been voided.
    - `type` 'GpsMeterEntry', nullable
    - `date` string, date: The date on which this Meter Entry was recorded. Formatted according to ISO-8601.
  - `geolocation` Geolocation, nullable, required
    - `gps_device` string, nullable
    - `original_vendor` string, nullable
    - `exception_distance_in_mi` number, nullable
    - `exception_distance_in_km` number, nullable
  - `map_previews` MapPreviews, required
    - `small` string, nullable
    - `large` string, nullable
    - `small_short` string, nullable
    - `large_short` string, nullable
  - `attachment_permissions` AttachmentPermissions, nullable
    - `read_photos` boolean: Indicates whether the user has read permission for photos.
    - `manage_photos` boolean: Indicates whether the user has permission to manage (eg. upload, delete) photos.
    - `read_documents` boolean: Indicates whether the user has read permission for documents.
    - `manage_documents` boolean: Indicates whether the user has permission to manage (eg. upload, delete) documents.
  - `total_amount` number, float, required: The total amount of the Fuel Entry.
  - `comments` Comment[], required: A list of the comments made on this record.
    - `id` integer, required
    - `created_at` string, date-time: The date and time at which this record was created.
    - `updated_at` string, date-time: The date and time at which this record was most recently updated.
    - `commentable_type` 'Contact' | 'FleetcorCard' | 'FuelEntry' | 'InventoryJournalEntry' | 'Issue' | 'Part' | 'PurchaseOrder' | 'ServiceEntry' | 'ServiceReminder' | 'SubmittedInspectionItem' | 'Vehicle' | 'VehicleAssignment' | 'Vendor' | 'WexCard' | 'WorkOrder', required: The type of record that the Comment will be left on. Must be associated with a matching `commentable_id`.
    - `commentable_id` integer, required
    - `user_id` integer, required
    - `title` string: The title of the Comment.
    - `comment` string, required: The content of the Comment message body.
    - `user_full_name` string, required: The full name of the `User` who created the Comment.
    - `user_image_url` string, nullable, required: The image url for the `User` who created the Comment.
    - `rich_content` object, nullable, required
    - `html_content` string, nullable, required: The comment message body rendered as HTML.
    - `with_mentions` boolean, required: Indicates if the message body contains @mentions.
  - `comments_count` integer, required: The number of comments made on this record.
  - `images` Image2[]: A list of the images attached to this record.
    - `id` integer, required
    - `created_at` string, date-time: The date and time at which this record was created.
    - `updated_at` string, date-time: The date and time at which this record was most recently updated.
    - `imageable_id` integer
    - `imageable_type` 'ExpenseEntry' | 'WorkOrder' | 'Equipment' | 'IssueResolution' | 'ServiceEntry' | 'Vendor' | 'ServiceProgram' | 'Issue' | 'Contact' | 'Part' | 'Vehicle' | 'FuelEntry' | 'SubmittedInspectionItem'
    - `file_name` string: The name of the image file.
    - `file_mime_type` 'image/jpeg' | 'image/gif' | 'image/jif' | 'image/jfif' | 'image/jfi' | 'image/tiff' | 'image/png' | 'image/jpg' | 'image/jpe' | 'image/pdf' | 'image/webp' | 'image/tif' | 'image/psd' | 'image/raw' | 'image/arw' | 'image/cr2' | 'image/nrw' | 'image/k25' | 'image/bmp' | 'image/dip' | 'image/ai' | 'image/eps' | 'image/heif' | 'image/heic' | 'image/ind' | 'image/indd' | 'image/indt' | 'image/jp2' | 'image/j2k' | 'image/jpf' | 'image/jpx' | 'image/jpm' | 'image/mj2' | 'image/x-png'
    - `file_size` number: The size of the image file in bytes.
    - `file_url` string: The URL to access the image file.
    - `full_url` string: The full URL to access the image file, including any necessary authentication or parameters.
  - `images_count` integer, required: The number of images attached to this record.
  - `documents` Document[]: A list of the documents attached to this record.
    - `id` integer, required
    - `created_at` string, date-time: The date and time at which this record was created.
    - `updated_at` string, date-time: The date and time at which this record was most recently updated.
    - `name` string, required: The name of the document.
    - `description` string, required: The description of the document.
    - `documentable_id` integer, required
    - `documentable_type` 'ServiceEntry' | 'FuelEntry' | 'Issue' | 'WorkOrder' | 'ExpenseEntry' | 'Vehicle', required
    - `file_name` string, required: The name of the file.
    - `file_mime_type` string, required: The MIME type of the file.
    - `file_size` number, required: The size of the file in bytes.
    - `file_url` string, required: The URL to access the file.
    - `full_file_url` string, required: The full URL to access the file, including any necessary authentication or parameters.
  - `documents_count` integer, required: The number of documents attached to this record.

## Other responses

- `401`: Request could not be authenticated
- `403`: Insufficient permission to perform this operation
- `404`: The requested resource could not be located
- `422`: Unprocessable Entity
- `500`: Something unexpected happened

---

[API](https://skmtc.dev/fleetio/apis/fleetio-developer-api.md) - [All operations](https://skmtc.dev/fleetio/apis/fleetio-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fleetio/apis/fleetio-developer-api/revisions/49558d744bd7?raw)
