Skip to main content

Update Fuel Entry

PATCH 

https://secure.fleetio.com/api/v1/fuel_entries/:id

Update a Fuel Entry

Request

Path Parameters

    id stringrequired

    Possible values: Value must match regular expression ^[0-9]+$

    The id of the relevant record

Body

    vehicle_idId (integer)

    Possible values: >= 1

    vendor_idinteger

    The Fleetio id of the Vendor associated with this Fuel Entry.

    Possible values: >= 1

    fuel_type_idinteger

    The Fleetio id of the Fuel Type associated with this Fuel Entry.

    Possible values: >= 1

    datedate-time

    We recommend using ISO-8601 formatted dates to avoid ambiguity.

    Example: 2023-03-14T13:46:27-06:00
    us_gallonsfloat

    The fuel volume amount in US gallons. This field will only be used if the Vehicle is configured to use US gallons, otherwise it will be ignored.

    Example: 14.78
    uk_gallonsfloat

    The fuel volume amount in UK gallons. This field will only be used if the Vehicle is configured to use UK gallons, otherwise it will be ignored.

    Example: 12.36
    litersfloat

    The fuel volume amount in liters. This field will be used if the Vehicle is configured to use liters.

    price_per_volume_unitfloat

    The unit price for the Vehicle's configured volume unit.

    Example: 2.98
    meter_entry_attributes object

    Each Fuel Entry requires an associated Meter Entry

    valuefloat

    The value is the actual number on the meter that increments over time. The unit is determined by the configured meter_unit on the associated Vehicle.

    Example: 108043
    voidboolean

    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.

    referencestring

    A reference number or identifier for this Fuel Entry. This field is often used to store a receipt number or other unique identifier.

    partialboolean

    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.

    personalboolean

    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_fieldsobjectnullable

    *Full details on working with Custom Fields here.

    documents_attributes object[]

    An array of one or more document objects to add to the record. Follow our Attaching Documents and Images guide to upload to our third party storage provider in order to obtain file_url.

  • Array [
  • namestring

    The name to give the file which will be shown in the UI.

    Possible values: <= 255 characters

    file_urlstring

    The URL obtained from our storage provider that points to the file.

    Possible values: <= 255 characters

    file_mime_typestring

    The MIME type of the file. For example, application/pdf.

    Possible values: <= 255 characters

    file_namestring

    The name of the file.

    Possible values: <= 255 characters

    file_sizeinteger

    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 guide to upload to our third party storage provider in order to obtain file_url.

  • Array [
  • namestring

    The name to give the image which will be shown in the UI.

    Possible values: <= 255 characters

    file_urlstring

    The URL obtained from our storage provider that points to the image.

    Possible values: <= 255 characters

    file_mime_typestring

    The MIME type of the image. For example, image/png.

    Possible values: <= 255 characters

    file_namestring

    The name of the image.

    Possible values: <= 255 characters

    file_sizeinteger

    The size of the image file in bytes.

  • ]

Responses

OK

Response Headers
    Schema
      idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      cost_per_hrfloatnullablerequired

      The automatically calculated cost per hour since the last Fuel Entry.

      cost_per_kmfloatnullablerequired

      The automatically calculated cost per km since the last Fuel Entry.

      cost_per_mifloatnullablerequired

      The automatically calculated cost per mi since the last Fuel Entry.

      datedate-timerequired

      The date and time at which this Fuel Entry was recorded.

      Example: 2023-03-14T13:46:27-06:00
      external_idstringnullablerequired

      Used to uniquely identify Fuel Entries that are imported from external systems, such as Fleetcor and Wex.

      fuel_type_idintegernullablerequired

      The Fleetio id of the Fuel Type associated with this Fuel Entry.

      Possible values: >= 1

      fuel_type_namestringnullablerequired

      The name of the Fuel Type associated with this Fuel Entry.

      kplfloatnullablerequired

      Running average recorded kilometers per liter (calculated automatically).

      litersstringnullablerequired

      The fuel volume amount in liters. This field will only be used if the Vehicle is configured to use liters, otherwise it will be ignored.

      liters_per_hrfloatnullablerequired

      Running average recorded liters per hour (calculated automatically).

      lp100kfloatnullablerequired

      Running average recorded liters per 100 kilometers (calculated automatically).

      mpg_ukfloatnullablerequired

      Running average recorded miles per UK Gallon (calculated automatically).

      mpg_usfloatnullablerequired

      Running average recorded miles per US Gallon (calculated automatically).

      partialbooleanrequired

      Used to denote a partial fuel up as opposed to a complete fuel up. Learn more about partial Fuel Entries here.

      personalbooleanrequired

      Used to denote a personal expense.

      price_per_volume_unitfloatnullablerequired

      The unit price for the Vehicle's volume unit.

      raw_transaction_dataobjectnullablerequired

      This object is dynamically populated by external fuel card integrations.

      referencestringnullablerequired

      Optional data field for collecting information such as the invoice number, transaction id, or receipt number, for example.

      regionstringnullablerequired
      resetbooleanrequired
      Default value: false
      uk_gallonsstringrequired

      The fuel volume amount in UK gallons. This field will only be used if the Vehicle is configured to use UK Gallons, otherwise it will be ignored.

      uk_gallons_per_hrfloatnullablerequired

      Running average of UK gallons used per hour. Calculated automatically.

      us_gallonsstringrequired

      The fuel volume amount in US gallons. This field will only be used if the Vehicle is configured to use US Gallons, otherwise it will be ignored.

      us_gallons_per_hrfloatnullablerequired

      Running average of US gallons used per hour. Calculated automatically.

      usage_in_hrstringnullablerequired

      The automatically calculated usage in hours since the most recent Fuel Entry.

      usage_in_kmstringnullablerequired

      The automatically calculated usage in kilometers since the most recent Fuel Entry.

      usage_in_mistringnullablerequired

      The automatically calculated usage in miles since the most recent Fuel Entry.

      vehicle_idintegernullablerequired

      The Fleetio id of the Vehicle associated with this Fuel Entry.

      Possible values: >= 1

      vehicle_namestringrequired

      The name of the Vehicle associated with this Fuel Entry.

      vendor_idintegernullablerequired

      The Fleetio id of the Vendor associated with this Fuel Entry.

      Possible values: >= 1

      vendor_namestringnullablerequired

      The name of the Vendor associated with this Fuel Entry.

      is_samplebooleanrequired
      custom_fieldsobjectnullable

      *Full details on working with Custom Fields here.

      fuel_economy_for_current_userstringnullable
      fuel_economy_units_for_current_userstring
      Default value: MPG
      meter_entry objectnullablerequired

      A Meter Entry

      idinteger
      created_atdate-time
      updated_atdate-time
      auto_voided_atdate-timenullable

      The date and time at which this Meter Entry was automatically voided. Formatted according to ISO-8601 in User's local time.

      Example: 2023-03-14T13:46:27-06:00
      categorystringnullable

      A category to describe the function of this Meter Entry.

      Possible values: [starting, ending, nightly, manual]

      meter_typestringnullable

      Indicates whether or not this Meter is a secondary Meter.

      Possible values: [secondary]

      meterable_idNullableId (integer)nullable

      Possible values: >= 1

      meterable_typestringnullable

      The type of the object with which this Meter Entry is associated.

      Possible values: [FuelEntry, Issue, PurchaseDetail, ServiceEntry, SubmittedInspectionItem, VehicleAssignment, WorkOrder]

      valuestring

      The current value of the meter.

      vehicle_idNullableId (integer)nullable

      Possible values: >= 1

      voidboolean

      Indicates whether or not this Meter Entry has been voided.

      Default value: false
      typestringnullable

      Possible values: [GpsMeterEntry]

      datedate

      The date on which this Meter Entry was recorded. Formatted according to ISO-8601.

      Example: 2023-03-14
      geolocation objectnullablerequired
      gps_devicestringnullable
      original_vendorstringnullable
      exception_distance_in_minumbernullable
      exception_distance_in_kmnumbernullable
      map_previews objectrequired
      smallstringnullable
      largestringnullable
      small_shortstringnullable
      large_shortstringnullable
      attachment_permissions objectnullable
      read_photosboolean

      Indicates whether the user has read permission for photos.

      manage_photosboolean

      Indicates whether the user has permission to manage (eg. upload, delete) photos.

      read_documentsboolean

      Indicates whether the user has read permission for documents.

      manage_documentsboolean

      Indicates whether the user has permission to manage (eg. upload, delete) documents.

      total_amountfloatrequired

      The total amount of the Fuel Entry.

      comments object[]required

      A list of the comments made on this record.

    • Array [
    • idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      commentable_typeCommentableType (string)required

      The type of record that the Comment will be left on. Must be associated with a matching commentable_id.

      Possible values: [Contact, FleetcorCard, FuelEntry, InventoryJournalEntry, Issue, Part, PurchaseOrder, ServiceEntry, ServiceReminder, SubmittedInspectionItem, Vehicle, VehicleAssignment, Vendor, WexCard, WorkOrder]

      commentable_idId (integer)required

      Possible values: >= 1

      user_idId (integer)required

      Possible values: >= 1

      titlestringdeprecated

      The title of the Comment.

      commentstringrequired

      The content of the Comment message body.

      user_full_namestringrequired

      The full name of the User who created the Comment.

      user_image_urlstringnullablerequired

      The image url for the User who created the Comment.

      rich_contentobjectnullablerequired
      html_contentstringnullablerequired

      The comment message body rendered as HTML.

      with_mentionsbooleanrequired

      Indicates if the message body contains @mentions.

    • ]
    • comments_countintegerrequired

      The number of comments made on this record.

      Possible values: >= 0

      images object[]

      A list of the images attached to this record.

    • Array [
    • idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      imageable_idId (integer)

      Possible values: >= 1

      imageable_typeImageableType (string)

      Possible values: [ExpenseEntry, WorkOrder, Equipment, IssueResolution, ServiceEntry, Vendor, ServiceProgram, Issue, Contact, Part, Vehicle, FuelEntry, SubmittedInspectionItem]

      file_namestring

      The name of the image file.

      file_mime_typeImage MIME Type (string)

      Possible values: [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_sizenumber

      The size of the image file in bytes.

      file_urlstring

      The URL to access the image file.

      full_urlstring

      The full URL to access the image file, including any necessary authentication or parameters.

    • ]
    • images_countintegerrequired

      The number of images attached to this record.

      Possible values: >= 0

      documents object[]

      A list of the documents attached to this record.

    • Array [
    • idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      namestringrequired

      The name of the document.

      descriptionstringrequired

      The description of the document.

      documentable_idId (integer)required

      Possible values: >= 1

      documentable_typeDocumentableType (string)required

      Possible values: [ServiceEntry, FuelEntry, Issue, WorkOrder, ExpenseEntry]

      file_namestringrequired

      The name of the file.

      file_mime_typestringrequired

      The MIME type of the file.

      file_sizenumberrequired

      The size of the file in bytes.

      file_urlstringrequired

      The URL to access the file.

      full_file_urlstringrequired

      The full URL to access the file, including any necessary authentication or parameters.

    • ]
    • documents_countintegerrequired

      The number of documents attached to this record.

      Possible values: >= 0

    Authorization: Authorization

    name: Authorizationtype: apiKeyin: headerdescription: Prefix the value with "Token", for example: "Token 76cbe06c49a64".
    You can generate a new API key [here](https://secure.fleetio.com/api_keys).
    name: Account-Tokentype: apiKeyin: headerdescription: You can find your Account-Token [here](https://secure.fleetio.com/api_keys)
    curl -L -X PATCH 'https://secure.fleetio.com/api/v1/fuel_entries/:id' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Token <Authorization>' \
    -H 'Account-Token: <Authorization>' \
    -d '{
    "vehicle_id": 0,
    "vendor_id": 0,
    "fuel_type_id": 0,
    "date": "2023-03-14T13:46:27-06:00",
    "us_gallons": 14.78,
    "uk_gallons": 12.36,
    "liters": 0,
    "price_per_volume_unit": 2.98,
    "meter_entry_attributes": {
    "value": "108043",
    "void": true
    },
    "reference": "string",
    "partial": true,
    "personal": true,
    "custom_fields": {},
    "documents_attributes": [
    {
    "name": "string",
    "file_url": "string",
    "file_mime_type": "string",
    "file_name": "string",
    "file_size": 0
    }
    ],
    "images_attributes": [
    {
    "name": "string",
    "file_url": "string",
    "file_mime_type": "string",
    "file_name": "string",
    "file_size": 0
    }
    ]
    }'
    Request Collapse all
    Base URL
    https://secure.fleetio.com/api
    Auth
    Parameters
    — pathrequired
    Body
    {
      "vehicle_id": 0,
      "vendor_id": 0,
      "fuel_type_id": 0,
      "date": "2023-03-14T13:46:27-06:00",
      "us_gallons": 14.78,
      "uk_gallons": 12.36,
      "liters": 0,
      "price_per_volume_unit": 2.98,
      "meter_entry_attributes": {
        "value": "108043",
        "void": true
      },
      "reference": "string",
      "partial": true,
      "personal": true,
      "custom_fields": {},
      "documents_attributes": [
        {
          "name": "string",
          "file_url": "string",
          "file_mime_type": "string",
          "file_name": "string",
          "file_size": 0
        }
      ],
      "images_attributes": [
        {
          "name": "string",
          "file_url": "string",
          "file_mime_type": "string",
          "file_name": "string",
          "file_size": 0
        }
      ]
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!