v1

latestOpenAPI 3.1.02026-07-2617501.1 MB

Update a fuel purchase

put/v1/fuel_purchases/{id}

Path parameters

idinteger required

Specify the ID of the fuel purchase transaction which needs to be updated.

Query parameters

sourcestring

This is the payment source of the current fuel purchase. Allowed values are as follows: <b>EFS_INTEGRATION</b>, <b>COMDATA_INTEGRATION</b>, <b>WEX_INTEGRATION</b>, <b>Manual</b>, <b>Motive Card</b>, <b>GIR (GIR W150 Fuel Management System)</b>.

Request body

vehicle_idstring required

Specify the ID of the vehicle for which you are updating the fuel purchase.

driver_idstring required

Specify the ID of the driver for whom you are updating this fuel purchase.

purchased_atstring date

Time of fuel purchase

jurisdictionstring

Jurisdiction in which fuel was purchased

fuel_typestring

Type of fuel. Valid values are ['diesel', 'gasoline', 'propane', 'lng', 'cng', 'ethanol', 'methanol', 'e85', 'm85', 'a55', 'biodiesel', 'other']

total_coststring

Specify the total cost of the fuel purchase.

currencystring

Specify the currency in which the fuel was purchased. Allowed values are USD or CAD.

fuelstring

Specify the total amount of the fuel purchased.

fuel_unitstring

Specify the units of the fuel. Allowed values are gal for Gallons, or ltr for Litres.

ref_nostring

Specify the reference number of the fuel purchase.

vendorstring

Enter the name of the fuel vendor.

odometerinteger

Odometer reading at time of fuel purchase

odometer_unitstring

Specify the units of the odometer at the time of the fuel purchase. Allowed values are: KM for Kilometres, or MI for Miles.

receiptstring[]

Specify the URL of the location where the receipt is uploaded.

locationstring

Specify the location of the fuel purchase.

Response

200

Example response

{
  "fuel_purchase": {
    "id": 699,
    "offline_id": "c4ef3132-3a75-43c7-acc7-9b4aa8c866c9",
    "purchased_at": "2018-06-13T18:43:00Z",
    "jurisdiction": "AL",
    "fuel_type": "diesel",
    "total_cost": 150,
    "currency": "USD",
    "fuel": 12,
    "fuel_unit": "gal",
    "odometer_unit": "mi",
    "location": "location",
    "uploader": {
      "id": 8451,
      "first_name": "George",
      "last_name": "Henry",
      "email": "george.henry+bn@keeptruckin.com",
      "role": "dispatcher"
    },
    "vehicle": {
      "id": 4116,
      "number": "Jason's Vehicle"
    },
    "driver": {
      "id": 2463,
      "first_name": "Paul",
      "last_name": "Walker",
      "username": "paul",
      "email": "demo@keeptruckin.com",
      "status": "active",
      "role": "driver"
    }
  }
}